This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java and have Dr. Raoul-Gabriel Urma & Richard Warburton on-line!
See this thread for details.
Win a copy of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java this week in the Agile and Other Processes forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

NamingException: Failed to initialize the ORB

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am doing a JNDI lookup in some Java code using WebSphere 5.1. I compile and run my code and everything works ok.

I export the Java code out of Websphere and using Sun's ver 1.3.1 JVM I try to run the code. I get the following error:


Can anyone shed any light as to why this is happening? I have added many IBM jars to my classpath, but still get this error.

For completeness, my InitialContext is setup as the following


Any help is greatly appreciated,
Dave
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dave, could you solve the problem you have post about javax.naming.NamingException?

>>I am doing a JNDI lookup in some Java code using WebSphere 5.1. I compile >>and run my code and everything works ok.

>>I export the Java code out of Websphere and using Sun's ver 1.3.1 JVM I >>try to run the code. I get the following error:

>>code:
--------------------------------------------------------------------------------

>>A naming exception occurred: javax.naming.NamingException: Failed to >>initialize the ORB [Root exception is >>java.lang.reflect.InvocationTargetException]

--------------------------------------------------------------------------------

Thanks a lot.
Matias
 
Dave Edds
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Unfortunately I still have not found a solution to my problem! I have tried running using Sun's JVM and lots of jar files from IBM, but it still doesn't work.

As far as I understand it (which admittidly is not very well) there appears to be major differences between IBM's JVM and Sun's JVM. So code that I write for the IBM JVM does not necessarily run outside of IBM's JVM!

Now I thought this would be in violation of the Java standards and so IBM's JVM could not be classed as an official Java VM! But there's obviously some subtelty as to why this is not working that I am not aware of.

Again, if anyone can shed any light onto this whole topic, I would be very interested.

Thanks,
Dave
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dave,
You are right in pointing out the incompatibility between IBM websphere JRE and the Standard Sun JRE. I was struggling with the same problem for 5 days, and today I replaced the Sun JRE mentioned in my system path by the IBM Websphere JRE. My JMS client is a simple program trying to lookup JMS objects in the WAS jndi context. Before I made the tweak in the path, the client was working from inside WSAD, but not if I ran it from an external command prompt. That seems to be sorted out now.

Apart from switching the JRE, you also need a few jar file. My example
which uses the following packages:

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.jms.*;


To work with these set of packages and set the JRE to IBM's, you may use the following env varibales:


-----------------------------------------------------------------------------
set WSAD_HOME=C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1

set PATH=%WSAD_HOME%\runtimes\base_v5\java\jre\bin;%WSAD_HOME%\runtimes\base_v5\java\bin;%PATH%

set CLASSPATH=.

set CLASSPATH=%CLASSPATH%;%WSAD_HOME%\runtimes\base_v5\lib\ecutils.jar
set CLASSPATH=%CLASSPATH%;%WSAD_HOME%\runtimes\base_v5\lib\namingclient.jar
set CLASSPATH=%CLASSPATH%;%WSAD_HOME%\runtimes\base_v5\lib\j2ee.jar
set CLASSPATH=%CLASSPATH%;%WSAD_HOME%\runtimes\base_v5\lib\messagingClient.jar
set CLASSPATH=%CLASSPATH%;%WSAD_HOME%\runtimes\base_v5\mqjms\Java\lib\com.ibm.mq.jar;
set CLASSPATH=%CLASSPATH%;%WSAD_HOME%\runtimes\base_v5\mqjms\Java\lib\com.ibm.mqjms.jar

set CLASSPATH=%CLASSPATH%;%WSAD_HOME%\wstools\eclipse\plugins\com.ibm.websphere.v5_5.0.3.1\implfactory.jar

----------------------------------------------------------------------------
[Please modify the path according to your setup]
Hopefully, there settings should work.
Thanx
 
Dave Edds
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Goutam,

Thanks for your reply. When I have the time I will try that out and report back here with my results.

Thanks again,
Dave
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Changing the JRE for my project to the WAS JRE helped me resolve this issue of Failed to initialize the ORB [Root exception is org.omg.CORBA.INITIALIZE:
 
What is that? Is that a mongol hoarde? Can we fend them off with this tiny ad?
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!