I'm not sure if this is the right place to ask this question but here it
goes. I'm trying to write a JMS client. Everything looks correct but I get
a NullPointerException down in the topicConnection.start() code. What's
interesting is that this code runs fine from within a session EJB.
Here's what I'm trying:
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,
"com.evermind.server.rmi.RMIInitialContextFactory");
p.put(Context.PROVIDER_URL, "ormi://localhost/");
p.put(Context.SECURITY_PRINCIPAL, "admin");
p.put(Context.SECURITY_CREDENTIALS, "orion+rocks");
InitialContext ic = new InitialContext(p);
TopicConnectionFactory tcf =
(TopicConnectionFactory)ic.lookup("jms/TopicConnectionFactory");
TopicConnection topicConnection = tcf.createTopicConnection();
Topic topic = (Topic)ic.lookup("jms/Topic”);
topicConnection.start();
I tried to rule out a problem with my code by running the JMSChat demo but I
get the same error. Here's the stack trace.
C:\orion\demo\jms>java -Djava.naming.security.credentials=orion+rocks -jar
jmschat.jar
Exception in thread "main" java.lang.NullPointerException
at java.io.DataOutputStream.writeUTF(DataOutputStream.java:329)
at java.io.DataOutputStream.writeUTF(DataOutputStream.java:306)
at com.evermind.server.jms.cj.<init>(JAX)
at com.evermind.server.jms.b8.start(JAX)
at JMSChat.run(JMSChat.java:61)
at JMSChat.main(JMSChat.java:29)
Can anyone shed some light on this for me? Thanks
Christopher Sellers
Williams Communications