Java - getResourceAsStream returning null

Problem:

ProcessTest.class.getResourceAsStream("H2/ddl/spring_batch/schema-drop.sql");

Solution:

Check that the folder (""H2/ddl/spring_batch") is part of the project classpath

in eclipse:
  • Right click on project
  • Click "Build Path"
  • Click "Configure Build Path..."
  • Select "Java Build Path"
  • Edit "Source" accordingly

Comments

Popular posts from this blog

Oracle - duplicate fields in RECORD,TABLE or argument list are not permitted

Oracle - ORA-29282: invalid file ID, ORA-06512: at "SYS.UTL_FILE"