0 Replies Latest reply on May 14, 2010 12:36 PM by jlentz

    Notifying Weblogic 8 Queue with NotifyQueues and jms-jca Provider Throws IllegalStateException

    jlentz

      Environment: JBoss ESB 4.7 integrated in JBoss 5.1.0GA

       

      I have an ESB application that sends a message to a WebLogic 8 queue using the NotifyQueues notification target and listens to 2 other WebLogic queues for a success or failure response.  This application works when using <jms-provider> for the Jboss and  WebLogic 8 providers, but throws an IllegalStateException now that I've changed the providers to <jms-jca-provider> and added transacated = "true" to the <jms-message-filter> tags.

       

      Here's the stack trace:

      org.jboss.soa.esb.ConfigurationException: Failed to create an instance of NotificationTarget class 'NotifyQueues'.

          at org.jboss.soa.esb.notification.NotificationTarget.fromParams(NotificationTarget.java:148)

          at org.jboss.soa.esb.notification.NotificationList.notifyAll(NotificationList.java:162)

          at org.jboss.soa.esb.actions.Notifier.notifyOK(Notifier.java:93)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

          at java.lang.reflect.Method.invoke(Unknown Source)

          at org.jboss.soa.esb.listeners.message.ActionProcessorMethodInfo.processSuccess(ActionProcessorMethodInfo.java:165)

          at org.jboss.soa.esb.listeners.message.OverriddenActionLifecycleProcessor.processSuccess(OverriddenActionLifecycleProcessor.java:108)

          at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.notifySuccess(ActionProcessingPipeline.java:950)

          at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:724)

          at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:586)

          at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:420)

          at org.jboss.soa.esb.listeners.jca.JcaMessageAwareListener.process(JcaMessageAwareListener.java:163)

          at org.jboss.soa.esb.listeners.jca.JcaJMSInflowMessageProcessorAdapter.onMessage(JcaJMSInflowMessageProcessorAdapter.java:44)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

          at java.lang.reflect.Method.invoke(Unknown Source)

          at org.jboss.soa.esb.listeners.jca.BaseJcaInflow$1.invoke(BaseJcaInflow.java:205)

          at org.jboss.soa.esb.listeners.jca.EndpointProxy.delivery(EndpointProxy.java:242)

          at org.jboss.soa.esb.listeners.jca.EndpointProxy.invoke(EndpointProxy.java:145)

          at $Proxy355.onMessage(Unknown Source)

          at org.jboss.resource.adapter.jms.inflow.JmsServerSession.onMessage(JmsServerSession.java:178)

          at org.jboss.jms.client.container.ClientConsumer.callOnMessageStatic(ClientConsumer.java:160)

          at org.jboss.jms.client.container.SessionAspect.handleRun(SessionAspect.java:831)

          at org.jboss.aop.advice.org.jboss.jms.client.container.SessionAspect_z_handleRun_25073711.invoke(SessionAspect_z_handleRun_25073711.java)

          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

          at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:170)

          at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:86)

          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

          at org.jboss.jms.client.delegate.ClientSessionDelegate.run(ClientSessionDelegate.java)

          at org.jboss.jms.client.JBossSession.run(JBossSession.java:199)

          at org.jboss.resource.adapter.jms.inflow.JmsServerSession.run(JmsServerSession.java:234)

          at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:205)

          at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:260)

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

          at java.lang.Thread.run(Unknown Source)

      Caused by: java.lang.IllegalStateException: can only be called from server

          at weblogic.jms.client.JMSXASession.getXAResource(JMSXASession.java:87)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

          at java.lang.reflect.Method.invoke(Unknown Source)

          at org.jboss.internal.soa.esb.rosetta.pooling.JmsSession$ExceptionHandler.invoke(JmsSession.java:479)

          at $Proxy398.getXAResource(Unknown Source)

          at org.jboss.internal.soa.esb.rosetta.pooling.JmsXASession.associate(JmsXASession.java:172)

          at org.jboss.internal.soa.esb.rosetta.pooling.JmsSession.trackMessageProducer(JmsSession.java:341)

          at org.jboss.internal.soa.esb.rosetta.pooling.JmsSession.createProducer(JmsSession.java:207)

          at org.jboss.soa.esb.notification.NotifyQueues.createProducer(NotifyQueues.java:114)

          at org.jboss.soa.esb.notification.NotifyJMS.setUpProducers(NotifyJMS.java:428)

          at org.jboss.soa.esb.notification.NotifyQueues.<init>(NotifyQueues.java:71)

          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

          at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

          at java.lang.reflect.Constructor.newInstance(Unknown Source)

          at org.jboss.soa.esb.notification.NotificationTarget.fromParams(NotificationTarget.java:145)

          ... 38 more

       

      And here's the jboss-esb.xml excerpt:

       

           <providers>

              <jms-jca-provider connection-factory="ClusteredXAConnectionFactory" name="JBossMessaging">

                  <jms-bus busid="callWLEsbChannel">

                      <jms-message-filter dest-name="queue/call_wl_esb" dest-type="QUEUE" transacted="true"/>

                  </jms-bus>

                  <jms-bus busid="receiveMsgEsbChannel">

                      <jms-message-filter dest-name="queue/wl_status_esb" dest-type="QUEUE" transacted="true"/>

                  </jms-bus>

                  <jms-bus busid="receiveErrorMsgEsbChannel">

                      <jms-message-filter dest-name="queue/wl_error_esb" dest-type="QUEUE" transacted="true"/>

                  </jms-bus>

              </jms-jca-provider>

              <jms-jca-provider connection-factory="weblogic.jms.ConnectionFactory" name="WebLogic"

              jndi-context-factory="weblogic.jndi.WLInitialContextFactory" jndi-URL="t3://server:port">

                  <jms-bus busid="receiveMsgGwChannel">

                      <jms-message-filter dest-name="WL_SUCCESS" dest-type="QUEUE" transacted="true"/>

                  </jms-bus>

                  <jms-bus busid="receiveErrorMsgGwChannel">

                      <jms-message-filter dest-name="WL_ERROR" dest-type="QUEUE" transacted="true"/>

                  </jms-bus>

              </jms-jca-provider>

          </providers>

          <services>

              <service category="AppService" name="call"

                  description="Call WL via JMS">

                  <listeners>

                      <jms-listener busidref="callWLEsbChannel" name="jmsCallEsbListener" />

                  </listeners>

                  <actions mep="OneWay">

                      <action class="CallAction" name="call" />

                      <action name="notificationAction" class="org.jboss.soa.esb.actions.Notifier">

                             <property name="okMethod" value="notifyOK" />

                             <property name="notification-details">

                              <NotificationList type="OK">

                              <target class="NotifyConsole" />

                              <target class="NotifyQueues">

                                 <queue jndiName="START_WL" connection-factory="javax.jms.QueueConnectionFactory"

                                 jndi-context-factory="weblogic.jndi.WLInitialContextFactory" jndi-URL="t3://server:port" />

                              </target>

                             </NotificationList>

                          </property>

                            </action>   

                  </actions>

              </service>

              <service category="AppService" name="receiveStatus" description="Receive WL status via JMS">

                  <listeners>

                      <jms-listener busidref="receiveMsgGwChannel" is-gateway="true" name="jmsReceiveStatusGwListener" />

                      <jms-listener busidref="receiveMsgEsbChannel" name="jmsReceiveStatusEsbListener" />

                  </listeners>

                  <actions mep="OneWay">

                       <action class="ReceiveStatusAction" name="receiveStatus" />

                       <action name="routeAction" class="org.jboss.soa.esb.actions.StaticRouter">

                        <property name="destinations">

                          <route-to service-category="CalcService" service-name="publishData" />

                        </property>

                      </action>                               

                  </actions>

              </service>

              <service category="AppService" name="receiveError" description="Receive WL error message via JMS">

                  <listeners>

                      <jms-listener busidref="receiveErrorMsgGwChannel" is-gateway="true" name="jmsReceiveErrorGwListener" />

                      <jms-listener busidref="receiveErrorMsgEsbChannel" name="jmsReceiveErrorEsbListener" />

                  </listeners>

                  <actions mep="OneWay">

                       <action class="ReceiveErrorAction" name="receiveError" />

                  </actions>

              </service>

          </services>

       

      We need the transactional benefits of jms-jca so can't just go back to straight jms.  I found a posting (http://forums.oracle.com/forums/thread.jspa?threadID=737426&tstart=15) that indicates WebLogic does not directly support foreign transaction managers.  Would someone please provide guidance on how to best address this issue within JBoss ESB?  Any assistance will be appreciated.

       

      Thanks,

      Jennifer