• 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 9.1 JNDI problem

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a problem with JNDI code in weblogic 9.1. It seems that all my code that read something from JNDI is stuck. I'm creating reference to JNDI like it is said in BEA help site Context ctx = new InitialContext() or with constructor InitialContext(url, "weblogic.jndi.WLInitialContextFactory"). I took a thread dump from server and saw in dump traces that all stuck threads were using my "service locator" class.

I'm using the JNDI to get references to EJBs and I'm closing the context in finally block after I have used it. Here is an example about my lookup code.


[ March 28, 2006: Message edited by: Tero Ahonen ]
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ouch... you are getting and modifying the System Properties for your WebLogic Server and using them to create the InitialContext. Not good...

Try something like this:
 
Chris Mathews
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
BTW... make sure you don't have an synchronization code scattered around your service locator that might be causing threads to lock.
 
Tero Ahonen
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for your answer. I'll try your solution. I dont have any synchronized method or block in my code.

Lets see does this help.
 
Tero Ahonen
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This stuck stuff is very strange, cause exactly same code worked fine in Weblogic 8.1.4. Only difference is, that now it is compiled with Java 5 and also executed in Java 5 env. I'm using BEA's JRockit as runtime virtual machine.
 
Tero Ahonen
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I made the changes that Chris Mathews adviced and now the application runs lika a Buick. Thank you for your advice Chris.
 
reply
    Bookmark Topic Watch Topic
  • New Topic