Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
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?
[ March 01, 2002: Message edited by: SAFROLE YUTANI ]
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!