0 Replies Latest reply on Jan 10, 2010 11:00 PM by lispnik

    What causes "Courier for HTTPEpr not supported: ESB-unaware EPR used!"

    lispnik

      I have several JBossESB applications in production which consist of a HTTP gateway interface to a remote JEE application.  With all of these HTTP gateway-using applications, we have been encountering this spurious message: 

       

      2010-01-10 21:00:39,626 INFO  [org.jboss.soa.esb.client.ServiceInvoker] Badly formed EPR [HTTPEpr [ PortReference < , ,  > ]] for Service [test:TestGatewayService] and Message [header: [  ]].Courier for HTTPEpr not supported: ESB-unaware EPR used!

       

      It does not occur on every request.  It seems to occur 2 or three times per 100 requests, and they seem to occur every minute or so.  I'm using JBossESB 4.5.GA, with JBoss 4.2.3.GA and JBoss Messaging 1.4.2.GA-SP1 on Linux and have configured an Oracle datasource for JUDDI and messaging.

       

      I've done some digging in the JBossESB source and found where it's thrown from: courierFromGenericEPR(EPR epr, boolean pickUpOnly) in TwoWayCourierImpl.java.  Basically it's deciding on the implementation to use based on the EPR address.  None of them match "http" of course and hence the error. 

       

      What I can't understand is how a small number of requests arrive at that point in JBossESB in the first place.  All the requests are of the same form, so I would think that we would get that error message for all of them.  The messages are quite short -- about 100 to 200 bytes.  I have attached my configuration files below for a simplified example that exhibits the problem. 

       

      What might cause this problem?

       

      TwoWayCourierImpl.java:

       

              private Object courierFromGenericEPR(EPR epr, boolean pickUpOnly)
                              throws CourierException, MalformedEPRException
              {
                      String addr = null;

       

                      addr = epr.getAddr().getAddress();
              if (addr.startsWith(InVMEpr.INVM_PROTOCOL))
                  return CourierFactory.getInstance().getInVMCourier(new InVMEpr(epr));
                      if (addr.startsWith(JMSEpr.JMS_PROTOCOL))
                              return new JmsCourier(new JMSEpr(epr), pickUpOnly);
                      if (addr.startsWith(JDBCEpr.JDBC_PROTOCOL))
                              return new SqlTableCourier(new JDBCEpr(epr), pickUpOnly);
                      // TODO magic strings
                      if (addr.startsWith("file://") || addr.startsWith("ftp://")
                                      || addr.startsWith("sftp://") || addr.startsWith("ftps://"))
                              return new FileCourier(new FileEpr(epr), pickUpOnly);

       

                      throw new MalformedEPRException("Courier for "
                                      + epr.getClass().getSimpleName() + " not supported: ESB-unaware EPR used!");
              }

       


      jboss-esb.xml:

       


              <jms-provider connection-factory="ConnectionFactory" name="JBossMessaging">
                  <jms-bus busid="testGatewayChannel">
                      <jms-message-filter dest-name="queue/testrouter_gateway_Request_esb" dest-type="QUEUE" />
                  </jms-bus>
              </jms-provider>
              <http-provider host="0.0.0.0" name="HttpProvider" port="9091">
                  <property name="maxThreads" value="50" />
                  <property name="maxSpareThreads" value="10" />
                  <property name="minSpareThreads" value="2" />
                  <http-bus busid="HTTP-1" context="/jbossesb/httpgateway/testrouter">
                      <property name="allowHttpMethod" value="POST" />
                  </http-bus>
              </http-provider>
          </providers>

       

          <services>
              <service category="test" description="Test Gateway Service" name="TestGatewayService">
                  <listeners>
                      <jms-listener busidref="testGatewayChannel" name="GatewayJmsListener" />
                      <http-listener busidref="HTTP-1" is-gateway="true" maxThreads="100" name="TestHttpListener" />
                  </listeners>
                  <actions mep="RequestResponse">
                      <action name="TestGatewayAction" class="com.example.test.TestServiceGatewayAction">
                      </action>
                  </actions>
              </service>
          </services>

       


      queue-service.xml:

       


          <mbean code="org.jboss.jms.server.destination.QueueService"
              name="test.destination:service=Queue,name=testrouter_gateway_Request_esb"
              xmbean-dd="xmdesc/Queue-xmbean.xml">
              <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
              <attribute name="MaxDeliveryAttempts">1</attribute>
          </mbean>
          <mbean code="org.jboss.jms.server.destination.QueueService"
              name="testrouter.destination:service=Queue,name=testrouter_gateway_Request_esb_reply"
              xmbean-dd="xmdesc/Queue-xmbean.xml">
              <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
              <attribute name="MaxDeliveryAttempts">1</attribute>
          </mbean>

       

      TestServiceGatewayAction.java:

       


      public class ImageServiceGatewayAction extends AbstractActionLifecycle {
      ...
              public ImageServiceGatewayAction(ConfigTree configTree) {
                      this.configTree = configTree;
              }

       

              @SuppressWarnings("unchecked")
              public Message process(Message message) throws Exception {
      ...
      // invoke the remote service
      ...
              }
      }