java.lang.IllegalArgumentException: MQ:Topic:Invalid Topic Name - jms/Topic / Thanks, Sahoo Sahoo wrote: > I think it is an issue with context class loader. Can you configure > your Spring DM OSGi service to run in the context of the calling > Servlet if such a configuration option available? > > Thanks, > Sahoo > > glassfish@javadesktop.org wrote: >> I'm trying to get a simple JMS Topic application running and I'm >> having problems. My message producer is a pojo that's inside n OSGi >> bundle that I've deployed. It gets called from within a service >> that's exposed using Spring DM to a web servlet. >> The code for the message producer: >> >> public void sendMessage(String data) >> { >> Context theContext = new InitialContext(); >> System.out.println("Getting Connection Factory."); >> TopicConnectionFactory topicFactory = >> (TopicConnectionFactory) theContext.lookup("jms/TopicFactory"); >> >> System.out.println("Getting Topic."); >> Topic topic = (Topic) theContext.lookup("jmsTopic"); >> // Here's where it fails >> >> topicConnection = topicFactory.createTopicConnection(); >> session = topicConnection.createTopicSession(false, >> Session.AUTO_ACKNOWLEDGE); >> publisher = session.createPublisher(topic); >> message = session.createTextMessage(data); >> >> System.out.println("Sending Message."); >> publisher.publish(message); >> } >> >> I've created the Factory and the Topic using the Glassfish Admin >> console (Resources->JMS Resources->Destination Resources). I also >> tried it with creating the physical resource (Configuration->Java >> Messaging Service->Physical Destinations). >> >> Stack Trace: >> >> [#|2010-04-19T09:01:37.462-0400|SEVERE|glassfishv3.0|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=40;_ThreadName=Thread-8;|javax.naming.CommunicationException: >> Communication exception for SerialContext [Root exception is >> com.sun.appserv.connectors.internal.api.PoolingException] >> at >> com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:475) >> >>

Oracle Community | ltouve | 7 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    JMS Using Spring

    Oracle Community | 7 years ago | ltouve
    java.lang.IllegalArgumentException: MQ:Topic:Invalid Topic Name - jms/Topic / Thanks, Sahoo Sahoo wrote: > I think it is an issue with context class loader. Can you configure > your Spring DM OSGi service to run in the context of the calling > Servlet if such a configuration option available? > > Thanks, > Sahoo > > glassfish@javadesktop.org wrote: >> I'm trying to get a simple JMS Topic application running and I'm >> having problems. My message producer is a pojo that's inside n OSGi >> bundle that I've deployed. It gets called from within a service >> that's exposed using Spring DM to a web servlet. >> The code for the message producer: >> >> public void sendMessage(String data) >> { >> Context theContext = new InitialContext(); >> System.out.println("Getting Connection Factory."); >> TopicConnectionFactory topicFactory = >> (TopicConnectionFactory) theContext.lookup("jms/TopicFactory"); >> >> System.out.println("Getting Topic."); >> Topic topic = (Topic) theContext.lookup("jmsTopic"); >> // Here's where it fails >> >> topicConnection = topicFactory.createTopicConnection(); >> session = topicConnection.createTopicSession(false, >> Session.AUTO_ACKNOWLEDGE); >> publisher = session.createPublisher(topic); >> message = session.createTextMessage(data); >> >> System.out.println("Sending Message."); >> publisher.publish(message); >> } >> >> I've created the Factory and the Topic using the Glassfish Admin >> console (Resources->JMS Resources->Destination Resources). I also >> tried it with creating the physical resource (Configuration->Java >> Messaging Service->Physical Destinations). >> >> Stack Trace: >> >> [#|2010-04-19T09:01:37.462-0400|SEVERE|glassfishv3.0|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=40;_ThreadName=Thread-8;|javax.naming.CommunicationException: >> Communication exception for SerialContext [Root exception is >> com.sun.appserv.connectors.internal.api.PoolingException] >> at >> com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:475) >> >>

    Root Cause Analysis

    1. java.lang.IllegalArgumentException

      MQ:Topic:Invalid Topic Name - jms/Topic / Thanks, Sahoo Sahoo wrote: > I think it is an issue with context class loader. Can you configure > your Spring DM OSGi service to run in the context of the calling > Servlet if such a configuration option available? > > Thanks, > Sahoo > > glassfish@javadesktop.org wrote: >> I'm trying to get a simple JMS Topic application running and I'm >> having problems. My message producer is a pojo that's inside n OSGi >> bundle that I've deployed. It gets called from within a service >> that's exposed using Spring DM to a web servlet. >> The code for the message producer: >> >> public void sendMessage(String data) >> { >> Context theContext = new InitialContext(); >> System.out.println("Getting Connection Factory."); >> TopicConnectionFactory topicFactory = >> (TopicConnectionFactory) theContext.lookup("jms/TopicFactory"); >> >> System.out.println("Getting Topic."); >> Topic topic = (Topic) theContext.lookup("jmsTopic"); >> // Here's where it fails >> >> topicConnection = topicFactory.createTopicConnection(); >> session = topicConnection.createTopicSession(false, >> Session.AUTO_ACKNOWLEDGE); >> publisher = session.createPublisher(topic); >> message = session.createTextMessage(data); >> >> System.out.println("Sending Message."); >> publisher.publish(message); >> } >> >> I've created the Factory and the Topic using the Glassfish Admin >> console (Resources->JMS Resources->Destination Resources). I also >> tried it with creating the physical resource (Configuration->Java >> Messaging Service->Physical Destinations). >> >> Stack Trace: >> >> [#|2010-04-19T09:01:37.462-0400|SEVERE|glassfishv3.0|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=40;_ThreadName=Thread-8;|javax.naming.CommunicationException: >> Communication exception for SerialContext [Root exception is >> com.sun.appserv.connectors.internal.api.PoolingException] >> at >> com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:475) >> >>

      at javax.naming.InitialContext.lookup()
    2. Java RT
      InitialContext.lookup
      1. javax.naming.InitialContext.lookup(InitialContext.java:392)
      2. javax.naming.InitialContext.lookup(InitialContext.java:392)
      2 frames