Announcement Announcement Module
Collapse
No announcement yet.
send message to message driven pojo Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • send message to message driven pojo

    WebSphere 6.1.x
    ActiveMQ
    Spring JMS

    I am attempting to send a message to an application with the following code...
    Code:
    Context ctx = new InitialContext();
    ConnectionFactory cf1 = (ConnectionFactory) ctx.lookup("jms/QueueConnectionFactory");
    			
    Connection connection = cf1.createConnection();
    
    Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
    			
    Destination dest = (Queue) ctx.lookup("emailQueue");
    MessageProducer producer = session.createProducer(dest);
    			
    Message message = session.createObjectMessage(new ArbitraryMessage());
    			
    producer.send(message);
    On websphere.... I have a JMS provider set up that is pointing to my ActiveMQ instance. Then I have a queue connection factory setup, that is using the provider (jms/QueueConnectionFactory)


    The message should be received from the following spring message driven pojos....


    Code:
    <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
        <property name="environment">
          <props>
            <prop key="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</prop>
            <prop key="java.naming.provider.url">${jndi.URL}</prop>
            <prop key="queue.${email.jndiName}">${queue.emailQueue}</prop>      
          </props>
        </property>
      </bean>
    
    <bean id="emailDestination" class="org.springframework.jndi.JndiObjectFactoryBean"
    		p:jndiTemplate-ref="jndiTemplate"
    		p:jndiName="${email.jndiName}"/>
    
    <bean id="emailQueue"
    		class="org.apache.activemq.command.ActiveMQQueue">
    		<constructor-arg value="${queue.emailQueue}" />
    	</bean>
    <bean id="jmsConnectionFactory"
    		class="org.apache.activemq.ActiveMQConnectionFactory"
    		p:brokerURL="${jndi.URL}" />
    <bean id="emailListener"
    		class=" org.springframework.jms.listener.adapter.MessageListenerAdapter102"
    		p:delegate-ref="emailNotificationService"
    		p:defaultListenerMethod="sendPriceNoticeEmails" />
    
    <bean
    class="org.springframework.jms.listener.SimpleMessageListenerContainer102"
    		p:destination-ref="emailDestination"
    		p:connectionFactory-ref="jmsConnectionFactory"
    		p:messageListener-ref="emailListener" />

    If I send a message with the jmsTemplate.... there are no problems.... but if I try to send through standard jms calls it throws the following exception...

    Code:
    org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
    	at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.do_resolve_complete_info(WsnOptimizedNamingImpl.java:543)
    	at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.resolve_complete_info(WsnOptimizedNamingImplBase.java:2215)
    	at com.ibm.WsnOptimizedNaming._NamingContextStub.resolve_complete_info(_NamingContextStub.java:536)
    	at com.ibm.ws.naming.jndicos.CNContextImpl.cosResolve(CNContextImpl.java:4351)
    	at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1901)
    	at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1862)
    	at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1552)

    Message driven pojos are new to me.... as a matter of fact JMS is in general new to me.... so I may have gone wrong in a couple places. Firstly.... I'm not sure if my MDPs are correctly integrated with Spring JNDI. Secondly, I'm not sure if I'm missing something in my WAS JMS configs.

    Any help would be appreciated.
    Thanks!
Working...
X