Application Server 7
  1. Application Server 7
  2. AS7-3581

NameNotFoundException in async web service method.

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved (View Workflow)
    • Priority: Blocker Blocker
    • Resolution: Done
    • Affects Version/s: 7.1.0.CR1b
    • Fix Version/s: 7.1.0.Final
    • Component/s: Web Services
    • Labels:
    • Environment:
      Any java system.
    • Workaround Description:
      Hide

      None.

      Show
      None.
    • Steps to Reproduce:
      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
    • Similar Issues:
      Show 10 results 

      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.

        Activity

        Hide
        Jeremy Whiting
        added a comment -

        Added sample applications to replicate the issue.

        Show
        Jeremy Whiting
        added a comment - Added sample applications to replicate the issue.
        Hide
        Alessio Soldano
        added a comment -

        Richard, let's discuss this a bit on IRC, afaiu the workaround you implemented can affect oneway endpoint performances; I've an idea for a different fix btw.

        Show
        Alessio Soldano
        added a comment - Richard, let's discuss this a bit on IRC, afaiu the workaround you implemented can affect oneway endpoint performances; I've an idea for a different fix btw.
        Hide
        Jeremy Whiting
        added a comment -

        Thank you Alessio and Richard for providing the fix quickly.

        Show
        Jeremy Whiting
        added a comment - Thank you Alessio and Richard for providing the fix quickly.

          People

          • Assignee:
            Alessio Soldano
            Reporter:
            Jeremy Whiting
          • Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: