-->
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: Exception while implementing c3p0 on Weblogic 8.1
PostPosted: Mon Feb 19, 2007 2:33 am 
Newbie

Joined: Thu Feb 15, 2007 7:20 am
Posts: 4
I have the follwing configuration properties in my hibernate.cfg.xml

<property name="hibernate.c3p0.min_size">3</property>
<property name="hibernate.c3p0.max_size">5</property>
<property name="hibernate.c3p0.timeout">1800</property>
<property name="hibernate.c3p0.max_statements">50</property>

I am using c3p0-0.9.1.

I am getting the follwing exception while building the session factory :-

2007-02-19 11:47:09,265 [main] INFO com.mchange.v2.c3p0.C3P0Registry - jdk1.5 management interfaces unavailable... JMX support disabled.
java.lang.ClassNotFoundException: java.lang.management.ManagementFactory
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:198)
at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:62)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:223)
at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:43)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:140)
at com.mchange.v2.c3p0.C3P0Registry.<clinit>(C3P0Registry.java:132)
at com.mchange.v2.c3p0.impl.DriverManagerDataSourceBase.<init>(DriverManagerDataSourceBase.java:206)
at com.mchange.v2.c3p0.DriverManagerDataSource.<init>(DriverManagerDataSource.java:60)
at com.mchange.v2.c3p0.DriverManagerDataSource.<init>(DriverManagerDataSource.java:56)
at com.mchange.v2.c3p0.DataSources.unpooledDataSource(DataSources.java:152)
at org.hibernate.connection.C3P0ConnectionProvider.configure(C3P0ConnectionProvider.java:96)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56)
at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:366)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:60)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1881)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1174)
at com.bear.gcs.bpid.util.HibernateUtilManager.<clinit>(HibernateUtilManager.java:20)
at com.bear.gcs.bpid.dbhelper.LookUpMasterDBHelper.getDepartmentList(LookUpMasterDBHelper.java:51)
at com.bear.gcs.bpid.servlet.SetupServlet.init(SetupServlet.java:51)
at weblogic.servlet.internal.ServletStubImpl$ServletInitAction.run(ServletStubImpl.java:993)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:869)
at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java:848)
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:787)
at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:3252)
at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebAppServletContext.java:3197)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:3174)
at weblogic.servlet.internal.HttpServer.preloadResources(HttpServer.java:688)
at weblogic.servlet.internal.WebService.preloadResources(WebService.java:483)
at weblogic.servlet.internal.ServletInitService.resume(ServletInitService.java:30)
at weblogic.t3.srvr.SubsystemManager.resume(SubsystemManager.java:131)
at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:964)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:359)
at weblogic.Server.main(Server.java:32)
Code:



Looking forward for inputs on the same..........


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 19, 2007 11:09 am 
Newbie

Joined: Fri Jan 26, 2007 2:35 pm
Posts: 4
Did you complie your application with JDK 1.5 ? Weblogic 8.1 uses JDK 1.4
Below is an example of my c3po config file file I hope it helps



<?xml version="1.0" encoding="utf-8"?>^
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>

<session-factory>
<!-- Settings for a local HSQL (testing) database. -->
<property name="hibernate.connection.driver_class">org.gjt.mm.mysql.Driver</property>
<property name="hibernate.connection.password">foo</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost/my_database?autoReconnect=true</property>
<property name="hibernate.connection.username">bar</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>

<!-- Use the C3P0 connection pool. -->
<property name="c3p0.min_size">3</property>
<property name="c3p0.max_size">5</property>
<property name="c3p0.timeout">1800</property>


<!-- Disable second-level cache. -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<property name="cache.use_query_cache">false</property>
<property name="cache.use_minimal_puts">false</property>
<property name="max_fetch_depth">3</property>

<!-- Print SQL to stdout. -->
<property name="show_sql">true</property>
<property name="format_sql">true</property>


<!-- Bind the getCurrentSession() method to the thread. -->
<property name="current_session_context_class">thread</property>

<!-- Hibernate XML mapping files -->
<mapping resource="compData/SubjectList.hbm.xml" />
<mapping resource="compData/Notes.hbm.xml" />



</session-factory>


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 20, 2007 2:24 am 
Newbie

Joined: Thu Feb 15, 2007 7:20 am
Posts: 4
Hi ferric,

Thanks for your help but it still does not work. It gave the same exception while buidling the session factory.

My hibernate.cfg.xml is not much different from yours. It is as mentioned below. I am compiling my code using JDK 1.4

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.cglib.use_reflection_optimizer">false</property>
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.password">password</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@calv4a26s:1521:BEAR</property>
<property name="hibernate.connection.username">user_name</property>
<property name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property>

<property name="c3p0.min_size">3</property>
<property name="c3p0.max_size">5</property>
<property name="c3p0.timeout">1800</property>
<property name="hibernate.c3p0.max_statements">50</property>

<property name="hibernate.show_sql">true</property>
<property name="hibernate.statement_cache.size">25</property>

<mapping resource="com/bear/gcs/bpid/entities/TbpDept.hbm.xml" />
</session-factory>
</hibernate-configuration>

Pease help....!!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 20, 2007 7:15 am 
Newbie

Joined: Fri Jan 26, 2007 2:35 pm
Posts: 4
You have something referencing a 1.5 jar file. Make sure you don't have 1.5 installed on your machine. Something else to try is clean up your class path. Make sure you have
the jar files necessary for your app to run. It has to be a classpath issue


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 21, 2007 2:13 am 
Newbie

Joined: Thu Feb 15, 2007 7:20 am
Posts: 4
Hi ferric,

Its really a strange problem. I am running the application on Tomcat 5.5 and it works absolutely fine. But it throws that exception when I run it on Weblogic 8.1 or even through Eclipse.

There is no trace of any jar refering to any JDK 1.5 and there is no JDK 1.5 installed on my machine either.

I am yet to find out the solution. Your kind help is appreciated.

Thanks friend!!!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 18, 2007 1:32 pm 
Newbie

Joined: Wed Apr 18, 2007 1:27 pm
Posts: 1
Location: Jacksonville
I resolved my ClassNotFoundException: java.lang.management.ManagementFactory error by using the Java 1.5 compiler and
setting the JRE to be the JRE from Java 1.5 too. My JRE was set to 1.4 earlier.

Mark Lichtenstein


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 18, 2007 9:17 pm 
Newbie

Joined: Wed Sep 15, 2004 11:01 pm
Posts: 1
Location: Kansas
itsojas wrote:
Hi ferric,

Its really a strange problem. I am running the application on Tomcat 5.5 and it works absolutely fine. But it throws that exception when I run it on Weblogic 8.1 or even through Eclipse.

There is no trace of any jar refering to any JDK 1.5 and there is no JDK 1.5 installed on my machine either.

I am yet to find out the solution. Your kind help is appreciated.

Thanks friend!!!


Hello itsojas,

If you want to use c3p0 with a pre 1.5 JVM (1.3.x or 1.4.x) and not get the "jdk1.5 management interfaces unavailable... JMX support disabled" message then check out the Configuring and Managing c3p0 via JMX section of the c3p0 documentation to learn how to suppress this behavior. All you need is a simple entry in the c3p0.properties file. However, note that the log level of this message is INFO and is not a result of a critical error.

_________________
Best Regards,
JT


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.