1 Reply Latest reply on Dec 16, 2008 10:07 AM by Adrian Brock

    [JmsActivation] Failure in jms activation What would be it?

    Diogo Gonzaga Newbie

      I'm trying to deploy an application example and I got this error:

      12:27:04,922 WARN [JmsActivation] Failure in jms activation org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@16095fc(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter@c92ed6 destination=jms/OrderBillingQueue isTopic=false tx=true durable=false reconnect=10 provider=java:/DefaultJMSProvider user=null maxMessages=1 minSession=1 maxSession=15 keepAlive=60000 useDLQ=true DLQHandler=org.jboss.resource.adapter.jms.inflow.dlq.GenericDLQHandler DLQJndiName=queue/DLQ DLQUser=null DLQMaxResent=0)
      javax.naming.NameNotFoundException: jms not bound
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
      at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
      at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
      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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
      at sun.rmi.transport.Transport$1.run(Transport.java:153)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
      at java.lang.Thread.run(Thread.java:595)
      at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
      at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
      at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
      at javax.naming.InitialContext.lookup(InitialContext.java:351)
      at org.jboss.util.naming.Util.lookup(Util.java:215)
      at org.jboss.resource.adapter.jms.inflow.JmsActivation.setupDestination(JmsActivation.java:399)
      at org.jboss.resource.adapter.jms.inflow.JmsActivation.setup(JmsActivation.java:306)
      at org.jboss.resource.adapter.jms.inflow.JmsActivation$SetupActivation.run(JmsActivation.java:589)
      at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:204)
      at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:275)
      at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
      at java.lang.Thread.run(Thread.java:595)


      My MDB is:

      package ejb3.ejb3inaction.actionbazaar.buslogic;

      import java.sql.Connection;
      import java.sql.SQLException;
      import java.sql.Statement;

      import javax.ejb.MessageDrivenContext;
      import javax.jms.JMSException;
      import javax.jms.Message;
      import javax.jms.MessageListener;
      import javax.jms.ObjectMessage;
      import javax.sql.DataSource;

      @MessageDriven(activationConfig = {
      @ActivationConfigProperty(propertyName = "destination", propertyValue = "jms/ShippingRequestQueue"),
      @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue") })
      public class ShippingRequestProcessorMDB implements MessageListener {
      private Connection connection;

      private DataSource dataSource;

      @Resource
      private MessageDrivenContext context;

      @Resource(name = "jdbc/TurtleDS", mappedName = "java:/DefaultDS")
      public void setDataSource(DataSource dataSource) {
      this.dataSource = dataSource;
      }

      @PostConstruct
      public void initialize() {
      try {
      connection = dataSource.getConnection();
      } catch (SQLException sqle) {
      sqle.printStackTrace();
      }
      }

      @PreDestroy
      public void cleanup() {
      try {
      connection.close();
      connection = null;
      } catch (SQLException sqle) {
      sqle.printStackTrace();
      }
      }

      public void onMessage(Message message) {
      try {
      ObjectMessage objectMessage = (ObjectMessage) message;
      ShippingRequest shippingRequest = (ShippingRequest) objectMessage
      .getObject();
      processShippingRequest(shippingRequest);
      System.out.println("Shipping request processed.");
      } catch (JMSException jmse) {
      jmse.printStackTrace();
      context.setRollbackOnly();
      } catch (SQLException sqle) {
      sqle.printStackTrace();
      context.setRollbackOnly();
      }
      }

      private void processShippingRequest(ShippingRequest request)
      throws SQLException {
      Statement statement = connection.createStatement();
      String sql = "INSERT INTO " + "SHIPPING_REQUESTS(" + "ITEM, "
      + "SHIPPING_ADDRESS, " + "SHIPPING_METHOD, "
      + "INSURANCE_AMOUNT) " + "VALUES ( " + request.getItem() + ", "
      + "'" + request.getShippingAddress() + "', " + "' "
      + request.getShippingMethod() + "', "
      + request.getInsuranceAmount() + ")";
      System.out.println(sql);
      statement.execute(sql);
      }
      }

      Anybody have a hint?

        • 1. Re: [JmsActivation] Failure in jms activation What would be
          Adrian Brock Master

           

          javax.naming.NameNotFoundException: jms not bound


          As it says, there's no such binding in jndi, probably because there is no such queue.

          destination=jms/OrderBillingQueue


          Check your jndi config for the DefaultJMSProvider in jms-ds.xml
          since this looks like a remote jndi request from the stacktrace
          which I'd guess is going to the wrong machine?

           at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
          at sun.rmi.transport.Transport$1.run(Transport.java:153)
          at java.security.AccessController.doPrivileged(Native Method)
          at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
          at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
          at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
          at java.lang.Thread.run(Thread.java:595)
          at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
          at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
          at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
          at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
          at javax.naming.InitialContext.lookup(InitialContext.java:351)
          at org.jboss.util.naming.Util.lookup(Util.java:215)
          


          If you can't figure it out, there's a seperate forum for naming/jndi issues that
          has an FAQ.