View Issue Details

IDProjectCategoryView StatusLast Update
0003983SymmetricDSBugpublic2019-05-30 15:43
Reporterei99045Assigned To 
Prioritynormal 
Status newResolutionopen 
Product Version3.6.2 
Target VersionFixed in Version 
Summary0003983: PostgresBulkDatabaseWriter can't unwrap DBCP2 connection in tomcat 8
DescriptionWe include symmetricds in our own web application. It has been running fine on tomcat7 with java7 since 2014.
We are now trying to deploy the same web application in tomcat8 (for now, still with java7), but we're hitting a NPE in symmetric code when the PostgresBulkDatabaseWriter is used.
The stacktrace appears to suggest a problem unwrapping the jdbc connection provided by the application server into the native Postgres connection. Since tomcat8 ships with Apache Commons DBCP2 instead of the old DBCP used in tomcat7 I suspect that might be the problem.
Stack trace included in additional info.
Additional Information2019-05-30 11:34:23,815 [ERROR] impl.DataLoaderService Failed to load batch 000-341 because: org.apache.tomcat.dbcp.dbcp2.PoolingDataSource$PoolGuardConnectionWrapper cannot be cast to org.postgresql.core.BaseConnection
org.jumpmind.db.sql.SqlException: org.apache.tomcat.dbcp.dbcp2.PoolingDataSource$PoolGuardConnectionWrapper cannot be cast to org.postgresql.core.BaseConnection
        at org.jumpmind.db.sql.AbstractSqlTemplate.translate(AbstractSqlTemplate.java:288)
        at org.jumpmind.db.sql.AbstractSqlTemplate.translate(AbstractSqlTemplate.java:279)
        at org.jumpmind.symmetric.io.data.writer.PostgresBulkDatabaseWriter.open(PostgresBulkDatabaseWriter.java:136)
        at org.jumpmind.symmetric.io.data.writer.NestedDataWriter.open(NestedDataWriter.java:44)
        at org.jumpmind.symmetric.model.ProcessInfoDataWriter.open(ProcessInfoDataWriter.java:40)
        at org.jumpmind.symmetric.io.data.writer.NestedDataWriter.open(NestedDataWriter.java:44)
        at org.jumpmind.symmetric.io.data.DataProcessor.process(DataProcessor.java:103)
        at org.jumpmind.symmetric.service.impl.DataLoaderService$LoadIntoDatabaseOnArrivalListener.end(DataLoaderService.java:802)
        at org.jumpmind.symmetric.io.data.writer.StagingDataWriter.notifyEndBatch(StagingDataWriter.java:75)
        at org.jumpmind.symmetric.io.data.writer.AbstractProtocolDataWriter.end(AbstractProtocolDataWriter.java:220)
        at org.jumpmind.symmetric.io.data.DataProcessor.process(DataProcessor.java:129)
        at org.jumpmind.symmetric.service.impl.DataLoaderService.loadDataFromTransport(DataLoaderService.java:431)
        at org.jumpmind.symmetric.service.impl.DataLoaderService.loadDataFromPush(DataLoaderService.java:345)
        at org.jumpmind.symmetric.web.PushUriHandler.push(PushUriHandler.java:79)
        at org.jumpmind.symmetric.web.PushUriHandler.handle(PushUriHandler.java:66)
        at org.jumpmind.symmetric.web.SymmetricServlet.service(SymmetricServlet.java:98)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:565)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:479)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:965)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
        at org.eclipse.jetty.server.Server.handle(Server.java:348)
        at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:452)
        at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:894)
        at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:948)
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:851)
        at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
        at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:606)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:46)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:603)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:538)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp2.PoolingDataSource$PoolGuardConnectionWrapper cannot be cast to org.postgresql.core.BaseConnection
        at org.jumpmind.symmetric.io.data.writer.PostgresBulkDatabaseWriter.open(PostgresBulkDatabaseWriter.java:134)
        ... 37 more
Tagsbulk, dialect: postgresql

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2019-05-30 07:39 ei99045 New Issue
2019-05-30 15:42 elong Tag Attached: dialect: postgresql
2019-05-30 15:43 elong Tag Attached: bulk