Search code examples
javapostgresqlweb-servicesejbwebsphere

Can't configure EJB Timers with PostgreSQL on Websphere


I have an app deployed on Websphere container and configured the EJB Timer scheduler through the container.

I have an oracle DB configured and all is working smoothly.

Now i'm trying to change the DB from Oracle to postgres SQL and did all the needed work including creating new data source, drivers, etc. The Websphere did managed to connect to the DB through the Datasource. I'm Using the same Jndi as i had with my oracle db so no extra work needed in the code.

When i'm trying to start the application and install new EAR file i'm getting the following exception:

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: Exception thrown in RequiredModelMBean while trying to invoke operation startApplication at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1304) at 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) at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1350) at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118) at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1243) at com.ibm.ws.management.application.AppManagementImpl._startApplication(AppManagementImpl.java:1482) at com.ibm.ws.management.application.AppManagementImpl.startApplication(AppManagementImpl.java:1371) at 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) at 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) at java.lang.reflect.Method.invoke(Method.java:620) at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:292) at javax.management.modelmbean.RequiredModelMBean$4.run(RequiredModelMBean.java:1261) at java.security.AccessController.doPrivileged(AccessController.java:422) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:88) at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1255) at 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) at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1350) at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118) at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1243) at 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) at java.lang.reflect.Method.invoke(Method.java:620) at com.ibm.ws.management.connector.soap.SOAPConnector.invoke(SOAPConnector.java:488) at com.ibm.ws.management.connector.soap.SOAPConnector.service(SOAPConnector.java:324) at com.ibm.ws.management.connector.soap.SOAPConnection.handleRequest(SOAPConnection.java:65) at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:733) at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:522) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1892) Caused by: com.ibm.ws.exception.RuntimeError: com.ibm.websphere.csi.EJBContainerException: EJB Timer Service not started at com.ibm.ws.ejbcontainer.runtime.AbstractEJBRuntime.startModule(AbstractEJBRuntime.java:731) at com.ibm.ws.ejbcontainer.runtime.SharedEJBRuntimeImpl.startModule(SharedEJBRuntimeImpl.java:338) at com.ibm.ws.runtime.component.EJBContainerImpl.start(EJBContainerImpl.java:3588) at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1179) at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1390) at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:639) at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:979) at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:778) at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplicationDynamically(ApplicationMgrImpl.java:1381) at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2192) at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:435) at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123) at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:378) at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.java:126) at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$1.run(CompositionUnitMgrImpl.java:653) at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5396) at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5612) at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255) at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:667) at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:611) at 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) at 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) at java.lang.reflect.Method.invoke(Method.java:620) at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:292) at javax.management.modelmbean.RequiredModelMBean$4.run(RequiredModelMBean.java:1261) at java.security.AccessController.doPrivileged(AccessController.java:422) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:88) at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1255) ... 38 more Caused by: com.ibm.websphere.csi.EJBContainerException: EJB Timer Service not started at com.ibm.ws.runtime.component.EJBContainerImpl.getSchedulerInstance(EJBContainerImpl.java:2082) at com.ibm.ws.runtime.component.EJBContainerImpl.initializeTimerService(EJBContainerImpl.java:1827) at com.ibm.ws.runtime.component.WASEJBRuntimeImpl.initializeTimerService(WASEJBRuntimeImpl.java:540) at com.ibm.ws.ejbcontainer.runtime.AbstractEJBRuntime.startModule(AbstractEJBRuntime.java:575) ... 71 more Caused by: com.ibm.ws.scheduler.exception.SchedulerDataStoreException: com.ibm.ws.extensionhelper.exception.UnknownDatabaseException: Could not detect database vendor. Vendor string was PostgreSQL at com.ibm.ws.scheduler.WASSchedulerCfgHelper.createTables(WASSchedulerCfgHelper.java:546) at com.ibm.ws.runtime.component.EJBContainerImpl.createTimerTables(EJBContainerImpl.java:2712) at com.ibm.ws.runtime.component.EJBContainerImpl.getSchedulerInstance(EJBContainerImpl.java:2025) ... 74 more Caused by: com.ibm.ws.extensionhelper.exception.UnknownDatabaseException: Could not detect database vendor. Vendor string was PostgreSQL at com.ibm.ws.extensionhelper.db.impl.DatabaseHelperImpl.connect(DatabaseHelperImpl.java:672) at com.ibm.ws.extensionhelper.db.impl.DatabaseHelperImpl.initialize(DatabaseHelperImpl.java:501) at com.ibm.ws.extensionhelper.db.impl.DatabaseHelperImpl.(DatabaseHelperImpl.java:261) at com.ibm.ws.extensionhelper.impl.ExtensionHelperServiceImpl.getDatabaseHelper(ExtensionHelperServiceImpl.java:116) at com.ibm.ws.scheduler.DBHelperImpl.(DBHelperImpl.java:108) at com.ibm.ws.scheduler.WASSchedulerCfgHelper.getDatabaseHelper(WASSchedulerCfgHelper.java:959) at com.ibm.ws.scheduler.WASSchedulerCfgHelper.createTables(WASSchedulerCfgHelper.java:541) ... 76 more

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

I thought that after getting rid of the IBM scheduler and moving the the EJB standard Timer i won't get this exception.

Any idea how can i overcome this one?


Solution

  • The implementation of EJB Persistent Timers is still backed by a database, so the capability is limited by which database vendors the application server has built-in interoperability with (SQL commands differ greatly across different database vendors). WebSphere Application Server traditional doesn't have have built in interoperability with PostgreSQL for EJB persistent timers (or for its Scheduler), which is why you see the error:

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

    That said, you might be able to get PostgreSQL to work for EJB Persistent Timers on WebSphere Application Server Liberty (as opposed to traditional) because the Liberty implementation is built on JPA rather than SQL.