5 Replies Latest reply on Jun 18, 2008 8:14 AM by Maksim Solovjov

    Http Listener.

    Maksim Solovjov Newbie

      Hello. I would be very thankful, if someone could help me.
      I have some problem, to configure simple ESB component/service and http listener.
      So I would like to write a service, which performs public Message process(Message msg) method, when user access with his browser to http://server_url:8765.

      public Message process(Message message) throws Exception {

      System.out.println("Hello, Max");

      return message;

      }


      So, this is the method in mailservice.Notificator(My class).
      I use jbr-provider and jbr-listener for http.
      It "works" and I get server's output "Hello, Max" with Exception.

      With Best Wishes, Maksim.


      <jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
      <providers>
       <jms-provider name="JBossMQ" connection-factory="ConnectionFactory">
       <jms-bus busid="helloWorldESBChannel">
       <jms-message-filter dest-type="QUEUE" dest-name="queue/HelloWorldESB"/>
       </jms-bus>
      
       <jms-bus busid="initESBChannel">
       <jms-message-filter dest-type="QUEUE" dest-name="queue/initESB"/>
       </jms-bus>
       </jms-provider>
      
      
      
       <jbr-provider name="JBR-Http" protocol="http" host="0.0.0.0">
       <jbr-bus busid="Http-1" port="8765" />
       </jbr-provider>
      </providers>
      
      <services>
      
       <service category="Jawilla" name="Initializer" description="Inits jawilla application framework">
      
       <listeners>
       <jms-listener name="initESBChannelListener" busidref="initESBChannel" is-gateway="false"/>
       </listeners>
      
      
       <actions mep="OneWay">
       <action name="init" class="com.jawilla.jboss.esb.InitializeService" process="process"/>
       </actions>
      
       </service>
      
       <service category="Notifiers" name="Notifer" description="Hello World">
       <listeners>
       <jbr-listener name="Http-Gateway" busidref="Http-1" is-gateway="true" maxThreads="1"/>
       <jms-listener name="helloWorldESBChannelListener" busidref="helloWorldESBChannel" is-gateway="false"/>
       </listeners>
      
      
       <actions mep="RequestResponse">
       <action name="println" class="mailservice.NotifyService" process="process">
       </action>
       </actions>
      
       </service>
      </services>
      </jbossesb>


      jbm-queue-service.xml:
      <mbean code="org.jboss.jms.server.destination.QueueService"
       name="jboss.esb.quickstart.destination:service=Queue,name=HelloWorldESB"
       xmbean-dd="xmdesc/Queue-xmbean.xml">
       <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
       <depends>jboss.messaging:service=PostOffice</depends>
       </mbean>
      
       <mbean code="org.jboss.jms.server.destination.QueueService"
       name="jboss.esb.quickstart.destination:service=Queue,name=HelloWorldESB_reply"
       xmbean-dd="xmdesc/Queue-xmbean.xml">
       <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
       <depends>jboss.messaging:service=PostOffice</depends>
       </mbean>
      
       <mbean code="org.jboss.jms.server.destination.QueueService"
       name="jboss.esb.quickstart.destination:service=Queue,name=initESB"
       xmbean-dd="xmdesc/Queue-xmbean.xml">
       <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
       <depends>jboss.messaging:service=PostOffice</depends>
       </mbean>
      


      Server's output:
      12:06:20,282 INFO [STDOUT] Hello, Max
      12:06:20,283 WARN [ActionProcessingPipeline] Unexpected exception caught while processing the action pipeline: header: [ To: JMSEpr [ PortReference < <wsa:Address jms://0.0.0.0:1099/queue/HelloWorldESB/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingConte
      xtFactory/>, <wsa:ReferenceProperties jbossesb:java.naming.provider.url : 0.0.0.0:1099/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.url.pkgs : org.jnp.interfaces/>, <wsa:ReferenceProperties jbossesb:destination-type : queue/>, <wsa:ReferenceProperties jbossesb:specification-version : 1.1
      />, <wsa:ReferenceProperties jbossesb:connection-factory : ConnectionFactory/>, <wsa:ReferenceProperties jbossesb:persistent : true/>, <wsa:ReferenceProperties jbossesb:acknowledge-mode : AUTO_ACKNOWLEDGE/>, <wsa:ReferenceProperties jbossesb:transacted : false/>, <wsa:ReferenceProperties jbossesb:ty
      pe : urn:jboss/esb/epr/type/jms/> > ] ReplyTo: JMSEpr [ PortReference < <wsa:Address jms://0.0.0.0:1099/queue/HelloWorldESB_reply/>, <wsa:ReferenceProperties jbossesb:java.naming.provider.url : 0.0.0.0:1099/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingC
      ontextFactory/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.url.pkgs : org.jnp.interfaces/>, <wsa:ReferenceProperties jbossesb:destination-type : queue/>, <wsa:ReferenceProperties jbossesb:specification-version : 1.1/>, <wsa:ReferenceProperties jbossesb:connection-factory : ConnectionFact
      ory/>, <wsa:ReferenceProperties jbossesb:message-selector : jbossESBresponseUUID='e56d55ab-6621-4ef7-a9c5-a58f0e448901'/>, <wsa:ReferenceProperties jbossesb:persistent : true/>, <wsa:ReferenceProperties jbossesb:acknowledge-mode : AUTO_ACKNOWLEDGE/>, <wsa:ReferenceProperties jbossesb:transacted : fa
      lse/>, <wsa:ReferenceProperties jbossesb:type : urn:jboss/esb/epr/type/jms/> > ] MessageID: d5528f01-2630-427a-9cbf-2e65d4fbd920 RelatesTo: jms:correlationID#d5528f01-2630-427a-9cbf-2e65d4fbd920 ]
      org.jboss.soa.esb.actions.ActionProcessingException: org.jboss.soa.esb.listeners.message.MessageDeliverException: Null data found in message location(s): [org.jboss.soa.esb.message.defaultEntry]
       at org.jboss.soa.esb.actions.routing.HttpRouter.process(HttpRouter.java:97)
       at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:316)
       at org.jboss.soa.esb.listeners.message.MessageAwareListener$TransactionalRunner.run(MessageAwareListener.java:530)
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
       at java.lang.Thread.run(Thread.java:619)
      Caused by: org.jboss.soa.esb.listeners.message.MessageDeliverException: Null data found in message location(s): [org.jboss.soa.esb.message.defaultEntry]
       at org.jboss.soa.esb.message.MessagePayloadProxy.getPayload(MessagePayloadProxy.java:161)
       at org.jboss.soa.esb.actions.routing.HttpRouter.process(HttpRouter.java:95)
       ... 5 more
      12:06:20,308 ERROR [JBossRemotingGatewayListener] JBoss Remoting Gateway failed to synchronously deliver message to target service [Notifiers:Notifer].
      org.jboss.soa.esb.couriers.FaultMessageException: org.jboss.soa.esb.actions.ActionProcessingException: org.jboss.soa.esb.listeners.message.MessageDeliverException: Null data found in message location(s): [org.jboss.soa.esb.message.defaultEntry]
       at org.jboss.soa.esb.listeners.message.errors.Factory.createExceptionFromFault(Factory.java:49)
       at org.jboss.internal.soa.esb.couriers.helpers.JmsComposer.compose(JmsComposer.java:82)
       at org.jboss.internal.soa.esb.couriers.JmsCourier.pickup(JmsCourier.java:404)
       at org.jboss.internal.soa.esb.couriers.TwoWayCourierImpl.pickup(TwoWayCourierImpl.java:232)
       at org.jboss.internal.soa.esb.couriers.TwoWayCourierImpl.pickup(TwoWayCourierImpl.java:214)
       at org.jboss.soa.esb.client.ServiceInvoker$EPRInvoker.attemptDelivery(ServiceInvoker.java:532)
       at org.jboss.soa.esb.client.ServiceInvoker$EPRInvoker.access$200(ServiceInvoker.java:447)
       at org.jboss.soa.esb.client.ServiceInvoker.post(ServiceInvoker.java:316)
       at org.jboss.soa.esb.client.ServiceInvoker.deliverSync(ServiceInvoker.java:196)
       at org.jboss.soa.esb.listeners.message.UncomposedMessageDeliveryAdapter.deliverSyncWithoutDecomposing(UncomposedMessageDeliveryAdapter.java:107)
       at org.jboss.soa.esb.listeners.message.UncomposedMessageDeliveryAdapter.deliverSync(UncomposedMessageDeliveryAdapter.java:86)
       at org.jboss.soa.esb.listeners.gateway.JBossRemotingGatewayListener.invoke(JBossRemotingGatewayListener.java:316)
       at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:795)
       at org.jboss.remoting.transport.coyote.CoyoteInvoker.service(CoyoteInvoker.java:310)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
       at java.lang.Thread.run(Thread.java:619)
      Caused by: org.jboss.soa.esb.actions.ActionProcessingException: org.jboss.soa.esb.listeners.message.MessageDeliverException: Null data found in message location(s): [org.jboss.soa.esb.message.defaultEntry]
       at org.jboss.soa.esb.actions.routing.HttpRouter.process(HttpRouter.java:97)
       at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:316)
       at org.jboss.soa.esb.listeners.message.MessageAwareListener$TransactionalRunner.run(MessageAwareListener.java:530)
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
       ... 1 more
      Caused by: org.jboss.soa.esb.listeners.message.MessageDeliverException: Null data found in message location(s): [org.jboss.soa.esb.message.defaultEntry]
       at org.jboss.soa.esb.message.MessagePayloadProxy.getPayload(MessagePayloadProxy.java:161)
       at org.jboss.soa.esb.actions.routing.HttpRouter.process(HttpRouter.java:95)
       ... 5 more
      12:06:20,313 ERROR [CoyoteInvoker] Error processing request
      java.io.NotSerializableException: org.jboss.internal.soa.esb.message.format.xml.MessageImpl
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
       at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
       at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
       at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
       at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
       at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.sendObjectVersion1_2(JavaSerializationManager.java:107)
       at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.sendObject(JavaSerializationManager.java:91)
       at org.jboss.remoting.marshal.serializable.SerializableMarshaller.write(SerializableMarshaller.java:120)
       at org.jboss.remoting.marshal.http.HTTPMarshaller.write(HTTPMarshaller.java:73)
       at org.jboss.internal.soa.esb.remoting.HttpMarshaller.write(HttpMarshaller.java:51)
       at org.jboss.remoting.transport.coyote.CoyoteInvoker.versionedWrite(CoyoteInvoker.java:434)
       at org.jboss.remoting.transport.coyote.CoyoteInvoker.service(CoyoteInvoker.java:377)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
       at java.lang.Thread.run(Thread.java:619)
      


      With the Best Wishes, Maksim

        • 1. Re: Http Listener.
          Maksim Solovjov Newbie

          P.S If I send ESB Message, like quickstarts/helloworld - everything works fine

          • 2. Re: Http Listener.
            Tom Fennelly Master

            Looks to me as though that exception you're seeing doe not match up with the ESB config you posted here.

            The exception shows an error in the HttpRouter (unable to access message payload), but you don't seem to use the HttpRouter in that ESB config. Could there be multiple .esb deployments running that are in conflict in some way?

            • 3. Re: Http Listener.
              Maksim Solovjov Newbie

               

              Could there be multiple .esb deployments running that are in conflict in some way?


              No..

              Hmm...I am really sorry, but this config really doesn't match with Exception.
              I have tried to "solve" this problem with HttpRouter...

              Once again:
              config:
              <?xml version = "1.0" encoding = "UTF-8"?>
              
              <jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
              <providers>
               <jms-provider name="JBossMQ" connection-factory="ConnectionFactory">
               <jms-bus busid="helloWorldESBChannel">
               <jms-message-filter dest-type="QUEUE" dest-name="queue/HelloWorldESB"/>
               </jms-bus>
              
               <jms-bus busid="initESBChannel">
               <jms-message-filter dest-type="QUEUE" dest-name="queue/initESB"/>
               </jms-bus>
               </jms-provider>
              
              
              
               <jbr-provider name="JBR-Http" protocol="http" host="0.0.0.0">
               <jbr-bus busid="Http-1" port="8765" />
               </jbr-provider>
              </providers>
              
              <services>
              
               <service category="Jawilla" name="Initializer" description="Inits jawilla application framework">
              
               <listeners>
               <jms-listener name="initESBChannelListener" busidref="initESBChannel" is-gateway="false"/>
               </listeners>
              
              
               <actions mep="OneWay">
               <action name="init" class="com.jawilla.jboss.esb.InitializeService" process="process"/>
               </actions>
              
               </service>
              
               <service category="Notifiers" name="Notifer" description="Hello World">
               <listeners>
               <jbr-listener name="Http-Gateway" busidref="Http-1" is-gateway="true" maxThreads="1"/>
               <jms-listener name="helloWorldESBChannelListener" busidref="helloWorldESBChannel" is-gateway="false"/>
               </listeners>
              
              
               <actions mep="RequestResponse">
               <action name="println" class="mailservice.NotifyService" process="process">
               </action>
               </actions>
              
               </service>
              </services>
              </jbossesb>


              and exception(sorry, for previous):
              13:11:20,283 INFO [MessagePayloadProxy] Setting null data in message location(s): [org.jboss.soa.esb.message.defaultEntry]
              13:11:20,491 INFO [STDOUT] Hello, Max
              13:11:20,511 ERROR [JBossRemotingGatewayListener] JBoss Remoting Gateway failed to synchronously deliver message to target service [Notifiers:Notifer].
              org.jboss.soa.esb.listeners.message.MessageDeliverException: Null data found in message location(s): [org.jboss.soa.esb.message.defaultEntry]
               at org.jboss.soa.esb.message.MessagePayloadProxy.getPayload(MessagePayloadProxy.java:161)
               at org.jboss.soa.esb.listeners.message.AbstractMessageComposer.decompose(AbstractMessageComposer.java:100)
               at org.jboss.soa.esb.listeners.gateway.JBossRemotingGatewayListener$JBossRemotingMessageComposer.decompose(JBossRemotingGatewayListener.java:519)
               at org.jboss.soa.esb.listeners.gateway.JBossRemotingGatewayListener$JBossRemotingMessageComposer.decompose(JBossRemotingGatewayListener.java:460)
               at org.jboss.soa.esb.listeners.message.UncomposedMessageDeliveryAdapter.deliverSync(UncomposedMessageDeliveryAdapter.java:89)
               at org.jboss.soa.esb.listeners.gateway.JBossRemotingGatewayListener.invoke(JBossRemotingGatewayListener.java:316)
               at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:795)
               at org.jboss.remoting.transport.coyote.CoyoteInvoker.service(CoyoteInvoker.java:310)
               at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
               at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
               at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
               at java.lang.Thread.run(Thread.java:619)


              With Best Wishes, Maksim.

              • 4. Re: Http Listener.
                Tom Fennelly Master

                So it looks as though the message being delivered back to the JBR gateway has a null payload on it.

                As a test... try adding a line of code to your mailservice.NotifyService class... just a Sysout of the default message payload (message.getBody().get()).

                • 5. Re: Http Listener.
                  Maksim Solovjov Newbie

                  Yes, it returns "null".

                  Thank you, for your help.
                  I didn't know, that payload can not be null.