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

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

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:

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.url.pkgs=com.sun.enterprise.naming} [Root exception is javax.naming.NameNotFoundException: concurrent]
at com.sun.enterprise.naming.impl.SerialContext.lookup(
at com.sun.enterprise.naming.impl.SerialContext.lookup(
at javax.naming.InitialContext.lookup(
at javax.naming.InitialContext.lookup(
at org.glassfish.batch.spi.impl.BatchRuntimeHelper.lookupExecutorService(
at org.glassfish.batch.spi.impl.BatchRuntimeHelper.access$200(
at org.glassfish.batch.spi.impl.BatchRuntimeHelper$GlassFishBatchExecutorServiceProvider.getExecutorService(
at javax.servlet.http.HttpServlet.service(
at javax.servlet.http.HttpServlet.service(

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