This is the mail that I have already posted to Hugo Burm as he is somewhat
into hibernate but maybe anyone of you could help me pin point the problem.
I think there is a serious problem with latest version of
hibernate (2.1.3) and cocoon integration. There is some kind of jar problem
that did not occur with 2.1.2. I have attached a exception log. The problem
occurs only with hibernate running in cocoon when you want to use c3p0
connection pooling. When you hit the server the exception gets thrown that you
cannot obtain the connection because it has already been closed.
My tests showed that:
1. The problem does not occur with hibernate built-in pooling (but this one is
unuseable in production environment - at least hibernate web page states that)
2. The problem is not a problem of hibernate itself. I have been able to run
hibernate with c3p0 outside of cocoon and jetty (although all jetty and cocoon
libs were also on the classpath - really strange - maybe jar order on
classpath matters).
3. The problem is not a problem of c3p0 itself. Hibernate 2.1.3 contains a new
version of c3p0 (0.8.4.5) but if you downgrade only hibernate2.jar to 2.1.2
version the problem disapperas.
4. The problem is not database dependent. I have tries both MS SQL Server and
HSQLDB - both do not work with cocoon+hibernate+c3p0.
I use following libraries that are copies to cocoon lib directory:
c3p0-0.8.4.5.jar
cglib-full-2.0.1.jar
commons-dbcp-1.1.jar
commons-pool-1.1.jar
dom4j-1.4.jar
hibernate2.jar
jdbc2_0-stdext.jar
jta.jar
msbase.jar
mssqlserver.jar
msutil.jar
odmg-3.0.jar
The rest needed libraries are already in cocoonlib dir (although versions
differ). Hibernate is using commons collections 2.1 while cocoon uses 3.0 but
this caused no problems with hib2.1.2
My regards
LG
--
__
| / \ | Leszek Gawron // \\
\_\\ //_/ [EMAIL PROTECTED] _\\()//_
.'/()\'. Phone: +48(501)720812 / // \\ \
\\ // recursive: adj; see recursive | \__/ |
STATUS | wrapper | 2004/05/05 20:48:15 | --> Wrapper Started as Console
STATUS | wrapper | 2004/05/05 20:48:16 | Launching a JVM...
INFO | jvm 1 | 2004/05/05 20:48:16 | Wrapper (Version 3.0.5)
INFO | jvm 1 | 2004/05/05 20:48:16 |
INFO | jvm 1 | 2004/05/05 20:48:17 | 20:48:16.721 EVENT Checking Resource aliases
INFO | jvm 1 | 2004/05/05 20:48:17 | 20:48:17.003 EVENT Starting Jetty/4.2.19
INFO | jvm 1 | 2004/05/05 20:48:17 | 20:48:17.018 EVENT Started
ServletHttpContext[/]
INFO | jvm 1 | 2004/05/05 20:48:17 | 20:48:17.018 EVENT Started SocketListener
on 127.0.0.1:9091
INFO | jvm 1 | 2004/05/05 20:48:17 | 20:48:17.018 EVENT Started [EMAIL PROTECTED]
INFO | jvm 1 | 2004/05/05 20:48:17 | 20:48:17.065 EVENT Statistics on = false
for [EMAIL PROTECTED]
INFO | jvm 1 | 2004/05/05 20:48:17 | 20:48:17.065 EVENT Starting Jetty/4.2.19
INFO | jvm 1 | 2004/05/05 20:48:17 | 20:48:17.362 EVENT Started
WebApplicationContext[/,webapp]
INFO | jvm 1 | 2004/05/05 20:48:18 | Initializing c3p0 pool... [EMAIL PROTECTED]
[ connectionPoolDataSource -> [EMAIL PROTECTED] [ acquireIncrement -> 2,
autoCommitOnClose -> false, connectionTesterClassName ->
com.mchange.v2.c3p0.impl.DefaultConnectionTester, factoryClassLocation -> null,
forceIgnoreUnresolvedTransactions -> false, idleConnectionTestPeriod -> 3000,
initialPoolSize -> 1, maxIdleTime -> 5000, maxPoolSize -> 15, maxStatements -> 100,
minPoolSize -> 1, nestedDataSource -> [EMAIL PROTECTED] [ description -> null,
driverClass -> null, factoryClassLocation -> null, jdbcUrl ->
jdbc:microsoft:sqlserver://mainframe;DatabaseName=GeminiBJmefiu;SelectMethod=cursor;SendStringParametersAsUnicode=false,
properties -> {user=sa, password=} ] , propertyCycle -> 300, testConnectionOnCheckout
-> false ] , factoryClassLocation -> null, numHelperThreads -> 3 ]
INFO | jvm 1 | 2004/05/05 20:48:22 | 20:48:22.628 EVENT Started SocketListener
on 0.0.0.0:9090
INFO | jvm 1 | 2004/05/05 20:48:22 | 20:48:22.628 EVENT Started [EMAIL PROTECTED]
INFO | jvm 1 | 2004/05/05 20:48:32 | 20:48:32,065 WARN JDBCExceptionReporter:38
- SQL Error: 0, SQLState: null
INFO | jvm 1 | 2004/05/05 20:48:32 | 20:48:32,065 ERROR JDBCExceptionReporter:46
- [EMAIL PROTECTED] [ connectionPoolDataSource -> [EMAIL PROTECTED] [ acquireIncrement
-> 2, autoCommitOnClose -> false, connectionTesterClassName ->
com.mchange.v2.c3p0.impl.DefaultConnectionTester, factoryClassLocation -> null,
forceIgnoreUnresolvedTransactions -> false, idleConnectionTestPeriod -> 3000,
initialPoolSize -> 1, maxIdleTime -> 5000, maxPoolSize -> 15, maxStatements -> 100,
minPoolSize -> 1, nestedDataSource -> [EMAIL PROTECTED] [ description -> null,
driverClass -> null, factoryClassLocation -> null, jdbcUrl ->
jdbc:microsoft:sqlserver://mainframe;DatabaseName=GeminiBJmefiu;SelectMethod=cursor;SendStringParametersAsUnicode=false,
properties -> {user=sa, password=} ] , propertyCycle -> 300, testConnectionOnCheckout
-> false ] , factoryClassLocation -> null, numHelperThreads -> 3 ] has been closed()
-- you can no longer use it.
INFO | jvm 1 | 2004/05/05 20:48:32 | 20:48:32,081 ERROR JDBCExceptionReporter:38
- Cannot open connection
INFO | jvm 1 | 2004/05/05 20:48:32 | java.sql.SQLException: [EMAIL PROTECTED] [
connectionPoolDataSource -> [EMAIL PROTECTED] [ acquireIncrement -> 2,
autoCommitOnClose -> false, connectionTesterClassName ->
com.mchange.v2.c3p0.impl.DefaultConnectionTester, factoryClassLocation -> null,
forceIgnoreUnresolvedTransactions -> false, idleConnectionTestPeriod -> 3000,
initialPoolSize -> 1, maxIdleTime -> 5000, maxPoolSize -> 15, maxStatements -> 100,
minPoolSize -> 1, nestedDataSource -> [EMAIL PROTECTED] [ description -> null,
driverClass -> null, factoryClassLocation -> null, jdbcUrl ->
jdbc:microsoft:sqlserver://mainframe;DatabaseName=GeminiBJmefiu;SelectMethod=cursor;SendStringParametersAsUnicode=false,
properties -> {user=sa, password=} ] , propertyCycle -> 300, testConnectionOnCheckout
-> false ] , factoryClassLocation -> null, numHelperThreads -> 3 ] has been closed()
-- you can no longer use it.
INFO | jvm 1 | 2004/05/05 20:48:32 | at
com.mchange.v2.c3p0.PoolBackedDataSource.assertCpds(PoolBackedDataSource.java:129)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
com.mchange.v2.c3p0.PoolBackedDataSource.getPoolManager(PoolBackedDataSource.java:141)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
com.mchange.v2.c3p0.PoolBackedDataSource.getConnection(PoolBackedDataSource.java:58)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
net.sf.hibernate.connection.C3P0ConnectionProvider.getConnection(C3P0ConnectionProvider.java:33)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
net.sf.hibernate.impl.BatcherImpl.openConnection(BatcherImpl.java:278)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
net.sf.hibernate.impl.SessionImpl.connect(SessionImpl.java:3297)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
net.sf.hibernate.impl.SessionImpl.connection(SessionImpl.java:3277)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
net.sf.hibernate.impl.BatcherImpl.prepareQueryStatement(BatcherImpl.java:65)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:704)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
net.sf.hibernate.loader.Loader.doQuery(Loader.java:185)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
net.sf.hibernate.loader.Loader.doList(Loader.java:955)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
net.sf.hibernate.loader.Loader.list(Loader.java:946)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:834)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1536)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1513)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1509)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
java.lang.reflect.Method.invoke(Method.java:324)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:230)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1244)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(ContinuationInterpreter.java:1134)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(ContinuationInterpreter.java:190)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(ContinuationInterpreter.java:138)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.mozilla.javascript.continuations.InterpretedFunctionImpl.call(InterpretedFunctionImpl.java:121)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1244)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpreter.callFunction(FOM_JavaScriptInterpreter.java:693)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.apache.cocoon.components.treeprocessor.sitemap.CallFunctionNode.invoke(CallFunctionNode.java:130)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:49)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:72)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:126)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:72)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:101)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:336)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:277)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:103)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:49)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:72)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:126)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:72)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:101)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:336)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:277)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.apache.cocoon.Cocoon.process(Cocoon.java:619)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1078)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:354)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.java:342)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
com.mobilebox.hibernate.PersistenceManager.doFilter(PersistenceManager.java:66)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.java:334)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:286)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.mortbay.http.HttpContext.handle(HttpContext.java:1808)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:525)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.mortbay.http.HttpContext.handle(HttpContext.java:1758)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.mortbay.http.HttpServer.service(HttpServer.java:879)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.mortbay.http.HttpConnection.service(HttpConnection.java:790)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:952)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.mortbay.http.HttpConnection.handle(HttpConnection.java:807)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.mortbay.http.SocketListener.handleConnection(SocketListener.java:197)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289)
INFO | jvm 1 | 2004/05/05 20:48:32 | at
org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:501)
STATUS | wrapper | 2004/05/05 20:55:20 | CTRL-C trapped. Shutting down.
STATUS | wrapper | 2004/05/05 20:55:20 | CTRL-C trapped. Forcing immediate shutdown.
STATUS | wrapper | 2004/05/05 20:55:21 | <-- Wrapper Stopped