Adding to the classpath for a WAR in JBoss EAP 5.x
Issue
- How do we configure a resources directory so that, for example, property files can be found within a war, but outside the WEB-INF/classes directory?
webapp.war
├── META-INF
│ └── MANIFEST.MF
├── resources
│ └── some.properties
└── WEB-INF
├── classes
│ └── ...
└── web.xml
- I’m in the process of upgrading our JBoss EAP application server from version 4.0.5 to 5.1 but I’m having issues deploying my existing web applications. I have several war files that have resources stored inside the war file that I access via the class loader like
this.getClass().getClassLoader().getResource(...)
and everygetResource
call seems to return null.
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 5.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.