2 Replies Latest reply on Mar 10, 2016 12:15 PM by Matt Hempleman

    Wildfly migration 8 to 9 - Postgresql ping database failed

    Matt Hempleman Newbie

      Hi all,

       

      I'm in the process of migrating a webapp from Wildfly 8 to 9.  It's been a relatively smooth transition; however, I'm having an issue with my postgres db connection.  When I boot the server, I'm getting an error message (see trace below) saying the db cannot be pinged because:  java.lang.NoSuchMethodException: org.postgresql.jdbc4.Jdbc4Connection.pingDatabase().  That method definitely does exist.  I've tried two different postgres drivers (9.4-1201-jdbc41 & 9.4-1206-jdbc42) and I get the error either way.  I googled around but couldn't find any similar issues.  I obviously never had this issue with Wildfly 8.2.  Any idea why this is happening?  Thanks.

       

      Wildfly 9.1.0

      Spring 4.1.8

      Postgres 9.4.5

      Hibernate 3.6.1

       

      19:41:35,044 WARN  [org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory] (ServerService Thread Pool -- 75) IJ030027: Destroying connection that is not valid, due to the following exception: org.postgresql.jdbc4.Jdbc4Connection@436eaf88: java.sql.SQLException: pingDatabase failed

          at org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker.isValidConnection(OracleValidConnectionChecker.java:72) [ironjacamar-jdbc-1.2.4.Final.jar:1.2.4.Final]

          at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnectionFactory.isValidConnection(BaseWrapperManagedConnectionFactory.java:1264) [ironjacamar-jdbc-1.2.4.Final.jar:1.2.4.Final]

          at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.checkValid(BaseWrapperManagedConnection.java:512) [ironjacamar-jdbc-1.2.4.Final.jar:1.2.4.Final]

          at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnectionFactory.getInvalidConnections(BaseWrapperManagedConnectionFactory.java:1073) [ironjacamar-jdbc-1.2.4.Final.jar:1.2.4.Final]

          at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.getConnection(SemaphoreArrayListManagedConnectionPool.java:374)

          at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getSimpleConnection(AbstractPool.java:622)

          at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getConnection(AbstractPool.java:594)

          at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getManagedConnection(AbstractConnectionManager.java:579)

          at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.getManagedConnection(TxConnectionManagerImpl.java:430)

          at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:737)

          at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:138) [ironjacamar-jdbc-1.2.4.Final.jar:1.2.4.Final]

          at org.jboss.as.connector.subsystems.datasources.WildFlyDataSource.getConnection(WildFlyDataSource.java:67)

          at com.etp.commons.persistence.jdbc.DDLUtil.tableExists(DDLUtil.java:130) [commons-persistence-3.0.1-SNAPSHOT.jar:]

          at com.etp.commons.persistence.environment.EmptySchemaChecker.afterPropertiesSet(EmptySchemaChecker.java:17) [commons-persistence-3.0.1-SNAPSHOT.jar:]

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1631) [spring-beans-4.1.8.RELEASE.jar:4.1.8.RELEASE]

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1568) [spring-beans-4.1.8.RELEASE.jar:4.1.8.RELEASE]

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539) [spring-beans-4.1.8.RELEASE.jar:4.1.8.RELEASE]

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) [spring-beans-4.1.8.RELEASE.jar:4.1.8.RELEASE]

          at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303) [spring-beans-4.1.8.RELEASE.jar:4.1.8.RELEASE]

          at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) [spring-beans-4.1.8.RELEASE.jar:4.1.8.RELEASE]

          at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299) [spring-beans-4.1.8.RELEASE.jar:4.1.8.RELEASE]

          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) [spring-beans-4.1.8.RELEASE.jar:4.1.8.RELEASE]

          at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755) [spring-beans-4.1.8.RELEASE.jar:4.1.8.RELEASE]

          at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:759) [spring-context-4.1.8.RELEASE.jar:4.1.8.RELEASE]

          at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480) [spring-context-4.1.8.RELEASE.jar:4.1.8.RELEASE]

          at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:434) [spring-web-4.1.8.RELEASE.jar:4.1.8.RELEASE]

          at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306) [spring-web-4.1.8.RELEASE.jar:4.1.8.RELEASE]

          at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106) [spring-web-4.1.8.RELEASE.jar:4.1.8.RELEASE]

          at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:173) [undertow-servlet-1.2.9.Final.jar:1.2.9.Final]

          at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:195) [undertow-servlet-1.2.9.Final.jar:1.2.9.Final]

          at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:100)

          at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)

          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [rt.jar:1.8.0_71]

          at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_71]

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_71]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_71]

          at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_71]

          at org.jboss.threads.JBossThread.run(JBossThread.java:320)

      Caused by: java.lang.NoSuchMethodException: org.postgresql.jdbc4.Jdbc4Connection.pingDatabase()

          at java.lang.Class.getMethod(Class.java:1786) [rt.jar:1.8.0_71]

          at org.jboss.jca.adapters.jdbc.extensions.oracle.SecurityActions.getMethod(SecurityActions.java:144) [ironjacamar-jdbc-1.2.4.Final.jar:1.2.4.Final]

          at org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker.isValidConnection(OracleValidConnectionChecker.java:61) [ironjacamar-jdbc-1.2.4.Final.jar:1.2.4.Final]

          ... 37 more