tags:

views:

267

answers:

1

I have a resource file located in WAR file stored inside of EAR.

The location is, to be precise: myApp-web.ear/myApp.war/WEB-INF/classes/file.properties.

I'm trying to access this file from another class located in JAR file (not within the main EAR).

This is how I'm trying to access the file:

SomeClass.class.getResourceAsStream("/WEB-INF/classes/file.properties");

The result is null.

This used to work well in JBoss 4.2, but does not work in 5.1.

Any ideas?

+1  A: 

This should never have worked. WEB-INF/classes/ is already part of the classpath, so getResourceAsStream("/file.properties") is the correct way to locate the file.

Aaron Digulla