无法在Websphere

时间:2017-10-03 13:37:15

标签: java postgresql web-services ejb websphere

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

我配置了oracle DB,并且一切正常。

现在我正在尝试将数据库从Oracle更改为postgres SQL并完成所有必需的工作,包括创建新的数据源,驱动程序等。 Websphere确实设法通过Datasource连接到DB。 我使用与我的oracle db相同的Jndi,因此代码中不需要额外的工作。

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

  

WebSphere:name = ApplicationManager,process = server1,platform = proxy,node = localhostNode01,version = 8.5.5.10,type = ApplicationManager,mbeanIdentifier = ApplicationManager,cell = localhostNode01Cell,spec = 1.0 exception is:javax.management.MBeanException :尝试调用操作startApplication时在RequiredModelMBean中抛出异常       at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1304)       在javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:1093)       at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:832)       at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.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)       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56)       在java.lang.reflect.Method.invoke(Method.java:620)       at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:88)       at sun.reflect.GeneratedMethodAccessor31.invoke(Unknown Source)       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56)       在java.lang.reflect.Method.invoke(Method.java:620)       at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:292)       在javax.management.modelmbean.RequiredModelMBean $ 4.run(RequiredModelMBean.java:1261)       在java.security.AccessController.doPrivileged(AccessController.java:422)       at java.security.ProtectionDomain $ 1.doIntersectionPrivilege(ProtectionDomain.java:88)       在javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1255)       在javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:1093)       at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:832)       at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.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.connector.AdminServiceDelegator.invoke(AdminServiceDelegator.java:181)       at sun.reflect.GeneratedMethodAccessor38.invoke(Unknown Source)       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56)       在java.lang.reflect.Method.invoke(Method.java:620)       在com.ibm.ws.management.connector.soap.SOAPConnector.invoke(SOAPConnector.java:488)       在com.ibm.ws.management.connector.soap.SOAPConnector.service(SOAPConnector.java:324)       在com.ibm.ws.management.connector.soap.SOAPConnection.handleRequest(SOAPConnection.java:65)       在com.ibm.ws.http.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.RuntimeError:com.ibm.websphere.csi.EJBContainerException:EJB Timer Service未启动       在com.ibm.ws.ejbcontainer.runtime.AbstractEJBRuntime.startModule(AbstractEJBRuntime.java:731)       在com.ibm.ws.ejbcontainer.runtime.SharedEJBRuntimeImpl.startModule(SharedEJBRuntimeImpl.java:338)       在com.ibm.ws.runtime.component.EJBContainerImpl.start(EJBContainerImpl.java:3588)       在com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1179)       at 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)       at 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(CompositionUnitMgrImpl.java:435)       在com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)       在com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:378)       在com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access $ 500(CompositionUnitMgrImpl.java:126)       在com.ibm.ws.runtime.component.CompositionUnitMgrImpl $ 1.run(CompositionUnitMgrImpl.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(CompositionUnitMgrImpl.java:667)       在com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:611)       在com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1271)       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56)       在java.lang.reflect.Method.invoke(Method.java:620)       at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:88)       at sun.reflect.GeneratedMethodAccessor31.invoke(Unknown Source)       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56)       在java.lang.reflect.Method.invoke(Method.java:620)       at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:292)       在javax.management.modelmbean.RequiredModelMBean $ 4.run(RequiredModelMBean.java:1261)       在java.security.AccessController.doPrivileged(AccessController.java:422)       at java.security.ProtectionDomain $ 1.doIntersectionPrivilege(ProtectionDomain.java:88)       在javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1255)       ......还有38个   引起:com.ibm.websphere.csi.EJBContainerException:EJB Timer Service未启动       在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(WASEJBRuntimeImpl.java:540)       在com.ibm.ws.ejbcontainer.runtime.AbstractEJBRuntime.startModule(AbstractEJBRuntime.java:575)       ......还有71个   引起:com.ibm.ws.scheduler.exception.SchedulerDataStoreException:com.ibm.ws.extensionhelper.exception.UnknownDatabaseException:无法检测数据库供应商。供应商字符串是PostgreSQL       在com.ibm.ws.scheduler.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.UnknownDatabaseException:无法检测数据库供应商。供应商字符串是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(ExtensionHelperServiceImpl.java:116)       在com.ibm.ws.scheduler.DBHelperImpl。(DBHelperImpl.java:108)       在com.ibm.ws.scheduler.WASSchedulerCfgHelper.getDatabaseHelper(WASSchedulerCfgHelper.java:959)       在com.ibm.ws.scheduler.WASSchedulerCfgHelper.createTables(WASSchedulerCfgHelper.java:541)       ......还有76个

[10/3/17 16:19:42:601 IDT] 00000067 ServletWrappe

我认为在摆脱IBM调度程序并移动EJB标准Timer后,我不会得到此异常。

任何想法我怎么能克服这个?

1 个答案:

答案 0 :(得分:1)

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

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

也就是说,您可能能够让PostgreSQL在WebSphere Application Server Liberty上使用EJB Persistent Timers(而不是传统),因为Liberty实现是基于JPA而不是SQL构建的。