• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can someone help me ?
 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic