moh m
moh m

Reputation: 51

weblogic Lookup failed for JNDI name: jdbc/batch

I have a batch job in my project. In startup bean it was schedule and run by BatchRuntime.getJobOperator().start("myJob") when I deploy it on weblogic give below error:

<com.ibm.jbatch.container.services.impl.JDBCPersistenceManagerImpl> <BEA-000000> <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.> 
<Error> <com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl> <BEA-000000> <Could not instantiate service: com.ibm.jbatch.container.impl.BatchKernelImpl due to exception:java.lang.reflect.InvocationTargetException> 
03:20:51.576 [[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] ERROR foo.config.StartupBean - javax.batch.operations.JobOperator: Provider com.ibm.jbatch.container.api.impl.JobOperatorImpl could not be instantiated
java.util.ServiceConfigurationError: javax.batch.operations.JobOperator: Provider com.ibm.jbatch.container.api.impl.JobOperatorImpl could not be instantiated
    at java.util.ServiceLoader.fail(ServiceLoader.java:232)
    at java.util.ServiceLoader.access$100(ServiceLoader.java:185)
    at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:384)
    at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
    at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
    at javax.batch.runtime.BatchRuntime$1.run(BatchRuntime.java:52)
    at javax.batch.runtime.BatchRuntime$1.run(BatchRuntime.java:47)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.batch.runtime.BatchRuntime.getJobOperator(BatchRuntime.java:47)
    at com.foo.StartupBean.lambda$initializeScheduling$20(StartupBean.java:59)
    at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
    at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
    at com.foo.StartupBean.initializeScheduling(StartupBean.java:57)
    ....
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:217)
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:14)
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:69)
    at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:670)
    at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352)
    at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337)
    at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57)
    at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
    at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:644)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:415)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:355)
Caused by: java.lang.RuntimeException: Could not instantiate service com.ibm.jbatch.container.impl.BatchKernelImpl
    at com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl$ServiceLoader._loadServiceHelper(ServicesManagerImpl.java:424)
    at com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl$ServiceLoader.getService(ServicesManagerImpl.java:403)
    at com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl$ServiceLoader.access$300(ServicesManagerImpl.java:388)
    at com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl.getService(ServicesManagerImpl.java:304)
    at com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl.getBatchKernelService(ServicesManagerImpl.java:348)
    at com.ibm.jbatch.container.api.impl.JobOperatorImpl.<init>(JobOperatorImpl.java:74)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at java.lang.Class.newInstance(Class.java:442)
    at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:380)
    ... 75 common frames omitted
Caused by: java.lang.reflect.InvocationTargetException: null
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl$ServiceLoader._loadService(ServicesManagerImpl.java:447)
    at com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl$ServiceLoader._loadServiceHelper(ServicesManagerImpl.java:420)
    ... 86 common frames omitted
Caused by: com.ibm.jbatch.container.exception.BatchContainerServiceException: javax.naming.NameNotFoundException: Unable to resolve 'jdbc.batch'. Resolved 'jdbc'; remaining name 'batch'
    at com.ibm.jbatch.container.services.impl.JDBCPersistenceManagerImpl.init(JDBCPersistenceManagerImpl.java:128)
    at com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl$ServiceLoader.getService(ServicesManagerImpl.java:404)
    at com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl$ServiceLoader.access$300(ServicesManagerImpl.java:388)
    at com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl.getService(ServicesManagerImpl.java:304)
    at com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl.getPersistenceManagerService(ServicesManagerImpl.java:333)
    at com.ibm.jbatch.container.impl.BatchKernelImpl.<init>(BatchKernelImpl.java:87)
    ... 92 common frames omitted
Caused by: javax.naming.NameNotFoundException: Unable to resolve 'jdbc.batch'. Resolved 'jdbc'
    at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1292)
    at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:354)
    at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:227)
    at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:214)
    at weblogic.jndi.internal.ServerNamingNode.lookup(ServerNamingNode.java:527)
    at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:228)
    at weblogic.jndi.internal.ServerNamingNode.lookup(ServerNamingNode.java:527)
    at weblogic.jndi.internal.RootNamingNode.lookup(RootNamingNode.java:84)
    at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:307)
    at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:435)
    at javax.naming.InitialContext.lookup(InitialContext.java:417)
    at com.ibm.jbatch.container.services.impl.JDBCPersistenceManagerImpl.init(JDBCPersistenceManagerImpl.java:123)
    ... 97 common frames omitted

Data source jndi name source is set to jdbc/myDS in console and old job execution history exist in monitoring page. what is wrong in my config?

EDIT 1: When I change Data Source JNDI Name in console and target this datasource to admin server my jobs work for 13 hours and then again above error appeared without changenging any thing!

Upvotes: 1

Views: 970

Answers (0)

Related Questions