4 Replies Latest reply on May 16, 2008 9:37 AM by Andrey Filippov

    QuickStart ESB...

    Andrey Filippov Newbie

      Hello everybody,

      I am new to esb - I am just testing it now. I made esb project in eclipse and using build.xml improved from helloworld project I deployed it to as. When I send message using JMS (SendJMSMessage class) everything looks fine. But when I try to send message straight to ESB listener I get exception. Please, could someone help me..

      public static void main(String args[]) throws Exception
       {
       if (args.length < 3)
       {
       System.out.println("Usage SendEsbMessage <category> <name> <text to send>");
       }
       System.setProperty("javax.xml.registry.ConnectionFactoryClass","org.apache.ws.scout.registry.ConnectionFactoryImpl");
       // Create a message, assign it a UID, and fill in call information
       Message esbMessage = MessageFactory.getInstance().getMessage();
       Call call = new Call();
       call.setMessageID(new URI(UUID.randomUUID().toString()));
       esbMessage.getHeader().setCall(call);
      
      
       // set body contents with args[2], and send
       esbMessage.getBody().add(args[2].getBytes());
       Service service = new Service("FirstEclipseServiceESB","SimpleListener");
       ServiceInvoker invoker = new ServiceInvoker(service);
       invoker.deliverSync(esbMessage,500);
      
      
       }
      


      Action listener class:


      
       public class MyJMSListenerAction extends AbstractActionLifecycle
      {
      
       protected ConfigTree _config;
      
       public MyJMSListenerAction(ConfigTree config) { _config = config; }
      
      
       public Message displayMessage(Message message) throws Exception{
      
       System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
       System.out.println("Body: " + new String((String)message.getBody().get("org.jboss.soa.esb.message.defaultEntry")));
       System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
       return message;
      
       }
      
      
      }
      


      Here is my exception stack...

      15:07:31,902 INFO [STDOUT] &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
      15:07:55,669 WARN [ActionProcessingPipeline] Unexpected exception caught while processing the action pipeline: header: [ To: JMSEpr [ PortReference < <wsa:Address jms://localhost/queue/eclipse_quickstart_helloworld_Request_esb/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFactory/>, <wsa:ReferenceProperties jbossesb:java.naming.provider.url : jnp://127.0.0.1:1099/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.url.pkgs : org.jboss.naming: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 : 1/> > ] ReplyTo: JMSEpr [ PortReference < <wsa:Address jms://localhost/queue/eclipse_quickstart_helloworld_Request_esb_reply/>, <wsa:ReferenceProperties jbossesb:java.naming.provider.url : jnp://127.0.0.1:1099/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFactory/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.url.pkgs : org.jboss.naming: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:message-selector : jbossESBresponseUUID='08d473ef-7d73-4909-a56b-150723e71440'/>, <wsa:ReferenceProperties jbossesb:persistent : true/>, <wsa:ReferenceProperties jbossesb:acknowledge-mode : 1/>, <wsa:ReferenceProperties jbossesb:type : urn:jboss/esb/epr/type/jms/> > ] MessageID: ID:25-12107572578895 RelatesTo: jms:correlationID#778cc9c4-ceef-4fad-a05d-ec82458e4315 ]
      org.jboss.soa.esb.actions.ActionProcessingException: Unexpected invocation target exception from processor
      at org.jboss.soa.esb.listeners.message.ActionProcessorMethodInfo.processMethods(ActionProcessorMethodInfo.java:127)
      at org.jboss.soa.esb.listeners.message.OverriddenActionLifecycleProcessor.process(OverriddenActionLifecycleProcessor.java:74)
      at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:316)
      at org.jboss.soa.esb.listeners.message.MessageAwareListener$1.run(MessageAwareListener.java:303)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: java.lang.ClassCastException: [B
      at org.jboss.soa.esb.samples.quickstart.helloworld.MyJMSListenerAction.displayMessage(MyJMSListenerAction.java:38)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.soa.esb.listeners.message.ActionProcessorMethodInfo.processMethods(ActionProcessorMethodInfo.java:102)
      ... 6 more
      15:07:55,700 ERROR [ActionProcessingPipeline] Failed to send fault to address JMSEpr [ PortReference < <wsa:Address jms://localhost/queue/eclipse_quickstart_helloworld_Request_esb_reply/>, <wsa:ReferenceProperties jbossesb:java.naming.provider.url : jnp://127.0.0.1:1099/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFactory/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.url.pkgs : org.jboss.naming: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:message-selector : jbossESBresponseUUID='08d473ef-7d73-4909-a56b-150723e71440'/>, <wsa:ReferenceProperties jbossesb:persistent : true/>, <wsa:ReferenceProperties jbossesb:acknowledge-mode : 1/>, <wsa:ReferenceProperties jbossesb:type : urn:jboss/esb/epr/type/jms/> > ] for message header: [ To: JMSEpr [ PortReference < <wsa:Address jms://localhost/queue/eclipse_quickstart_helloworld_Request_esb_reply/>, <wsa:ReferenceProperties jbossesb:java.naming.provider.url : jnp://127.0.0.1:1099/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFactory/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.url.pkgs : org.jboss.naming: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:message-selector : jbossESBresponseUUID='08d473ef-7d73-4909-a56b-150723e71440'/>, <wsa:ReferenceProperties jbossesb:persistent : true/>, <wsa:ReferenceProperties jbossesb:acknowledge-mode : 1/>, <wsa:ReferenceProperties jbossesb:type : urn:jboss/esb/epr/type/jms/> > ] From: JMSEpr [ PortReference < <wsa:Address jms://localhost/queue/eclipse_quickstart_helloworld_Request_esb/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFactory/>, <wsa:ReferenceProperties jbossesb:java.naming.provider.url : jnp://127.0.0.1:1099/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.url.pkgs : org.jboss.naming: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 : 1/> > ] RelatesTo: ID:25-12107572578895 ]
      org.jboss.soa.esb.couriers.CourierException: javax.jms.JMSException: This destination does not exist !QUEUE.queue/eclipse_quickstart_helloworld_Request_esb_reply
      at org.jboss.internal.soa.esb.couriers.JmsCourier.createMessageProducer(JmsCourier.java:352)
      at org.jboss.internal.soa.esb.couriers.JmsCourier.deliver(JmsCourier.java:189)
      at org.jboss.internal.soa.esb.couriers.TwoWayCourierImpl.deliver(TwoWayCourierImpl.java:188)
      at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.messageTo(ActionProcessingPipeline.java:521)
      at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.faultTo(ActionProcessingPipeline.java:471)
      at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:352)
      at org.jboss.soa.esb.listeners.message.MessageAwareListener$1.run(MessageAwareListener.java:303)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: javax.jms.JMSException: This destination does not exist !QUEUE.queue/eclipse_quickstart_helloworld_Request_esb_reply
      at org.jboss.mq.server.JMSDestinationManager.createQueue(JMSDestinationManager.java:613)
      at org.jboss.mq.server.JMSServerInterceptorSupport.createQueue(JMSServerInterceptorSupport.java:111)
      at org.jboss.mq.server.TracingInterceptor.createQueue(TracingInterceptor.java:259)
      at org.jboss.mq.server.JMSServerInvoker.createQueue(JMSServerInvoker.java:117)
      at org.jboss.mq.il.uil2.ServerSocketManagerHandler.handleMsg(ServerSocketManagerHandler.java:139)
      at org.jboss.mq.il.uil2.SocketManager$ReadTask.handleMsg(SocketManager.java:419)
      at org.jboss.mq.il.uil2.msgs.BaseMsg.run(BaseMsg.java:398)
      at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:761)
      ... 1 more
      15:07:55,715 INFO [STDOUT] &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

      Thanx a lot.