This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Weblogic 9.1 JNDI problem

 
Tero Ahonen
Greenhorn
Posts: 26
  • 0
  • Mark post as helpful
  • send pies
  • 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 ]
 
Chris Mathews
Ranch Hand
Posts: 2712
  • 0
  • Mark post as helpful
  • send pies
  • 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: 2712
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic