users@glassfish.java.net

Re: GF4: Cannot start batch job from _at_Startup EJB

From: <Mahesh.Kannan_at_Oracle.Com>
Date: Mon, 10 Jun 2013 18:12:50 -0700

This seem to indicate that the batch runtime has not detected that it is
      running in a Java EE environment. jdbc/batch is used only in Java SE
     mode.

Is this is consistently reproducible? Anyways, please file a JIRA issue.

Thanks
Mahesh

On 6/10/13 5:13 PM, Marina Vatkina wrote:
> It might be a bug, it might be not. Does it work in the servlet init()
> method? Or a non-startup singleton EJB? How is the "jdbc/batch"
> configured and registered?
>
> thanks,
> -marina
>
> On 6/9/13 8:17 AM, Harald Wellmann wrote:
>> I'm currently experimenting with the new javax.batch API in GlassFish
>> 4.0b89.
>>
>> I'm getting exceptions when trying to start a batch job from a
>> @PostConstruct method of a @Singleton @Startup EJB.
>>
>> However, the same code works fine when running within a servlet.
>>
>> It seems the batch runtime is not yet fully set up when the EJB
>> startup methods are run.
>>
>> See the message about failed lookup of "jddb/batch" below.
>>
>> Is this a bug, or is it illegal to use the Batch API in this early
>> phase?
>>
>> [#|2013-06-09T17:00:44.550+0200|INFO|glassfish
>> 4.0|javax.enterprise.system.container.ejb.com.sun.ejb.containers|_ThreadID=1;_ThreadName=main;_TimeMillis=1370790044550;_LevelValue=800;_MessageID=ejb.portable_jndi_names;|
>> EJB5181:Portable JNDI names for EJB InitializerService:
>> [java:global/batch-demo/InitializerService!com.blogspot.hwellmann.batch.init.InitializerService,
>> java:global/batch-demo/InitializerService]|#]
>>
>> [#|2013-06-09T17:00:44.638+0200|INFO|glassfish
>> 4.0|org.jboss.weld.Version|_ThreadID=1;_ThreadName=main;_TimeMillis=1370790044638;_LevelValue=800;|
>> WELD-000900 2.0.0 (SP1)|#]
>>
>> [#|2013-06-09T17:00:45.600+0200|WARNING|glassfish
>> 4.0|org.jboss.weld.interceptor.util.InterceptionTypeRegistry|_ThreadID=1;_ThreadName=main;_TimeMillis=1370790045600;_LevelValue=900;|
>> Class 'javax.ejb.PostActivate' not found, interception based on it
>> is not enabled|#]
>>
>> [#|2013-06-09T17:00:45.601+0200|WARNING|glassfish
>> 4.0|org.jboss.weld.interceptor.util.InterceptionTypeRegistry|_ThreadID=1;_ThreadName=main;_TimeMillis=1370790045601;_LevelValue=900;|
>> Class 'javax.ejb.PrePassivate' not found, interception based on it
>> is not enabled|#]
>>
>> [#|2013-06-09T17:00:46.130+0200|SEVERE|glassfish
>> 4.0|com.ibm.jbatch.container.services.impl.JDBCPersistenceManagerImpl|_ThreadID=1;_ThreadName=main;_TimeMillis=1370790046130;_LevelValue=1000;|
>> Lookup failed for JNDI name: jdbc/batch. One cause of this could
>> be that the batch runtime is incorrectly configured to EE mode when
>> it should be in SE mode.|#]
>>
>> [#|2013-06-09T17:00:46.131+0200|SEVERE|glassfish
>> 4.0|com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl|_ThreadID=1;_ThreadName=main;_TimeMillis=1370790046131;_LevelValue=1000;|
>> Could not instantiate service:
>> com.ibm.jbatch.container.impl.BatchKernelImpl due to
>> exception:java.lang.reflect.InvocationTargetException|#]
>>
>>
>> Best regards,
>> Harald
>>
>