1 Reply Latest reply on Apr 21, 2011 10:18 AM by Dave Stanley

    NullPointerException with jms:consumer

    jeevan kumar Newbie

      Hi,

       

      I have a jms consumer endpoint which listens to a weblogic jms topic.The endpoint started successfully but when i post a message to the topic,the endpoint is throwing NullPointerException.

      Can anyone help in this?Thanks in advance.

       

      JMS Consumer Configuration

      -


           

      <jms:consumer service="jms:JmsConsumerService"
                        endpoint="JmsConsumerServiceEndpoint"
                        targetService ="jms:JmsMessageRoute"
                        connectionFactory="#connectionFactory"
                        destinationResolver="#jmsDestinationResolver"
                        destinationName ="${wl.topic.topicName}"
                        pubSubDomain = "true"
                        subscriptionDurable="true"
                        clientId = "${wl.topic.clientID}"
                        durableSubscriptionName = "${wl.topic.subscriberID}"
                        cacheLevel = "1"
                        />
          <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
           <property name="environment">
               <props>
               <prop key="java.naming.factory.initial">weblogic.jndi.WLInitialContextFactory</prop>
               <prop key="java.naming.provider.url">${wl.topic.providerURL}</prop>
           </props>
           </property>
          </bean>
          <bean id="connectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
            <property name="jndiTemplate" ref="jndiTemplate"></property>
            <property name="jndiName">
              <value>${wl.topic.connectionFactory}</value>
            </property>
          </bean>    
          <bean id="jmsDestinationResolver" 
               class="org.springframework.jms.support.destination.JndiDestinationResolver">
               <property name="jndiTemplate" ref="jndiTemplate"></property>
          </bean>
      

       

      Exceptions Logs

      -


      19:21:41,856 | DEBUG | tenerContainer-6 | DefaultMessageListenerContainer  | 95 - org.springframework.jms - 3.0.5.RELEASE | Received message of type from consumer of session

      19:21:41,871 | DEBUG | tenerContainer-6 | PhaseInterceptorChain            | 150 - servicemix-soap2 - 2011.01.0.fuse-00-00 | Adding interceptor org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor

      19:21:41,871 | DEBUG | tenerContainer-6 | PhaseInterceptorChain            | 150 - servicemix-soap2 - 2011.01.0.fuse-00-00 | Adding interceptor org.apache.servicemix.soap.interceptors.xml.StaxInInterceptor

      19:21:41,871 | DEBUG | tenerContainer-6 | PhaseInterceptorChain            | 150 - servicemix-soap2 - 2011.01.0.fuse-00-00 | Invoking handleMessage on interceptor org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor

      19:21:41,871 | DEBUG | tenerContainer-6 | PhaseInterceptorChain            | 150 - servicemix-soap2 - 2011.01.0.fuse-00-00 | Invoking handleMessage on interceptor org.apache.servicemix.soap.interceptors.xml.StaxInInterceptor

      19:21:41,871 | INFO  | tenerContainer-6 | PhaseInterceptorChain            | 150 - servicemix-soap2 - 2011.01.0.fuse-00-00 | Interceptor has thrown exception, unwinding now

      java.lang.NullPointerException: charsetName

           at java.io.InputStreamReader.(InputStreamReader.java:82)[:1.6.0_18]

           at weblogic.xml.stax.XMLStreamInputFactory.createXMLStreamReader(XMLStreamInputFactory.java:66)[233:wrap_file____C__wlfullclient.jar:0]

           at org.apache.servicemix.soap.util.stax.StaxUtil.createReader(StaxUtil.java:57)[150:servicemix-soap2:2011.01.0.fuse-00-00]

           at org.apache.servicemix.soap.interceptors.xml.StaxInInterceptor.handleMessage(StaxInInterceptor.java:55)[150:servicemix-soap2:2011.01.0.fuse-00-00]

           at org.apache.servicemix.soap.core.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:85)[150:servicemix-soap2:2011.01.0.fuse-00-00]

           at org.apache.servicemix.jms.endpoints.DefaultConsumerMarshaler.populateMessage(DefaultConsumerMarshaler.java:192)[159:servicemix-jms:2011.01.0.fuse-00-00]

           at org.apache.servicemix.jms.endpoints.DefaultConsumerMarshaler.createExchange(DefaultConsumerMarshaler.java:115)[159:servicemix-jms:2011.01.0.fuse-00-00]

           at org.apache.servicemix.jms.endpoints.AbstractConsumerEndpoint.onMessage(AbstractConsumerEndpoint.java:549)[159:servicemix-jms:2011.01.0.fuse-00-00]

           at org.apache.servicemix.jms.endpoints.JmsConsumerEndpoint$1.onMessage(JmsConsumerEndpoint.java:477)[159:servicemix-jms:2011.01.0.fuse-00-00]

           at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:535)[95:org.springframework.jms:3.0.5.RELEASE]

           at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:495)[95:org.springframework.jms:3.0.5.RELEASE]

           at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:467)[95:org.springframework.jms:3.0.5.RELEASE]

           at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325)[95:org.springframework.jms:3.0.5.RELEASE]

           at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263)[95:org.springframework.jms:3.0.5.RELEASE]

           at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1058)[95:org.springframework.jms:3.0.5.RELEASE]

           at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1050)[95:org.springframework.jms:3.0.5.RELEASE]

           at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:947)[95:org.springframework.jms:3.0.5.RELEASE]

           at java.lang.Thread.run(Thread.java:619)[:1.6.0_18]