File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes BEA/Weblogic and the fly likes Weblogic 9.1 JNDI problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Weblogic 9.1 JNDI problem" Watch "Weblogic 9.1 JNDI problem" New topic
Author

Weblogic 9.1 JNDI problem

Tero Ahonen
Greenhorn

Joined: May 24, 2001
Posts: 26
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 ]

-Tero
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
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

Joined: Jul 18, 2001
Posts: 2712
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

Joined: May 24, 2001
Posts: 26
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

Joined: May 24, 2001
Posts: 26
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

Joined: May 24, 2001
Posts: 26
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
 
subject: Weblogic 9.1 JNDI problem