无法在 Websphere 上使用 PostgreSQL 配置 EJB 计时器



我在Websphere容器上部署了一个应用程序,并通过容器配置了EJB Timer调度程序。

我配置了一个oracle数据库,一切都很顺利。

现在,我正试图将数据库从Oracle更改为postgresSQL,并完成了所有需要的工作,包括创建新的数据源、驱动程序等。Websphere确实通过数据源连接到了数据库。我使用的Jndi与我的oracle数据库相同,所以代码中不需要额外的工作。

当我试图启动应用程序并安装新的EAR文件时,我得到了以下异常:

WebSphere:name=ApplicationManager,process=server1,platform=proxy,node=localhostNode01,version=8.5.5.10,type=ApplicationManager、mbeanIdentifier=ApplicationManager和cell=localhostNode01Cell,spec=1.0异常为:javax.management.MBeaException:尝试调用操作startApplication时在RequiredModelMBean中引发异常位于javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1304)位于javax.management.modelmbean.RequiredModelMBean.vinvoke(RequiredModelMBean.java:1093)网址:com.sun.jmx.intercept.DefaultMBeanServerInterceptor.ioke(DefaultMBeanServer interceptor.java:832)网址:com.sun.jmx.mbanserver.JmxMBeanServer.ioke(JmxMBean Server.java:814)网址:com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1350)网址:com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)位于com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1243)网址:com.ibm.ws.management.application.AppManagementImpl._startApplication(AppManagementImpl.java:1482)网址:com.ibm.ws.management.application.AppManagementImpl.startApplication(AppManagementImpl.java:1371)位于com.ibm.ws.management.application.AppManagementImpl.startApplication(AppManagementImpl.java:1320)在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)位于sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56)位于java.lang.reflect.Method.ioke(Method.java:620)在sun.reflect.mic.Trampoline.uinvoke(MethodUtil.java:88)位于sun.reflect.GeneratedMethodAccessor31.invoke(未知源)在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56)位于java.lang.reflect.Method.ioke(Method.java:620)在sun.reflect.misc.MethodUtil.ioke(MethodUtil.java:292)位于javax.management.modelmbean.RequiredModelMBean$4.run(RequiredModelMBean.java:1261)在java.security.AccessController.doPrivileged(AccessController.java:422)位于java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:88)位于javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1255)位于javax.management.modelmbean.RequiredModelMBean.vinvoke(RequiredModelMBean.java:1093)网址:com.sun.jmx.intercept.DefaultMBeanServerInterceptor.ioke(DefaultMBeanServer interceptor.java:832)网址:com.sun.jmx.mbanserver.JmxMBeanServer.ioke(JmxMBean Server.java:814)网址:com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1350)网址:com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)位于com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1243)网址:com.ibm.ws.management.connecter.AdminServiceDelegator.ioke(AdminServiceDelegator.java:181)在sun.reflect.GeneratedMethodAccessor38.invoke(未知源)在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56)位于java.lang.reflect.Method.ioke(Method.java:620)位于com.ibm.ws.management.connector.soap.SOAPConnector.ioke(SOAPConnector.java:488)位于com.ibm.ws.management.connector.soap.SOAPConnector.service(SOAPConnector.java:324)位于com.ibm.ws.management.connecter.soap.SOAPConnection.handleRequest(SOAPConnection.java:65)网址:com.ibm.ws.HttpConnection.readAndHandleRequest(HttpConnection.java:733)在com.ibm.ws.http.HttpConnection.run(HttpConnection.java:522)位于com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1892)由以下原因引起:com.ibm.ws.exception.Runtime错误:com.ibm.websphere.ci.EJBContainerException:EJB计时器服务未启动在com.ibm.ws.ejbontainer.runtime.AbstractEJBRuntime.startModule(AbstractEJBRountime.java:731)位于com.ibm.ws.ejbcontainer.runtime.SharedEJBRuntimeImpl.startModule(SharedEJBRuntime Impl.java:338)在com.ibm.ws.runtime.component.EJBContainerImpl.start(EJBContainerImpl.java:3358)在com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1179)在com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1390)位于com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:639)在com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:979)位于com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:778)在com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplicationDynamically(ApplicationMgrImpl.java:1381)位于com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2192)在com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitManageImpl.java:435)在com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)位于com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitManageImpl.java:378)在com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitManager Impl.java:126)位于com.ibm.ws.runtime.component.CompositionUnitMgrImpl$1.run(CompositionUnitManager Impl.java:653)网址:com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5396)网址:com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5612)网址:com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)位于com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitManager Impl.java:667)位于com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitManager Impl.java:611)位于com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1271)在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)位于sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56)位于java.lang.reflect.Method.ioke(Method.java:620)在sun.reflect.mic.Trampoline.uinvoke(MethodUtil.java:88)位于sun.reflect.GeneratedMethodAccessor31.invoke(未知源)在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56)位于java.lang.reflect.Method.ioke(Method.java:620)在sun.reflect.misc.MethodUtil.ioke(MethodUtil.java:292)位于javax.management.modelmbean.RequiredModelMBean$4.run(RequiredModelMBean.java:1261)在java.security.AccessController.doPrivileged(AccessController.java:422)位于java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:88)位于javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1255)…还有38由以下原因引起:com.ibm.websphere.ci.EJBContainerException:EJB计时器服务未启动在com.ibm.ws.runtime.component.EJBContainerImpl.getSchedulerInstance(EJBContainerImpl.java:2082)在com.ibm.ws.runtime.component.EJBContainerImpl.initializeTimerService(EJBContainerImpl.java:1827)在com.ibm.ws.runtime.component.WASEJBRuntimeImpl.initializeTimerService(WASEJBRountimeImpl.java:540)在com.ibm.ws.ejbontainer.runtime.AbstractEJBRuntime.startModule(AbstractEJBRountime.java:575)…还有71由以下原因引起:com.ibm.ws.scheduler.exception.SchedulerDataStoreException:com.ibm.ws.extensionhelper.exception.UnnknowDatabaseException:无法检测到数据库供应商。供应商字符串为PostgreSQL在com.ibm.ws.scheller.WASSchedulerCfgHelper.createTables(WASSchedulerCfgHelper.java:546)在com.ibm.ws.runtime.component.EJBContainerImpl.createTimerTables(EJBContainerImpl.java:2712)在com.ibm.ws.runtime.component.EJBContainerImpl.getSchedulerInstance(EJBContainerImpl.java:2025)…还有74由以下原因引起:com.ibm.ws.extensionhelper.exception.UnnknowDatabase异常:无法检测到数据库供应商。供应商字符串为PostgreSQL网址:com.ibm.ws.extensionhelper.db.impl.DatabaseHelperImpl.connect(DatabaseHelperImpl.java:672)在com.ibm.ws.extensionhelper.db.impl.DatabaseHelperImpl.initialize(DatabaseHelperImpl.java:501)网址:com.ibm.ws.extensionhelper.db.impl.DatabaseHelperImpl.(DatabaseHelperImpl.java:261)网址:com.ibm.ws.extensionhelper.impl.ExtensionHelperServiceImpl.getDatabaseHelper(ExtensionHelperServicesImpl.java:116)在com.ibm.ws.scheller.DBHelperImpl.(DBHelperImpl.java:108)位于com.ibm.ws.scheduler.WASSchedulerCfgHelper.getDatabaseHelper(WASSchedulerCfgHelper.java:959)在com.ibm.ws.scheller.WASSchedulerCfgHelper.createTables(WASSchedulerCfgHelper.java:541)…还有76个

[10/3/17 16:19:42:601 IDT]00000067 Servlet包装

我想,在去掉IBM调度器并移动EJB标准Timer之后,我不会得到这个异常。

知道我该如何克服这个问题吗?

EJB持久定时器的实现仍然由数据库支持,因此该功能受到应用程序服务器内置互操作性的数据库供应商的限制(不同数据库供应商的SQL命令差异很大)。WebSphere Application Server传统版没有与PostgreSQL内置的EJB持久定时器(或其调度器)互操作性,这就是为什么您会看到错误:

UnknownDatabaseException: Could not detect database vendor. Vendor string was PostgreSQL

也就是说,您可能能够让PostgreSQL在WebSphereApplicationServer Liberty上为EJB持久定时器工作(与传统的相反),因为Liberty实现是基于JPA而不是SQL构建的。

最新更新