Title: java.lang.NullPointerException in JMS

Hi

I've created my own topic-connection-factory and own topic in jms.xml
<topic-connection-factory host="172.16.61.1" location="jms/LoggerTopicConnectionFactory" port="9127"/>

<topic name="ApplicationLoggerTopic" location="jms/appLoggerTopic">
  <description>JMS Logger</description>
</topic>

I have referenced these in my application-client.xml as

 <application-client>
        <display-name>App Logger</display-name>
        <resource-ref>
                <res-ref-name>jms/LoggerTopicConnectionFactory</res-ref-name>
                <res-type>javax.jms.TopicConnectionFactory</res-type>
                <res-auth>Container</res-auth>
        </resource-ref>
        <resource-ref>
                <res-ref-name>jms/ApplicationLoggerTopic</res-ref-name>
                <res-type>javax.jms.Topic</res-type>
                <res-auth>Container</res-auth>
        </resource-ref>
 </application-client>

I reference these in my code, and print out the topic name which display "Demo Topic" !!!

TopicConnectionFactory connFactory = (TopicConnectionFactory)new InitialContext().lookup("java:comp/env/jms/LoggerTopicConnectionFactory");

this.connection = connFactory.createTopicConnection();
this.loggerTopic = (Topic)new InitialContext().lookup("java:comp/env/jms/ApplicationLoggerTopic");

When the code executes connection.start() I get the following error.
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 AppLogger.LoggerListeners.JMSLoggerSubscriber.initSubscriber(JMSLogge
rSubscriber.java:116)
        at AppLogger.LoggerListeners.JMSLoggerSubscriber.<init>(JMSLoggerSubscri
ber.java:76)
        at AppLogger.LoggerListeners.JMSLoggerSubscriber.main(JMSLoggerSubscribe
r.java:33)

Has anyone any idea what I've missed, or know how to resolve this.

Cheers

Matt

Matt Simmerson
IT Consultant
smart421 - Smart solutions for the 21st century
 
http://www.smart421.com
Wap Site: wap.smart421.com
Tel:   01473 408720
Fax:  01473 408753
Mob: 07759 258083
email: [EMAIL PROTECTED]

Information contained in this e-mail and any attachments is confidential
and intended for the use of the addressee only.  Dissemination,
distribution, copying or use of this communication without prior permission
of the addressee is strictly prohibited. If you have received this
transmission in error, please advise the originator by reply e-mail and
delete it. Thank you.

Reply via email to