Adding to the classpath for a WAR in JBoss EAP

Solution Unverified - Updated -

Issue

  • How do we configure a resorces 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 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:

    this.getClass().getClassLoader().getResource(...)

    Every getResource call seems to return null.

Environment

  • JBoss Enterprise Application Platform (EAP) 5.0.x
  • JBoss Enterprise Application Platform (EAP) 5.1.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.