• 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

Failed to initialize the ORB using websphere.

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
make the question short,to get the reply.!
reply
    Bookmark Topic Watch Topic
  • New Topic