I am trying to deploy my application to openshift and I got to a problem running it. The application is deployed locally to the exactly same version of JBoss (JBoss AS 7.1.1 Final) and it is working, while it does not work when deployed to openshift. I am not using any scaling.
The problem is with the code sample:
String s= SimpleClass.class.getResource("/myproperties.properties").getPath();
prop.load(new FileInputStream(s));
When deployed locally to JBoss AS, it works like expected. However when I deploy it to the openshift instance, the exception occurs:
java.io.FileNotFoundException: /content/Mailinglist.war/WEB-INF/classes/myproperties.properties (No such file or directory)
java.io.FileInputStream.open(Native Method)
java.io.FileInputStream.<init>(FileInputStream.java:146)
java.io.FileInputStream.<init>(FileInputStream.java:101)
mailinglistonline.server.export.util.PropertiesParser.parseDatabaseConfigurationFile(PropertiesParser.java:15)
EDIT:
The Mailinglist.war/WEB-INF/classes/myproperties.properties
suffix is the correct and the same as I have locally, however the /content
prefix is quite weird, since probably no /content directory exists in the openshift. This path should be probably going to the JBoss instance that deployed that .war. The question is mainly why is such path/prefix generated and if I can somehow get it working.