Loading a directory with getResource in Java

Solution Unverified - Updated -

Issue

  • What is the correct behavior of calling getResource on Class or ClassLoader with a directory in a jar?
  • Invoking the following code behaves differently on WebLogic and EAP:

    URL baseUrl = ExampleClass.class.getResource(".");
    URL url = new URL(baseUrl, "META-INF/wsdls/example.wsdl");
    
  • What is the correct behavior of calling getResource on Class or ClassLoader with a directory?

Environment

  • Red Hat JBoss Enterprise Application Platform 6

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.