Issue Details (XML | Word | Printable)

Key: GLASSFISH-20210
Type: Bug Bug
Status: Closed Closed
Resolution: Works as designed
Priority: Critical Critical
Assignee: anthony.lai
Reporter: Mahesh Kannan
Votes: 1
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
glassfish

Unable to lookup concurrent/__defaultManagedExecutorService from batch connector

Created: 07/Apr/13 06:15 AM   Updated: 10/Apr/13 11:27 PM   Resolved: 10/Apr/13 11:27 PM
Component/s: concurrency
Affects Version/s: 4.0_b83
Fix Version/s: 4.0_b85

Time Tracking:
Not Specified

Issue Links:
Dependency
 

Tags:
Participants: anthony.lai and Mahesh Kannan


 Description  « Hide

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)



anthony.lai added a comment - 09/Apr/13 05:00 PM

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.


anthony.lai added a comment - 10/Apr/13 11:27 PM

GLASSFISH-20196 has been fixed by injecting ManagedExecutorService.ManagedExecutorServiceConfigActivator