Opened 2 months ago

Closed 2 weeks ago

#2366 closed defect (fixed)

52NorthSOS fails to launch

Reported by: sanak Owned by: osgeolive@…
Priority: critical Milestone: OSGeoLive15.0
Component: OSGeoLive Keywords: 52North
Cc: osgeolive@…

Description

From /var/log/tomcat9/52n-sos-webapp.log.

2022-06-18 22:35:56,764 ERROR [main] [SqlExceptionHelper.java:146] Connections could not be acquired from the underlying database!
2022-06-18 22:35:56,769 ERROR [main] [UnspecifiedSessionFactoryProvider.java:157] An error occurs during instantiation of the database connection pool!
org.hibernate.exception.GenericJDBCException: Could not open connection
	at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:54)
	at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:126)
	at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:112)
	at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:235)
	at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.getConnection(LogicalConnectionImpl.java:171)
	at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.coordinateWork(JdbcCoordinatorImpl.java:311)
	at org.hibernate.internal.SessionImpl.doWork(SessionImpl.java:2095)
	at org.hibernate.internal.SessionImpl.doWork(SessionImpl.java:2080)
	at org.n52.sos.ds.hibernate.UnspecifiedSessionFactoryProvider.initialize(UnspecifiedSessionFactoryProvider.java:146)
	at org.n52.sos.service.Configurator.initializeConnectionProviders(Configurator.java:625)
	at org.n52.sos.service.Configurator.initialize(Configurator.java:326)
	at org.n52.sos.service.Configurator.createInstance(Configurator.java:150)
	at org.n52.sos.service.SosContextListener.instantiateConfigurator(SosContextListener.java:169)
	at org.n52.sos.service.SosContextListener.instantiateConfigurator(SosContextListener.java:158)
	at org.n52.sos.service.SosContextListener.contextInitialized(SosContextListener.java:69)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4768)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5230)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:698)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:696)
	at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1024)
	at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1911)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
	at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
	at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:825)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:475)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1618)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:319)
	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
	at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
	at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366)
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:946)
	at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
	at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)
	at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
	at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
	at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:927)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:772)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:480)
Caused by: java.sql.SQLException: Connections could not be acquired from the underlying database!
	at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:118)
	at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:692)
	at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:140)
	at org.hibernate.c3p0.internal.C3P0ConnectionProvider.getConnection(C3P0ConnectionProvider.java:90)
	at org.hibernate.internal.AbstractSessionImpl$NonContextualJdbcConnectionAccess.obtainConnection(AbstractSessionImpl.java:380)
	at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:228)
	... 52 common frames omitted
Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
	at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1469)
	at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:644)
	at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:554)
	at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutAndMarkConnectionInUse(C3P0PooledConnectionPool.java:758)
	at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:685)
	... 56 common frames omitted
Caused by: org.postgresql.util.PSQLException: SCRAM authentication is not supported by this driver. You need JDK >= 8 and pgjdbc >= 42.2.0 (not ".jre" vesions)
	at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:623)
	at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:205)
	at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
	at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:195)
	at org.postgresql.Driver.makeConnection(Driver.java:452)
	at org.postgresql.Driver.connect(Driver.java:254)
	at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:175)
	at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:220)
	at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:206)
	at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:203)
	at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1138)
	at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1125)
	at com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44)
	at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1870)
	at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696)

There are warning before above error.

2022-06-18 22:35:56,761 WARN [C3P0PooledConnectionPoolManager[identityToken->z8kfsxapxsrajw1cs5u4|5733fb1d]-HelperThread-#1] [BasicResourcePool.java:1911] com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@2269c95d -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: 
org.postgresql.util.PSQLException: SCRAM authentication is not supported by this driver. You need JDK >= 8 and pgjdbc >= 42.2.0 (not ".jre" vesions)
	at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:623)
	at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:205)
	at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
	at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:195)
	at org.postgresql.Driver.makeConnection(Driver.java:452)
	at org.postgresql.Driver.connect(Driver.java:254)
	at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:175)
	at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:220)
	at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:206)
	at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:203)
	at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1138)
	at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1125)
	at com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44)
	at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1870)
	at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696)
2022-06-18 22:35:56,761 WARN [C3P0PooledConnectionPoolManager[identityToken->z8kfsxapxsrajw1cs5u4|5733fb1d]-HelperThread-#1] [BasicResourcePool.java:946] Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@185efb0e is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests.
2022-06-18 22:35:56,763 WARN [main] [SqlExceptionHelper.java:144] SQL Error: 0, SQLState: null

Attachments (2)

52n-sos-webapp.log (129.2 KB ) - added by sanak 2 months ago.
52NorthSOS-new-error.png (217.1 KB ) - added by sanak 3 weeks ago.

Download all attachments as: .zip

Change history (12)

by sanak, 2 months ago

Attachment: 52n-sos-webapp.log added

comment:1 by kalxas, 8 weeks ago

Cc: osgeolive@… added
Priority: normalmajor

comment:2 by kalxas, 8 weeks ago

Priority: majorcritical

comment:3 by sanak, 7 weeks ago

From the following error,

org.postgresql.util.PSQLException: SCRAM authentication is not supported by this driver.
You need JDK >= 8 and pgjdbc >= 42.2.0 (not ".jre" vesions)

source code's postgresql jdbc version needs to be updated without ".jre".
https://github.com/52North/SOS/blob/v4.4.3/pom.xml#L65

        <postgresql.version>42.2.2.jre7</postgresql.version>

But, to solve this issue, 52 North cooperation seems to be necessary, because currently, the war file seems to come from 52 North site.
https://github.com/OSGeo/OSGeoLive/blob/master/bin/install_52nSOS.sh#L50-L51

SOS_TAR_NAME="52n-sos-osgeo-live-4.4.3.tar.gz"
SOS_TAR_URL="https://52north.org/files/sensorweb/osgeo-live/"

comment:5 by sanak, 3 weeks ago

Thanks for update.

I tried beta1 vmdk image and confirmed that the original description issue (You need JDK >= 8 and pgjdbc >= 42.2.0 (not ".jre" vesions)) was solved, but the following new error occurred.

 java.lang.UnsupportedClassVersionError: org/eclipse/jdt/internal/compiler/env/INameEnvironment 
has been compiled by a more recent version of the Java Runtime (class file version 55.0), 
this version of the Java Runtime only recognizes class file versions up to 52.0

I am not familiar with Java, but the error message seems to be quite similar with #2379.

by sanak, 3 weeks ago

Attachment: 52NorthSOS-new-error.png added

comment:6 by kalxas, 2 weeks ago

I am now trying to compile tomcat9 with Java 8 in order to fix this issue.

comment:7 by kalxas, 2 weeks ago

Bad news, tomcat9 fails to compile with Java 8, we need to compile the following eclipse stack:

Source: eclipse-jdt-core
Section: java
Priority: optional
Maintainer: Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org>
Uploaders: Emmanuel Bourg <ebourg@apache.org>
Build-Depends:
 debhelper (>= 11),
 default-jdk,
 ant,
 libeclipse-core-filesystem-java,
 libeclipse-core-contenttype-java,
 libeclipse-core-jobs-java,
 libeclipse-core-runtime-java,
 libeclipse-core-resources-java,
 libeclipse-text-java,
 libeclipse-osgi-java,
 libequinox-app-java,
 libequinox-common-java,
 libequinox-preferences-java,
 libequinox-registry-java,
 eclipse-debian-helper
Standards-Version: 4.3.0
Vcs-Git: https://salsa.debian.org/java-team/eclipse-jdt-core.git
Vcs-Browser: https://salsa.debian.org/java-team/eclipse-jdt-core
Homepage: https://www.eclipse.org/jdt/core/

comment:9 by kalxas, 2 weeks ago

I have created ticket #2387 to track progress on Java 8 + Tomcat 9 issue.

comment:10 by kalxas, 2 weeks ago

Resolution: fixed
Status: newclosed

Confirmed fixed after testing the following patch in beta 1 VM:

https://github.com/OSGeo/OSGeoLive/commit/43773534c829b4ab14949b051e038672314e5906

Note: See TracTickets for help on using tickets.