Uploaded image for project: 'Application Server 7'
  1. Application Server 7
  2. AS7-3581

NameNotFoundException in async web service method.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Blocker
    • 7.1.0.Final
    • 7.1.0.CR1b
    • Web Services
    • Hide

      Attached is an archive with 5 maven modules. There are two separate JEE
      applications. This replicates the scenario of the jEnterprise2010
      benchmark where the problem originated.

      envEntryLookupEAR
      envEntryEmulatorSampleEAR

      You will need to use Maven3 to build these projects. I will provide the
      order each needs to be built. Before building one of the modules the
      maven pom.xml needs to be updated.
      It will mean the generated ws client api is compiled with the correct
      URL to the wsdl.

      The sample contains two applications. The first is the application than
      initiates the web service call. Called envEntryLookupEAR. The second has
      the receiving StaticService web service and is called
      envEntryEmulatorSampleEAR.

      Call sequence,
      The first contains a Servlet. You will use this when everything is
      deployed. The Servlet puts a message onto a queue. An MDB is activated
      when a message is put on the queue. The MDB ignores the message and
      invokes the StaticService ws.

      The web service is invoked. The web service creates an instance of an
      object called StaticInit. Inside this object a jndi lookup is made. The
      lookup name should have an Integer object bound. Which is configured as
      an env-entry in the web application deployment descriptor.
      envEntryEmulatorSampleWeb/src/main/webapp/WEB-INF/web.xml

      1)
      Change the hostname to localhost or the public interface configured for
      AS7.
      envEntryLookupClient/pom.xml

      1.1)
      Change the existing XA jms connection factory to
      java:jboss/jms/JmsXA

      1.2)
      Add a new queue.

      <jms-queue name="AcmeQueue">
      <entry name="java:jboss/jms/AcmeQueue"/>
      </jms-queue>
      2)
      Build and install the modules in this order.
      envEntryEmulatorSampleWeb
      envEntryEmulatorSampleEAR

      3) Deploy the envEntryEmulatorSampleEAR to a running AS7.

      5) Build and install the modules in this order.

      envEntryLookupClient
      envEntryLookupEJB
      envEntryLookupWeb
      envEntryLookupEAR

      6) Deploy envEntryLookupEAR to AS7.

      You should expect to see this in the console.

      13:22:15,324 INFO [org.jboss.as.ejb3] (MSC service thread 1-5)
      JBAS014142: Started message driven bean 'AcmeMDB' with 'hornetq-ra'
      resource adapter
      13:22:15,349 INFO [org.jboss.web] (MSC service thread 1-5) registering
      web context: /envEntryLookupWeb
      13:22:15,361 INFO [org.jboss.as.server] (management-handler-threads -
      9) JBAS018559: Deployed "envEntryLookupEAR-0.0.1-SNAPSHOT.ear"

      7)
      Use a browser to make a request to the Servlet.

      http://localhost:8080/envEntryLookupWeb/pushmessage

      8)
      The AS7 console should display an exception.

      javax.naming.NameNotFoundException: java:comp/env/supplier.payloadsize.min

      Regards,
      Jeremy

      Show
      Attached is an archive with 5 maven modules. There are two separate JEE applications. This replicates the scenario of the jEnterprise2010 benchmark where the problem originated. envEntryLookupEAR envEntryEmulatorSampleEAR You will need to use Maven3 to build these projects. I will provide the order each needs to be built. Before building one of the modules the maven pom.xml needs to be updated. It will mean the generated ws client api is compiled with the correct URL to the wsdl. The sample contains two applications. The first is the application than initiates the web service call. Called envEntryLookupEAR. The second has the receiving StaticService web service and is called envEntryEmulatorSampleEAR. Call sequence, The first contains a Servlet. You will use this when everything is deployed. The Servlet puts a message onto a queue. An MDB is activated when a message is put on the queue. The MDB ignores the message and invokes the StaticService ws. The web service is invoked. The web service creates an instance of an object called StaticInit. Inside this object a jndi lookup is made. The lookup name should have an Integer object bound. Which is configured as an env-entry in the web application deployment descriptor. envEntryEmulatorSampleWeb/src/main/webapp/WEB-INF/web.xml 1) Change the hostname to localhost or the public interface configured for AS7. envEntryLookupClient/pom.xml 1.1) Change the existing XA jms connection factory to java:jboss/jms/JmsXA 1.2) Add a new queue. <jms-queue name="AcmeQueue"> <entry name="java:jboss/jms/AcmeQueue"/> </jms-queue> 2) Build and install the modules in this order. envEntryEmulatorSampleWeb envEntryEmulatorSampleEAR 3) Deploy the envEntryEmulatorSampleEAR to a running AS7. 5) Build and install the modules in this order. envEntryLookupClient envEntryLookupEJB envEntryLookupWeb envEntryLookupEAR 6) Deploy envEntryLookupEAR to AS7. You should expect to see this in the console. 13:22:15,324 INFO [org.jboss.as.ejb3] (MSC service thread 1-5) JBAS014142: Started message driven bean 'AcmeMDB' with 'hornetq-ra' resource adapter 13:22:15,349 INFO [org.jboss.web] (MSC service thread 1-5) registering web context: /envEntryLookupWeb 13:22:15,361 INFO [org.jboss.as.server] (management-handler-threads - 9) JBAS018559: Deployed "envEntryLookupEAR-0.0.1-SNAPSHOT.ear" 7) Use a browser to make a request to the Servlet. http://localhost:8080/envEntryLookupWeb/pushmessage 8) The AS7 console should display an exception. javax.naming.NameNotFoundException: java:comp/env/supplier.payloadsize.min Regards, Jeremy
    • Hide

      None.

      Show
      None.

    Description

      When an asynchronous Web Service method annotated with @OneWay makes a JNDI lookup a NameNotFoundException is thrown.

      The callee is an MDB in the same VM. The invocation is placed in a worker queue. When the invocation Task is taken from the queue and invoked the jndi object is not found.

      Attachments

        Activity

          People

            rhn-support-asoldano Alessio Soldano
            jwhiting@redhat.com Jeremy Whiting
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: