my dog learned polymorphism*
The moose likes EJB and other Java EE Technologies and the fly likes Issue with [env-entry] element in Weblogic 6.1 descriptors... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Issue with [env-entry] element in Weblogic 6.1 descriptors..." Watch "Issue with [env-entry] element in Weblogic 6.1 descriptors..." New topic
Author

Issue with [env-entry] element in Weblogic 6.1 descriptors...

SAFROLE YUTANI
Ranch Hand

Joined: Jul 06, 2001
Posts: 257
I know it's possible to define <env-entry> elements in web.xml for environment properties of a web application. But how do you access <env-entry> elements from classes that do not exist within a web application? In other words, this is my problem:
I have an EAR file, enterprise.ear, which contains the following...
employee.jar
employeeSearchEJB.jar
webApp1.war
META-INF/
  application.xml
The employee.jar file is a utility archive that contains common classes, one of which is a class called LogManager. LogManager needs to read environment properties in order to initialize itself. Currently, LogManager reads these properties from a property file, and therefore it needs to know the name of the property file in order to access it. I dont like this approach because I'm forced to hard-code the name of the property file in LogManager. I would rather leverage the power of J2EE deployment descriptors and use the <env-entry> element to define the environment properties for the LogManager class. Then, I would simply use JNDI to get the values of the <env-entry> elements without ever having to specify their location aside from the default JNDI context; java:comp/env, which is standard anyway.
The problem I'm having is that you can define the <env-entry> element in only 2 types of deployment descriptors; namely, web.xml and ejb-jar.xml, neither of which are available to LogManager because LogManager exists at the EAR root level. I was hoping application.xml supported the <env-entry> element, but it doesn't.
Any suggestions?
SAF
[ March 01, 2002: Message edited by: SAFROLE YUTANI ]
 
Consider Paul's rocket mass heater.
 
subject: Issue with [env-entry] element in Weblogic 6.1 descriptors...