我们使用 Websphere 8 Application Server,我想在我们的 web 应用程序中使用服务器 workmanager。我正在尝试获取对 jca workmanager 的引用以javax.resource.spi.work.Workmanager
将其与 Springs 一起使用org.springframework.jca.work.WorkManagerTaskExecutor
。
web.xml 中的资源引用如下所示:
<resource-ref>
<res-ref-name>workmanager/web</res-ref-name>
<res-type>javax.resource.spi.work.WorkManager</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
使用该配置,我得到以下异常:
Caused by: com.ibm.ws.asynchbeans.exception.AsynchBeanException: ASYN0064E: The value javax.resource.spi.work.WorkManager of the res-type resource reference element WorkManager is not right. Only the following values are allowed: com.ibm.websphere.asynchbeans.WorkManager, commonj.work.WorkManager.
at com.ibm.ws.asynchbeans.naming.WorkManagerFactory.validateWMResRef(WorkManagerFactory.java:379)
at com.ibm.ws.asynchbeans.naming.WorkManagerFactory.getObjectInstance(WorkManagerFactory.java:147)
at org.apache.aries.jndi.ObjectFactoryHelper$7.run(ObjectFactoryHelper.java:338)
at java.security.AccessController.doPrivileged(AccessController.java:362)
at org.apache.aries.jndi.Utils.doWithRestoredPrivileges(Utils.java:155)
at org.apache.aries.jndi.ObjectFactoryHelper.getObjectInstanceUsingObjectFactoryBuilders(ObjectFactoryHelper.java:336)
at org.apache.aries.jndi.ObjectFactoryHelper.doGetObjectInstance(ObjectFactoryHelper.java:136)
at org.apache.aries.jndi.ObjectFactoryHelper.access$000(ObjectFactoryHelper.java:60)
at org.apache.aries.jndi.ObjectFactoryHelper$1.run(ObjectFactoryHelper.java:98)
at java.security.AccessController.doPrivileged(AccessController.java:327)
at org.apache.aries.jndi.Utils.doPrivileged(Utils.java:146)
at org.apache.aries.jndi.ObjectFactoryHelper.getObjectInstance(ObjectFactoryHelper.java:96)
at org.apache.aries.jndi.OSGiObjectFactoryBuilder.getObjectInstance(OSGiObjectFactoryBuilder.java:57)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:349)
at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookupExt(Helpers.java:993)
... 89 more
它在这里说我的资源引用必须是类型com.ibm.websphere.asynchbeans.WorkManager
or commonj.work.WorkManager
。它们都不是从 JCA-Workmanager-Interface 扩展而来的。
如果我将资源类型切换为commonj.work.WorkManager
并在我的应用程序中使用 Springs org.springframework.scheduling.commonj.WorkManagerTaskExecutor
,一切正常。
要让 JCA Workmanager 与 Websphere 一起工作,我是否需要在服务器端配置一些特殊的东西?我还没有在管理控制台中找到任何设置来切换实现。Websphere 8 支持 Java EE 6,所以应该可以处理 JCA。