Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Resources JAR J2EE

  Asked By: Lourdes    Date: Aug 21    Category: Java    Views: 906
  

Has anyone else had a problem with accessing resouces in a jar within a J2EE framework on a Borland AppServer?
We are using this code, but the URL returned is NULL...

In QueryBean


public class QueryBean ... {
static private final Category category = Logging.getCategory(...);
}

In Logging.getCategory():

public static getCategory() {
...
Configuration.getProperty("bla");
}

Configuration:

public class Configuration {
static private final Properties PROPERTIES = VscProperties.create(Configuration.class);
...
}

Finally, in VscProperties.create():
VscProperties create(Class yourClass) {
// Generate the properties filename
URL theURL = yourClass.getClassLoader().getResource(yourClass, "name");

// ERROR: URL is NULL!!!
}

"yourClass" is Configuration.class, which is accessed though an EJB, with an indirect call through another class, Logging. The property file is in the EJB jar, like all other classes, but the URL for it is always null. The same code works fine in a non-EJB environment (WebApp, Java App.).

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Douglas Sullivan     Answered On: Aug 21

I had this problem  with J2EE but I downloan J2EE
package from SUN and copy J2EE.jar to Borland Lib
directory then add the jar  to my project, I think you
should do this.

 
Didn't find what you were looking for? Find more on Resources JAR J2EE Or get search suggestion and latest updates.




Tagged: