Announcement Announcement Module
Collapse
No announcement yet.
tcServer-6.0 and c3p0-0.9.1.2.jar Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • tcServer-6.0 and c3p0-0.9.1.2.jar

    Trying to use Spring Insight w/ tcServer-6.0, but I cannot get my application war to deploy within tcServer.

    The same war deploys and runs fine with Tomcat 6.0.20.0.

    My app uses c3p0-0.9.1.2.jar with which tcServer seems to be having a problem ..

    Code:
    Exception in thread "Resource Destroyer in BasicResourcePool.close()" java.lang.NoClassDefFoundError: com/mchange/v2/resourcepool/BasicResourcePool$1DestroyResourceTask
            at com.mchange.v2.resourcepool.BasicResourcePool.destroyResource(BasicResourcePool.java:980)
            at com.mchange.v2.resourcepool.BasicResourcePool.access$100(BasicResourcePool.java:32)
            at com.mchange.v2.resourcepool.BasicResourcePool$5.run(BasicResourcePool.java:1174)
    Caused by: java.lang.ClassNotFoundException: com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask
            at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1384)
            at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1230)
            at java.lang.ClassLoader.loadClassInternal(Unknown Source)
            ... 3 more
    I see the c3p0 classes getting loaded (in the log as shown below),
    Code:
    2009-11-04 16:02:35,063 - INFO  [main]: MLog clients using log4j logging.
    2009-11-04 16:02:35,348 - INFO  [main]: Initializing c3p0-0.9.1.2 [built 21-May-2007 15:04:56; debug? true; trace: 10]
    2009-11-04 16:02:40,105 - INFO  [main]: Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 1, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 1bqtqak841hjvtnb1qeq5mp|129552, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1bqtqak841hjvtnb1qeq5mp|129552, idleConnectionTestPeriod -> 900, initialPoolSize -> 5, jdbcUrl -> ******, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 14400, maxIdleTimeExcessConnections -> 1800, maxPoolSize -> 10, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 5, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> select count(*) from menu_info, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> true, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ]
    also the class is present in the jar
    Code:
    $ jar tvf WEB-INF/lib/c3p0-0.9.1.2.jar | grep Basic | grep Destr
      2009 Mon May 21 15:05:02 EDT 2007 com/mchange/v2/resourcepool/BasicResourcePool$1DestroyResourceTask.class
    What could be going wrong here ?

  • #2
    Can you try to disable Insight and check if the problem still persists. A quick way would be to comment out the following line in <INSTNACE_DIR>/conf/context.xml:

    Code:
        <Loader loaderClass="com.springsource.tcserver.ltw.TomcatAspectJWeavingClassLoader" useSystemClassLoaderAsParent="false"/>
    Another way would be to create a tcServer instance without the Insight template and deploying the war to it.

    -Ramnivas

    Comment


    • #3
      Thank you for the reply Ramnivas.

      Disabling Insight (by commenting the TomcatAspectJWeavingClassLoader line) makes no difference (I still get the same error).

      Creating a new plain tcServer instance and deploying the war to it gives a slightly different error ..

      Code:
      2009-11-04 17:35:02,772 - WARN  [Resource Destroyer in BasicResourcePool.close()]: Failed to destroy resource: com.mchange.v2.c3p0.impl.NewPooledConnection@e76438
      java.lang.NullPointerException
              at com.mchange.v2.log.log4j.Log4jMLog$Log4jMLogger.isLoggable(Log4jMLog.java:257)
              at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:486)
              at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:964)
              at com.mchange.v2.resourcepool.BasicResourcePool.destroyResource(BasicResourcePool.java:989)
              at com.mchange.v2.resourcepool.BasicResourcePool.access$100(BasicResourcePool.java:32)
              at com.mchange.v2.resourcepool.BasicResourcePool$5.run(BasicResourcePool.java:1174)
      2009-11-04 17:35:02,862 - WARN  [Resource Destroyer in BasicResourcePool.close()]: Failed to destroy resource: com.mchange.v2.c3p0.impl.NewPooledConnection@1faf3f4
      java.lang.NullPointerException
              at com.mchange.v2.log.log4j.Log4jMLog$Log4jMLogger.isLoggable(Log4jMLog.java:257)
              at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:486)
              at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:964)
              at com.mchange.v2.resourcepool.BasicResourcePool.destroyResource(BasicResourcePool.java:989)
              at com.mchange.v2.resourcepool.BasicResourcePool.access$100(BasicResourcePool.java:32)
              at com.mchange.v2.resourcepool.BasicResourcePool$5.run(BasicResourcePool.java:1174)
      2009-11-04 17:35:02,863 - WARN  [Resource Destroyer in BasicResourcePool.close()]: Failed to destroy resource: com.mchange.v2.c3p0.impl.NewPooledConnection@a638fc
      java.lang.NullPointerException
              at com.mchange.v2.log.log4j.Log4jMLog$Log4jMLogger.isLoggable(Log4jMLog.java:257)
              at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:486)
              at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:964)
              at com.mchange.v2.resourcepool.BasicResourcePool.destroyResource(BasicResourcePool.java:989)
              at com.mchange.v2.resourcepool.BasicResourcePool.access$100(BasicResourcePool.java:32)
              at com.mchange.v2.resourcepool.BasicResourcePool$5.run(BasicResourcePool.java:1174)
      2009-11-04 17:35:02,863 - WARN  [Resource Destroyer in BasicResourcePool.close()]: Failed to destroy resource: com.mchange.v2.c3p0.impl.NewPooledConnection@493dca
      java.lang.NullPointerException
              at com.mchange.v2.log.log4j.Log4jMLog$Log4jMLogger.isLoggable(Log4jMLog.java:257)
              at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:486)
              at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:964)
              at com.mchange.v2.resourcepool.BasicResourcePool.destroyResource(BasicResourcePool.java:989)
              at com.mchange.v2.resourcepool.BasicResourcePool.access$100(BasicResourcePool.java:32)
              at com.mchange.v2.resourcepool.BasicResourcePool$5.run(BasicResourcePool.java:1174)
      2009-11-04 17:35:02,901 - WARN  [Resource Destroyer in BasicResourcePool.close()]: Failed to destroy resource: com.mchange.v2.c3p0.impl.NewPooledConnection@687ae0
      java.lang.NullPointerException
              at com.mchange.v2.log.log4j.Log4jMLog$Log4jMLogger.isLoggable(Log4jMLog.java:257)
              at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:486)
              at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:964)
              at com.mchange.v2.resourcepool.BasicResourcePool.destroyResource(BasicResourcePool.java:989)
              at com.mchange.v2.resourcepool.BasicResourcePool.access$100(BasicResourcePool.java:32)
              at com.mchange.v2.resourcepool.BasicResourcePool$5.run(BasicResourcePool.java:1174)
      and in catalina.out, it prints:
      Code:
      log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository
      Last edited by sachinambe; Nov 4th, 2009, 05:43 PM.

      Comment


      • #4
        When do you get those errors? It seems as those errors would happen on an undeploy rather during the actual deploy phase of an application.

        Maybe we can get more of the logs, or the entire logs from a clean run.


        You can try tinkle with the Tomcat setting
        org.apache.catalina.loader. WebappClassLoader.ENABLE_CLEAR_REFERENCES

        Documented here:
        http://tomcat.apache.org/tomcat-6.0-...stemprops.html


        Clean run:
        Stop the Tomcat instance
        Delete or archive all log files
        Start Tomcat
        Run your scenario
        Zip up the conf and logs directories

        best
        Filip

        Comment


        • #5
          Thanks Filip. The errors are on startup (I too was puzzled - it's almost as if some other error is causing an undeploy, but it won't show up in any of the logs).

          Attached are the conf & logs from a clean start and also after a stop (you'll see I get a different javax.faces.FacesException when it is stopped). Also in the logs directory, the file webui.log is the log4j application log (wherein you'll see the com.mchange.v2. errors).

          Btw, these are from the plain tcServer instance (without insight).

          I'll try the ENABLE_CLEAR_REFERENCES setting shortly.

          Comment


          • #6
            Both logs are from the container startup phase.
            The container completes startup at:
            Nov 5, 2009 7:30:16 AM
            {quote}
            Nov 5, 2009 7:30:15 AM org.apache.catalina.core.StandardContext listenerStart
            SEVERE: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
            javax.faces.FacesException: Can't parse configuration file:jar:file:/export/home/medadmin/tcServer-6.0/test/webapps/ed/WEB-INF/lib/jsf-impl.jar!/com/sun/faces/jsf-ri-runtime.xml
            at com.sun.faces.config.ConfigureListener.parse(Confi gureListener.java:1224)
            {quote}

            This is a application startup error, Tomcat aborts the application startup here. There is a ContextListener configured in web.xml, and since this listener throws an error the application never deploys.

            I would go after the JSF error first, as anything after it can simply be a result of the previous error.

            best
            Filip

            Comment


            • #7
              Just catching up on this ..

              The faces error message is part of the startup, but it was getting flushed to the log only after I initiated a stop on the instance (hence it gave me the impression that it was on shutdown). Thanks for including the timestamp in your message.

              Back to the original problem, it looks like I need a different SAXParserFactory set in Tomcat, I'll post back once I resolve that issue (I think that should get rid of the FacesException).

              Comment


              • #8
                Just posting back to say the problem was resolved by setting the property javax.xml.parsers.SAXParserFactory=org.apache.xerc es.jaxp.SAXParserFactoryImpl
                in catalina.properties (and including xercesImpl.jar in lib).

                The app now deploys successfully in regular tcServer as well as an insight instance.

                I still have the logfile buffering issue in catalina.out (messages after app start appear only after stop in the logfile), but at this point I am not bothered with it.

                Now to the fun part - analyzing the performance of my JDBC queries and JSPs using Insight Looks like it's a great tool, by the way !

                Thank you for the pointers Filip and Ramnivas.

                -- Sachin Ambe.

                Comment

                Working...
                X