-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: Problems with c3p0
PostPosted: Wed Jan 16, 2008 8:14 am 
Newbie

Joined: Wed Jan 16, 2008 8:04 am
Posts: 7
Hello All!
I'm using Websphere 6.1 and Hibernate 2.
I have some problems to use 2 or more applications in the same appserver. When i call an application x it works fine, but when i call the second application (y), gives me an exception.

[16/01/08 09:04:49:968 GMT-03:00] 00000028 SystemOut O 09:04:49,937 INFO PoolBackedDataSource:269 - Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@50f650f6 [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@73687368 [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 73687368, idleConnectionTestPeriod -> 0, initialPoolSize -> 1, maxIdleTime -> 300, maxPoolSize -> 5, maxStatements -> 50, maxStatementsPerConnection -> 0, minPoolSize -> 1, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@726e726e [ description -> null, driverClass -> null, factoryClassLocation -> null, identityToken -> 726e726e, jdbcUrl -> jdbc:oracle:thin:@10.3.189.55:1379:sintac, properties -> {user=******, password=******} ], preferredTestQuery -> null, propertyCycle -> 300, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, usesTraditionalReflectiveProxies -> false; userOverrides: {} ], dataSourceName -> 50f650f6, factoryClassLocation -> null, identityToken -> 50f650f6, numHelperThreads -> 3 ]
[16/01/08 09:04:55:078 GMT-03:00] 00000028 WebApp E [Servlet Error]-[ActionServlet]: java.lang.VerifyError: class loading constraint violated (class: com/mchange/v2/c3p0/impl/NewProxyDatabaseMetaData method: attach(Lcom/mchange/v2/c3p0/impl/NewPooledConnection;)V) at pc: 0
at java.lang.J9VMInternals.verifyImpl(Native Method)
at java.lang.J9VMInternals.verify(J9VMInternals.java:59)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:120)
at com.mchange.v2.c3p0.impl.NewProxyConnection.getMetaData(NewProxyConnection.java:575)
at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:75)
at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1155)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:789)
at br.gov.dac.sintac.framework.modelo.util.HibernateUtil.getSessionFactory(Unknown Source)
at br.gov.dac.sintac.framework.modelo.util.HibernateUtil.getSession(Unknown Source)
at br.gov.dac.sintac.framework.modelo.util.HibernateFilter.doFilter(Unknown Source)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:696)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:641)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:475)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3107)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:238)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1425)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:92)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)
at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:193)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:725)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:847)



In the two applications are configured the hibernate.cfg.xml with the same values:



<!-- Hibernate Pool -->

<property name="connection.url">jdbc:oracle:thin:@192.168.16.127:1521:dbtest</property>
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="connection.username">test</property>
<property name="connection.password">test2008</property>
<property name="transaction.factory_class">net.sf.hibernate.transaction.JDBCTransactionFactory</property>
<property name="dialect">net.sf.hibernate.dialect.Oracle9Dialect</property>

<property name="hibernate.c3p0.min_size">9</property>
<property name="hibernate.c3p0.max_size">50</property>
<property name="hibernate.c3p0.timeout">300</property>
<property name="hibernate.c3p0.max_statements">50</property>
<property name="hibernate.c3p0.acquire_increment">2</property>
<property name="show_sql">true</property>
<property name="use_outer_join">true</property>
<property name="hibernate.jdbc.batch_size">0</property>
<property name="hibernate.jdbc.use_scrollable_resultsets">false</property>
*and the hbm mappings.


In the Browser, appears the message:

"Error 500: Filter [HibernateFilter]: filter is unavailable. "


Did anyone can help me? I'm loosing my hair with that problem, kkkkk.
Thanks


Top
 Profile  
 
 Post subject: Re: Problems with c3p0
PostPosted: Wed Jan 16, 2008 1:46 pm 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
It looks more of a class loading issue. How do you package the both classes. I am more interested to see where you put the c3p0 jar file.


Farzad-


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 16, 2008 2:27 pm 
Newbie

Joined: Wed Jan 16, 2008 8:04 am
Posts: 7
Hi! First of all, thanks for the reply...

My 2 Applications use a lib named: c3p0-0.9.1-pre6.jar that is inside of each WEB-INF/lib folder.
I'm writing above the structure of my apps:

1. ...\WS039Node01Cell\CustomizedSale.ear

1.1 ...\WS039Node01Cell\CustomizedSale.ear\META-INF
1.2 ...\WS039Node01Cell\CustomizedSale.ear\CustomizedSale.war
1.2.1 ...\WS039Node01Cell\CustomizedSale.ear\CustomizedSale.war\css
1.2.2 ...\WS039Node01Cell\CustomizedSale.ear\CustomizedSale.war\img
1.2.3 ...\WS039Node01Cell\CustomizedSale.ear\CustomizedSale.war\META-INF
1.2.4 ...\WS039Node01Cell\CustomizedSale.ear\CustomizedSale.war\WEB-INF
1.2.4.1 ...\WS039Node01Cell\CustomizedSale.ear\CustomizedSale.war\WEB-INF\lib
1.2.4.2 ...\WS039Node01Cell\CustomizedSale.ear\CustomizedSale.war\WEB-INF\classes
1.2.4.3 ...\WS039Node01Cell\CustomizedSale.ear\CustomizedSale.war\WEB-INF\jsp
1.2.4.4 ...\WS039Node01Cell\CustomizedSale.ear\CustomizedSale.war\WEB-INF\tiles




2. ...\WS039Node01Cell\Apprentices.ear

2.1 ...\WS039Node01Cell\Apprentices.ear\META-INF
2.2 ...\WS039Node01Cell\Apprentices.ear\Apprentices.war
2.2.1 ...\WS039Node01Cell\Apprentices.ear\Apprentices.war\css
2.2.2 ...\WS039Node01Cell\Apprentices.ear\Apprentices.war\img
2.2.3 ...\WS039Node01Cell\Apprentices.ear\Apprentices.war\META-INF
2.2.4 ...\WS039Node01Cell\Apprentices.ear\Apprentices.war\WEB-INF
2.2.4.1 ...\WS039Node01Cell\Apprentices.ear\Apprentices.war\WEB-INF\lib
2.2.4.2 ...\WS039Node01Cell\Apprentices.ear\Apprentices.war\WEB-INF\classes
2.2.4.3 ...\WS039Node01Cell\Apprentices.ear\Apprentices.war\WEB-INF\jsp
2.2.4.4 ...\WS039Node01Cell\Apprentices.ear\Apprentices.war\WEB-INF\tiles



Each application has his own c3p0*.jar inside of his lib directory. I tried to get off one of them, but didn't work.

Can you help me?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 16, 2008 3:32 pm 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
You can get some information on WAS class loader here:

http://publib.boulder.ibm.com/infocenter/wsphelp/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/crun_classload.html


Another thing you can do is to put the c3p0*.jar file in the ear file and add it's class path entry to the manifest file of each war file. That might help with the situation too.


Farzad-


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 22, 2008 9:32 am 
Newbie

Joined: Wed Jan 16, 2008 8:04 am
Posts: 7
Can you help me on how can i do it?
It's necessary to put the Class-Path reference on the MANIFEST.MF of the WAR file (EAR/WAR/META-INF/MANIFEST.MF)? How should be the location of my jar?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 22, 2008 12:10 pm 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
madbob wrote:
Can you help me on how can i do it?
It's necessary to put the Class-Path reference on the MANIFEST.MF of the WAR file (EAR/WAR/META-INF/MANIFEST.MF)? How should be the location of my jar?


put the c3p0 jar in the root of your ear file and add it's name in the MANIFEST.MF of each war file. WebSphere adheres to the Java standard and it consults the class path specified in manifest of jar and war files.


Farzad-


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 22, 2008 4:46 pm 
Newbie

Joined: Wed Jan 16, 2008 8:04 am
Posts: 7
Thank's all for the help.
I solved the problem by checking the jars on the application server.
In my case i put a odbc14.jar on the "lib" directory of the Websphere Application Server, and the same lib was present on each WAR file.
The real problem is that the odbc14.jar version were different...

That's is the tip for the people who are experiencing that error.

Thank's very much for all of your help, it gives me some tips to find the problem :D


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.