0
votes

I have a Java application running and tested on my development workstation running Apache Tomcat 8. I have an established IBM i (AS/400) database connection working locally using the JT400.jar file. When I build and deploy the application to our production server running Apache Tomcat 8 with the same JT400.jar file, the database connection seems to fail and I cannot figure out why.

I get the following "HTTP Status 500 - Servlet execution threw an exception" error:

<code>
java.lang.AbstractMethodError
org.apache.tomcat.dbcp.dbcp2.DelegatingConnection.isValid(DelegatingConnection.java:913)
org.apache.tomcat.dbcp.dbcp2.PoolableConnection.validate(PoolableConnection.java:218)
org.apache.tomcat.dbcp.dbcp2.PoolableConnectionFactory.validateConnection(PoolableConnectionFactory.java:302)
org.apache.tomcat.dbcp.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:2164)
org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2147)
org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:1902)
org.apache.tomcat.dbcp.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1412)
utilities.SerialSearch.doSearch(SerialSearch.java:81)
processes.ProcessScan.getSerialScreenDetail(ProcessScan.java:66)
processes.ProcessScan.ProcessScanRequest(ProcessScan.java:103)
controller.MetricServlet.performTask(MetricServlet.java:145)
controller.MetricServlet.doPost(MetricServlet.java:43)
javax.servlet.http.HttpServlet.service(HttpServlet.java:644)
javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
</code>

What is different and how do I resolve the issue?

Thanks!

2

2 Answers

1
votes

I had the same error while using the current latest version (as of today 9.3).

The problem was that I was using the JDK 8, and using maven to fetch the package I received a version that was not appropriate for this JDK.

To solve this problem I used the proper maven qualifier:

    <dependency>
        <groupId>net.sf.jt400</groupId>
        <artifactId>jt400</artifactId>
        <version>9.3</version>
        <classifier>jt400_jdk8</classifier>
    </dependency>

Note that if you download the zip with the full suite, all version of the jar do have the same name (i.e. jt400.jar) which makes them hard to distinguish.

0
votes

Problem solved. Rookie mistake. I inadvertently left the old jt400 jar files in the lib folder on the Apache Tomcat 8 server by renaming them. Once I deleted the old jar files my issues were solved with the new jt400 jar that I installed last week that started the conflict to begin with. Thanks!