This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes EJB and other Java EE Technologies and the fly likes Failed to initialize the ORB using websphere. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Failed to initialize the ORB using websphere. " Watch "Failed to initialize the ORB using websphere. " New topic
Author

Failed to initialize the ORB using websphere.

Savita Nath
Greenhorn

Joined: Aug 12, 2004
Posts: 1
hi all,
i have prob in running client prog. i hve written a message driven bean which is deployed sucessfully on server(Websphere).

when running client prog i get the foll error msg:

Getting InitialContext...
about to retrieve initial context.
url provided..{java.naming.provider.url=iiop:127.0.0.1:9090}
Wsn class found..
initial context has been created.javax.naming.InitialContext@4fb549
Looking up for connection factory..
Unable to lookup jndi name..javax.naming.NamingException: Failed to initialize t
he ORB [Root exception is java.lang.reflect.InvocationTargetException]
Excep..java.lang.NullPointerException


my client prog is:

package beans.message;

import javax.jms.*;
import javax.naming.*;

import java.util.Properties;


public class SampleMsgClient
{
public static void main(String args[])
{
InitialContext ctx=null;
TopicConnectionFactory conFactory=null;
TopicConnection con=null;
Topic topic=null;
TopicSession session=null;
TopicPublisher publisher=null;
TextMessage txtMsg=null;
Properties p = null;


final int NUM_MSGS=3;
try
{
System.out.println("Getting InitialContext...");
ctx= getInitialContext();

System.out.println("initial context has been created."+ctx);
p=new Properties();


System.out.println("Looking up for connection factory..");
conFactory=(TopicConnectionFactory) ctx.lookup("jms/MyConnectionFactory");
System.out.println("Lookup sucessfull for Topic Connection Factory..");
topic=(Topic) ctx.lookup("jms/MyTopicname");
System.out.println("Lookup for Topic jndi successfull..");

}catch(NamingException exe)
{
System.out.println("Unable to lookup jndi name.."+exe);
}catch(Exception mExe)
{
System.out.println("Exception in main.."+mExe);
}

try
{
con= conFactory.createTopicConnection();
con.start();
System.out.println("Topic Connection started....");
session=con.createTopicSession(false,Session.AUTO_ACKNOWLEDGE);
publisher= session.createPublisher(topic);

txtMsg = session.createTextMessage();

System.out.println("Created Text Message....");

//tm.setText("this is a sample test message"

for(int i=0;i<NUM_MSGS;i++)
{
txtMsg.setText("This is message...." + (i+1));
System.out.println("Sending message....." + txtMsg.getText());

}//for
publisher.publish(txtMsg);
System.out.println("Publishing Message....");
}catch(Exception exe)
{
System.out.println("Excep.."+exe);
}
finally
{
try
{
if(con!=null)
{
con.close();
}
}catch(JMSException jExe)
{
System.out.println("Unable to close connection.....");
}

}

}//main
public static InitialContext getInitialContext() throws NamingException
{
Properties p = new Properties();


try
{
System.out.println("about to retrieve initial context.");



p.put(Context.PROVIDER_URL, "iiop:127.0.0.1:9090");
System.out.println("url provided.."+p);

p.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");



System.out.println("Wsn class found..");


return new InitialContext(p);

}
catch (Exception e)
{
System.out.println("Exception in getInitialContext.."+e);
e.printStackTrace();
return null;

}

}


}//class


plz help.
thanks
Ashok kumar Reddy
Greenhorn

Joined: Aug 12, 2004
Posts: 5
make the question short,to get the reply.!
 
wood burning stoves
 
subject: Failed to initialize the ORB using websphere.