Search code examples
exceptionjbossibm-midrange

Exception that I can not understand : java.lang.ClassNotFoundException: com.ibm.as400.access.ConnectionPoolException


I am getting a weird exception which is :

JBWEB000289: Servlet InitServlet threw load() exception:
java.lang.ClassNotFoundException:
com.ibm.as400.access.ConnectionPoolException

This happens when ever the class that I used ConnectionPoolException class is initialized.

I am running this project on JBoss eap 6.4 with java 1.7 sun jdk.

I have a globals.java class (as400manager.jar -> which is an other project and added as dependency to others) which prepares as400 connections for me. And also that I used to return Connect objects.

Issue is when I try to use a function inside this class it works, but when I try to use its getInstance method which prepares a Connect object and returns, I get this exception.

Here is the place I call my Globals Class get instance method :

    public PRCConnect(KYSAuthType auth) {
       this.auth = auth;
       g = Globals.getInstance();
    }

Here is the getInstance Method :

    public static Globals getInstance() {
       return instance;
    }

It does not even come to return instance line. Just throws the exception and goes away.

Globals class is a part of an other project that I build to use for common purposes related to as400 databases. it is in as400manager.

I have jt400-9.3.jar as a dependency in my pom.xml and that class is there for sure. There is no error related to that in any other application.

Here is the full error trace :

        17:37:33,485 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/CommonsApp]] (ServerService Thread Pool -- 55) JBWEB000289: Servlet InitServlet threw load() exception: java.lang.ClassNotFoundException: com.ibm.as400.access.ConnectionPoolException from [Module "deployment.CommonsApp.ear.CommonsAppWeb.war:main" from Service Module Loader]
            at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.6.Final-redhat-1]
            at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.6.Final-redhat-1]
            at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.6.Final-redhat-1]
            at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.6.Final-redhat-1]
            at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.6.Final-redhat-1]
            at com.BBBBBBBB.as400.process.PRCConnect.<init>(PRCConnect.java:31) [AS400Manager.jar:]
            at com.BBBBBBBB.as400.operation.KYSServisInitPort.connect(KYSServisInitPort.java:36) [AS400Manager.jar:]
            at com.BBBBBBBB.servis.util.shell.ShellFactory.getKYSAuthType(ShellFactory.java:456) [classes:]
            at com.BBBBBBBB.servis.util.shell.ShellFactory.getKYSAuthType(ShellFactory.java:437) [classes:]
            at com.BBBBBBBB.servis.data.StaticTable.loadStaticTables(StaticTable.java:642) [classes:]
            at com.BBBBBBBB.servis.util.InitServlet.statikTablolar(InitServlet.java:374) [classes:]
            at com.BBBBBBBB.servis.util.InitServlet.load(InitServlet.java:295) [classes:]
            at com.BBBBBBBB.servis.util.InitServlet.init(InitServlet.java:269) [classes:]
            at javax.servlet.GenericServlet.init(GenericServlet.java:242) [jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-2.jar:1.0.2.Final-redhat-2]
            at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1194) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
            at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1100) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
            at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3593) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
            at org.apache.catalina.core.StandardContext.start(StandardContext.java:3802) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
            at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:163) [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
            at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:61) [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
            at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:96) [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_80]
            at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_80]
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_80]
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_80]
            at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_80]
            at org.jboss.threads.JBossThread.run(JBossThread.java:122)

What I am expecting is to get the connect object and go further and run my queries and so on.

I do not want to change my code too much cause this is an old project and there are a lot of places using it.

Thanks in advance.


Solution

  • The problem has solved after redeploying with maven . Jar was not updated from the code after the last changes. It looks like this was the issue