• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

WebLogic 10.3: how to add System Property/new global JNDI object at server startup

 
Emanuele Ghe
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am migrating from JBoss to WebLogic, and I need to add some object to the JNDI tree.

What I need to do is bind my properties file path to a JNDI name, so I can lookup from my applications (EJB 2.1) these path and access
properties without carving the path into code.

In jboss I used the "properties-service.xml" file, in which I can define key/values pairs, and the key will be published in the server global JNDI directory.

How can I do the same in weblogic 10.3 ?

Thanks !
 
Emanuele Ghe
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone help me ?
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Emanuele,

I am not aware of an automated process that can achieve what you want. One way to do this would be to write a startup class that will bind these key/value pairs for you when the server starts. If you are paying for a weblogic license, you should email support. That might shed some light into the problem. If you do find a way to do this declaratively, do let us know.
 
Emanuele Ghe
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I reply here what I've found for all the other members.

First of all this post points out how to do something similar:

http://forums.oracle.com/forums/thread.jspa?forumID=598&threadID=1017093


Next, this article point some best practices on managing properties file:

http://www.javaworld.com/javaworld/javaqa/2003-08/01-qa-0808-property.html



At the end, the solution I came from reading these posts/articles is to deploy an ear containing the properties files as a shared library and
then use the ClassLoader to load the files into my modules.


I hope this can help others as it did for me.
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for sharing your solution.

Since your did indeed use shared libraries, perhaps you could have loaded the properties files into the JNDI directly instead of accessing the class files in the other application using the ClassLoader. Just a suggestion
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic