1

我的项目中有一个批处理作业。在启动 bean 中,当我在 weblogic 上部署它时,它是由 BatchRuntime.getJobOperator().start("myJob") 安排和运行的,给出以下错误:

<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

数据源 jndi 名称源在控制台中设置为 jdbc/myDS,并且监控页面中存在旧的作业执行历史记录。我的配置有什么问题?

编辑 1:当我在控制台中更改数据源 JNDI 名称并将此数据源定位到管理服务器时,我的工作工作了 13 个小时,然后再次出现上述错误而没有改变任何东西!

4

0 回答 0