We have had the same problem.  From what I've seen if you attempt to define
a Topic or Queue connection factory in jms.xml you will get that null
pointer exception.  There are default connection factories that work fine,
jms/TopicConnectionFactory and jms/QueueConnectionFactory.  We used these
with RMIInitialContextFactory and it worked.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Vlad Petric
Sent: Wednesday, September 20, 2000 4:59 AM
To: Orion-Interest
Subject: Re: Obscure JMSException



If I put a connection factory in jms.xml bound to
jms/topicConnectionFactory, it gives this error. If I don't put it,
everything works just fine. So I only have to specify the binding in
application-client.xml. But that raises another problem: it is mandatory to
use
ApplicationClientInitialContextFactory, and not RMIInitialContextFactory.

So why doesn't it work when the jndi binding is specified in jms.xml ?

Vlad



> I get a:
>
> java.lang.NullPointerException
>         at java.io.DataOutputStream.writeUTF(DataOutputStream.java:317)
>         at com.evermind.server.jms.b5.<init>(JAX)
>         at com.evermind.server.jms.b0.start(JAX)
>         at Subscriber.<init>(Subscriber.java:33)
>         at Subscriber.main(Subscriber.java:75)
>
> when doing a topicConnection.start
>
> At the same time jmschat works just fine. Any idea what I'm doing wrong
> ?
>
> Thanks in advance
>
> Orion 1.2.7. jdk 1.3beta IBM/Linux
>
> The code:
>
>   InitialContext ic = new InitialContext();
>   TopicConnectionFactory tcf = (TopicConnectionFactory)
>    ic.lookup("java:comp/env/jms/topicConnectionFactory");
>
>   topicConnection = tcf.createTopicConnection();
>
>   topic = (Topic) ic.lookup("java:comp/env/jms/TheTopic");
>
>   topicSession = topicConnection.createTopicSession(false,
>    TopicSession.AUTO_ACKNOWLEDGE);
>
>   topicSubscriber = topicSession.createSubscriber(topic, null, true);
>
>   topicPublisher = topicSession.createPublisher(topic);
>
>   topicSubscriber.setMessageListener(this);
>
>   topicConnection.start();
> ======================================================
> application-client.xml:
>
> <?xml version="1.0"?>
> <!DOCTYPE application-client PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE
> Application Client 1.2//EN"
> "http://java.sun.com/j2ee/dtds/application-client_1_2.dtd">
> <application-client>
>  <display-name>Unnamed</display-name>
>  <resource-ref>
>   <res-ref-name>jms/topicConnectionFactory</res-ref-name>
>   <res-type>javax.jms.TopicConnectionFactory</res-type>
>   <res-auth>Container</res-auth>
>  </resource-ref>
>  <resource-ref>
>   <res-ref-name>jms/TheTopic</res-ref-name>
>   <res-type>javax.jms.Topic</res-type>
>   <res-auth>Container</res-auth>
>  </resource-ref>
> </application-client>



Reply via email to