I had the same problem and when I changed 
lookup("TopicConnectionFactory") to lookup("ConnectionFactory")
it worked for jboss3.


McLain, Mark - Apogent wrote:
> I have written the following test method in a JUnit 3.7 TestCase:
> 
>  
> 
>     public void testSendMessageToProcessor()
> 
>             throws NamingException, JMSException
> 
>     {
> 
>         Context ctx = new InitialContext();
> 
>         TopicConnectionFactory factory =
> 
>                 (TopicConnectionFactory) 
> ctx.lookup("TopicConnectionFactory");
> 
>     -->  TopicConnection connection = factory.createTopicConnection();
> 
>         TopicSession session = connection.createTopicSession(false,
> 
>                               
>                                Session.AUTO_ACKNOWLEDGE);
> 
>         Topic topic = (Topic) ctx.lookup("topic/testTopic");
> 
>         TopicPublisher sender = session.createPublisher(topic);
> 
>         TextMessage message = session.createTextMessage();
> 
>         message.setText("This is only a test");
> 
>         sender.publish(message);
> 
>         if(connection != null)
> 
>         {
> 
>             connection.close();
> 
>         }
> 
>     }
> 
>  
> 
> This method executed successfully on JBoss 2.4.4.  On JBoss 2.4.6, 
> however, it fails with a NullPointerException at the line indicated by 
> the arrow.  I have verified via JNDIView that TopicConnectionFactory is 
> available; I have also verified that topic/testTopic is available, 
> should the method execute beyond where it has thus far.  I would greatly 
> appreciate any help, as neither I nor my colleagues have been able to 
> spot any flaws in the code or the configuration.  I'm running J2SDK 
> 1.3.1_03 on Windows XP Pro.
> 
>  
> 
> Thank you very much for your time.
> 
>  
> 
>  
> 




_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas - 
http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to