Moving a 14 module app from Ant to IDEA
People,
I have made a little progress . . :
I have:
- a working ant build that runs the original Java app fine
In IDEA 2017.2 EAP
- imported the application and have got all 14 modules building with no errors
- installed eclipser and converted the launch file
However, I when I try and run the program I get:
Exception in thread "main" java.lang.NullPointerException
at java.util.Properties$LineReader.readLine(Properties.java:434)
at java.util.Properties.load0(Properties.java:353)
at java.util.Properties.load(Properties.java:341)
at com.thisiscool.honesty.common.PropertiesManager.getProperties(PropertiesManager.java:81)
.
.
Line 81 is:
properties.load(getClass().getResourceAsStream(resource));
I came across the same problem with the App when I tried to get it going with Eclipse about a year ago. It looks like if the code might run happily with the jar file and the classes that were built by ant? - but if the classes etc get rebuilt then this problem occurs . . The resource is a file called:
"app.properties.linux"
I tried adding:
";?*linux"
to Settings -> Compiler -> Resource Patterns with no improvement - from the suggestion here:
https://stackoverflow.com/questions/26328040/intellij-idea-getclass-getresource-return-null
Any suggestions about how I should proceed?
Thanks,
Phil.
Please sign in to leave a comment.
Check the output directory and make sure this file appears there so that it's available via classpath. The proper way is to keep such files in a directory that is configured as Resources in the module paths settings. All the files from the resource directories are copied to the output (classpath) regardless the resource patterns setting. This setting affects resources that are in the source roots vs resource roots.
Further help would be complicated without MCVE.
Serge,
Thanks! I have finally got it sorted out - now I will be asking some DB-related questions . .
Regards,
Phil.