glassfish
  1. glassfish
  2. GLASSFISH-20210

Unable to lookup concurrent/__defaultManagedExecutorService from batch connector

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Works as designed
    • Affects Version/s: 4.0_b83
    • Fix Version/s: 4.0_b85
    • Component/s: concurrency
    • Labels:
      None

      Description

      I am seeing something strange. I am not sure if the issue that I am seeing is due to 20205 or not:

      The batch runtime uses concurrent/__defaultManagedExecutorService to get hold of a ManagedExecutorService. With the
      latest build I am unable to do a jndi lookup using:
      (new InitialContext()).lookup(" concurrent/__defaultManagedExecutorService");

      However, (new InitialContext()).lookup("java:comp/DefaultManagedExecutorService") is working.

      I think we should allow the direct lookup of concurrent/__defaultManagedExecutorService.

      Here is the stack trace I am seeing:

      javax.naming.NamingException: Lookup failed for 'concurrent/__defaultManagedExecutorService' in SerialContext[myEnv=

      {java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming}

      [Root exception is javax.naming.NameNotFoundException: concurrent]
      at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:491)
      at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:438)
      at javax.naming.InitialContext.lookup(InitialContext.java:411)
      at javax.naming.InitialContext.lookup(InitialContext.java:411)
      at org.glassfish.batch.spi.impl.BatchRuntimeHelper.lookupExecutorService(BatchRuntimeHelper.java:237)
      at org.glassfish.batch.spi.impl.BatchRuntimeHelper.access$200(BatchRuntimeHelper.java:76)
      at org.glassfish.batch.spi.impl.BatchRuntimeHelper$GlassFishBatchExecutorServiceProvider.getExecutorService(BatchRuntimeHelper.java:216)
      at com.ibm.jbatch.container.services.impl.SPIDelegatingThreadPoolServiceImpl.executeTask(SPIDelegatingThreadPoolServiceImpl.java:43)
      at com.ibm.jbatch.container.impl.BatchKernelImpl.startJob(BatchKernelImpl.java:135)
      at com.ibm.jbatch.container.api.impl.JobOperatorImpl.start(JobOperatorImpl.java:105)
      at com.oracle.javaee7.samples.batch.api.PayrollJobSubmitterServlet.submitJobFromXML(PayrollJobSubmitterServlet.java:163)
      at com.oracle.javaee7.samples.batch.api.PayrollJobSubmitterServlet.processRequest(PayrollJobSubmitterServlet.java:97)
      at com.oracle.javaee7.samples.batch.api.PayrollJobSubmitterServlet.doGet(PayrollJobSubmitterServlet.java:178)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

        Issue Links

          Activity

          Hide
          anthony.lai added a comment -

          Does the suggestion from Tom work for you:

          Since "concurrent/__defaultManagedExecutorService" is (or should be) a private interface, why does the batch runtime depend on it? Can we make the batch runtime depend on java:comp/DefaultManagedExecutorService which is a standard interface?

          If you really need to look up concurrent/__defaultManagedExecutorService directory, then it is possible to @Inject DefaultManagedExecutorService before doing the access which will force the former to be created.

          Show
          anthony.lai added a comment - Does the suggestion from Tom work for you: Since "concurrent/__defaultManagedExecutorService" is (or should be) a private interface, why does the batch runtime depend on it? Can we make the batch runtime depend on java:comp/DefaultManagedExecutorService which is a standard interface? If you really need to look up concurrent/__defaultManagedExecutorService directory, then it is possible to @Inject DefaultManagedExecutorService before doing the access which will force the former to be created.
          Hide
          anthony.lai added a comment -

          GLASSFISH-20196 has been fixed by injecting ManagedExecutorService.ManagedExecutorServiceConfigActivator

          Show
          anthony.lai added a comment - GLASSFISH-20196 has been fixed by injecting ManagedExecutorService.ManagedExecutorServiceConfigActivator

            People

            • Assignee:
              anthony.lai
              Reporter:
              Mahesh Kannan
            • Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: