“AsynchBeans 服务未初始化”尝试查找 WebSphere 7 WorkManager 时出错

发布于 2024-12-11 04:26:16 字数 8227 浏览 1 评论 0原文

我尝试使用 CommonJ WorkManagerTaskExecutor 作为 Quartz SchedulerFactoryBean 的任务执行器,以避免 WebSphere 中的非托管线程(描述为 此处--向下滚动到“Quartz With CommonJ” 部分)。不幸的是,我似乎无法查找任何默认的 WebSphere WorkManager,也无法查找我创建的任何默认 WebSphere WorkManager。 CommonJ WorkManager 的 Spring bean:

<bean id="taskExecutor" class="org.springframework.scheduling.commonj.WorkManagerTaskExecutor">
    <property name="workManagerName" value="wm/default" />
</bean>

我收到 ServiceNotInitializedException:AsynchBeans Service 未初始化 错误和堆栈跟踪:

Exception in thread "P=166330:O=0:CT" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scheduler' defined in class path resource [spring-quartz-config.xml]: Cannot resolve reference to bean 'taskExecutor' while setting bean property 'taskExecutor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'taskExecutor' defined in class path resource [spring-quartz-config.xml]: Invocation of init method failed; nested exception is com.ibm.websphere.naming.CannotInstantiateObjectException: Exception occurred while the JNDI NamingManager was processing a javax.naming.Reference object. [Root exception is com.ibm.ws.asynchbeans.ServiceNotInitializedException: AsynchBeans Service not initialized]
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
    at com.lmig.am.claims.clip.test.TestQuartz.main(TestQuartz.java:12)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'taskExecutor' defined in class path resource [spring-quartz-config.xml]: Invocation of init method failed; nested exception is com.ibm.websphere.naming.CannotInstantiateObjectException: Exception occurred while the JNDI NamingManager was processing a javax.naming.Reference object. [Root exception is com.ibm.ws.asynchbeans.ServiceNotInitializedException: AsynchBeans Service not initialized]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
    ... 15 more
Caused by: com.ibm.websphere.naming.CannotInstantiateObjectException: Exception occurred while the JNDI NamingManager was processing a javax.naming.Reference object. [Root exception is com.ibm.ws.asynchbeans.ServiceNotInitializedException: AsynchBeans Service not initialized]
    at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookupExt(Helpers.java:1033)
    at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookup(Helpers.java:730)
    at com.ibm.ws.naming.jndicos.CNContextImpl.processResolveResults(CNContextImpl.java:3678)
    at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1848)
    at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1749)
    at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1500)
    at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:637)
    at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:165)
    at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:179)
    at javax.naming.InitialContext.lookup(InitialContext.java:436)
    at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:154)
    at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:87)
    at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152)
    at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178)
    at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:95)
    at org.springframework.scheduling.commonj.WorkManagerTaskExecutor.afterPropertiesSet(WorkManagerTaskExecutor.java:137)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
    ... 22 more
Caused by: com.ibm.ws.asynchbeans.ServiceNotInitializedException: AsynchBeans Service not initialized
    at com.ibm.ws.asynchbeans.J2EEServiceManager.getSelf(J2EEServiceManager.java:286)
    at com.ibm.ws.asynchbeans.AsynchContextDescriptorImpl2.inflateContext(AsynchContextDescriptorImpl2.java:164)
    at com.ibm.ws.asynchbeans.AsynchContextDescriptorImpl2.<init>(AsynchContextDescriptorImpl2.java:84)
    at com.ibm.ws.asynchbeans.AsynchBeanManager.<init>(AsynchBeanManager.java:150)
    at com.ibm.ws.asynchbeans.AsynchBeanManager.<init>(AsynchBeanManager.java:182)
    at com.ibm.ws.asynchbeans.AsynchBeanManager.<init>(AsynchBeanManager.java:195)
    at com.ibm.ws.asynchbeans.WorkManagerImpl.<init>(WorkManagerImpl.java:190)
    at com.ibm.ws.asynchbeans.naming.WorkManagerFactory.createWorkManager(WorkManagerFactory.java:290)
    at com.ibm.ws.asynchbeans.naming.WorkManagerFactory.getObjectInstance(WorkManagerFactory.java:205)
    at javax.naming.spi.NamingManager.getObjectInstanceByFactoryInReference(NamingManager.java:485)
    at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:350)
    at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookupExt(Helpers.java:927)
    ... 39 more

有什么想法可以解决此问题吗?谢谢!

I'm trying to use the CommonJ WorkManagerTaskExecutor as the task executor for a Quartz SchedulerFactoryBean in order to avoid unmanaged threads in WebSphere (described here--scroll down to "Quartz With CommonJ" section). Unfortunately, I can't seem to look up any of the default WebSphere WorkManagers, nor any that I create. The Spring bean for the CommonJ WorkManager:

<bean id="taskExecutor" class="org.springframework.scheduling.commonj.WorkManagerTaskExecutor">
    <property name="workManagerName" value="wm/default" />
</bean>

I'm getting a ServiceNotInitializedException: AsynchBeans Service not initialized error and stack trace:

Exception in thread "P=166330:O=0:CT" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scheduler' defined in class path resource [spring-quartz-config.xml]: Cannot resolve reference to bean 'taskExecutor' while setting bean property 'taskExecutor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'taskExecutor' defined in class path resource [spring-quartz-config.xml]: Invocation of init method failed; nested exception is com.ibm.websphere.naming.CannotInstantiateObjectException: Exception occurred while the JNDI NamingManager was processing a javax.naming.Reference object. [Root exception is com.ibm.ws.asynchbeans.ServiceNotInitializedException: AsynchBeans Service not initialized]
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
    at com.lmig.am.claims.clip.test.TestQuartz.main(TestQuartz.java:12)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'taskExecutor' defined in class path resource [spring-quartz-config.xml]: Invocation of init method failed; nested exception is com.ibm.websphere.naming.CannotInstantiateObjectException: Exception occurred while the JNDI NamingManager was processing a javax.naming.Reference object. [Root exception is com.ibm.ws.asynchbeans.ServiceNotInitializedException: AsynchBeans Service not initialized]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
    ... 15 more
Caused by: com.ibm.websphere.naming.CannotInstantiateObjectException: Exception occurred while the JNDI NamingManager was processing a javax.naming.Reference object. [Root exception is com.ibm.ws.asynchbeans.ServiceNotInitializedException: AsynchBeans Service not initialized]
    at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookupExt(Helpers.java:1033)
    at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookup(Helpers.java:730)
    at com.ibm.ws.naming.jndicos.CNContextImpl.processResolveResults(CNContextImpl.java:3678)
    at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1848)
    at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1749)
    at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1500)
    at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:637)
    at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:165)
    at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:179)
    at javax.naming.InitialContext.lookup(InitialContext.java:436)
    at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:154)
    at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:87)
    at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152)
    at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178)
    at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:95)
    at org.springframework.scheduling.commonj.WorkManagerTaskExecutor.afterPropertiesSet(WorkManagerTaskExecutor.java:137)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
    ... 22 more
Caused by: com.ibm.ws.asynchbeans.ServiceNotInitializedException: AsynchBeans Service not initialized
    at com.ibm.ws.asynchbeans.J2EEServiceManager.getSelf(J2EEServiceManager.java:286)
    at com.ibm.ws.asynchbeans.AsynchContextDescriptorImpl2.inflateContext(AsynchContextDescriptorImpl2.java:164)
    at com.ibm.ws.asynchbeans.AsynchContextDescriptorImpl2.<init>(AsynchContextDescriptorImpl2.java:84)
    at com.ibm.ws.asynchbeans.AsynchBeanManager.<init>(AsynchBeanManager.java:150)
    at com.ibm.ws.asynchbeans.AsynchBeanManager.<init>(AsynchBeanManager.java:182)
    at com.ibm.ws.asynchbeans.AsynchBeanManager.<init>(AsynchBeanManager.java:195)
    at com.ibm.ws.asynchbeans.WorkManagerImpl.<init>(WorkManagerImpl.java:190)
    at com.ibm.ws.asynchbeans.naming.WorkManagerFactory.createWorkManager(WorkManagerFactory.java:290)
    at com.ibm.ws.asynchbeans.naming.WorkManagerFactory.getObjectInstance(WorkManagerFactory.java:205)
    at javax.naming.spi.NamingManager.getObjectInstanceByFactoryInReference(NamingManager.java:485)
    at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:350)
    at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookupExt(Helpers.java:927)
    ... 39 more

Any ideas what I can do to resolve this? Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

波浪屿的海角声 2024-12-18 04:26:16

WebSphere asynchbean 只能从应用程序服务器进程使用。从堆栈跟踪中,您尝试从您编写的 TestQuartz 主方法中使用它,并且 asynchbeans 抛出异常以表明它没有在该 JVM 中作为服务器初始化的一部分启动。

WebSphere asynchbeans can only be used from an application server process. From the stack trace, you're attempting to use it from a TestQuartz main method that you've written, and asynchbeans is throwing an exception to indicate that it was not started in that JVM as part of server initialization.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文