-->
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.  [ 5 posts ] 
Author Message
 Post subject: Error when using DBCP with Hibernate
PostPosted: Sat Aug 14, 2004 10:12 am 
Beginner
Beginner

Joined: Thu Apr 29, 2004 4:31 am
Posts: 42
Hibernate version:2.1

Mapping documents:


Name and version of the database you are using: MySQL 4.1.1 Alpha

hello all,
i am trying to use DBCP along with Hibernate, but i am getting exceptions still when i am running my tests...'

hERE ISMY hibernate-cfg.xml

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

<!-- a SessionFactory instance listed as /jndi/name -->
<session-factory name="foo:/hibernate/SessionFactory">

<property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>
<property name="connection.username">root</property>
<property name="connection.password">mypass</property>
<property name="connection.url">jdbc:mysql://localhost:3306/menagerie?autoReconnect=true</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="show_sql">true</property>
<property name="use_outer_join">true</property>
<property name="transaction.factory_class">net.sf.hibernate.transaction.JDBCTransactionFactory</property>
<property name="dbcp.minIdle">1</property>
<property name="dbcp.maxIdle">10</property>
<property name="dbcp.maxActive">100</property>
<property name="dbcp.validationQuery">select 1 from dual</property>
<property name="dbcp.testOnBorrow">true</property>
<property name="dbcp.testOnReturn">false</property>
<property name="connection.provider_class">net.sf.hibernate.connection.DBCPConnectionProvider</property>
<property name="cache.use_query_cache">true</property>


<mapping resource="com/myapp/hibernate/HibernateExpenseType.hbm.xml"/>
<mapping resource="com/myapp/hibernate/HibernateEntry.hbm.xml"/>
<mapping resource="com/myapp/hibernate/HibernateUser.hbm.xml"/>
<mapping resource="com/myapp/hibernate/HibernateStock.hbm.xml"/>

</session-factory>
</hibernate-configuration>


i am getting this exception, and i cannot figure out where does it come from..

004-08-14 14:02:18,234 INFO net.sf.hibernate.cfg.Configuration [main] - processing one-to-one association property references
2004-08-14 14:02:18,234 INFO net.sf.hibernate.cfg.Configuration [main] - processing foreign key constraints
2004-08-14 14:02:18,281 INFO net.sf.hibernate.dialect.Dialect [main] - Using dialect: net.sf.hibernate.dialect.MySQLDialect
2004-08-14 14:02:18,281 INFO net.sf.hibernate.cfg.SettingsFactory [main] - Use outer join fetching: true
2004-08-14 14:02:18,296 INFO net.sf.hibernate.connection.ConnectionProviderFactory [main] - Initializing connection provider: net.sf.hibernate.connection.DBCPConnectionProvider
2004-08-14 14:02:18,312 INFO net.sf.hibernate.connection.DBCPConnectionProvider [main] - DBCP using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost:3306/menagerie?autoReconnect=true
2004-08-14 14:02:18,312 INFO net.sf.hibernate.connection.DBCPConnectionProvider [main] - Connection properties: {user=root, password=mypass}
2004-08-14 14:02:18,328 FATAL net.sf.hibernate.connection.DBCPConnectionProvider [main] - could not instantiate DBCP connection pool
java.lang.NumberFormatException: null
at java.lang.Long.parseLong(Long.java:363)
at java.lang.Long.parseLong(Long.java:452)
at net.sf.hibernate.connection.DBCPConnectionProvider.configure(DBCPConnectionProvider.java:77)
at net.sf.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:83)
at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:64)
at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1078)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:724)
at com.myapp.hibernate.HibernatePersistenceManager.initHibernate(HibernatePersistenceManager.java:84)
at com.myapp.hibernate.HibernatePersistenceManager.<init>(HibernatePersistenceManager.java:65)
at com.myapp.hibernate.HibernateFactory.getPersistenceManager(HibernateFactory.java:19)
at com.myapp.hibernate.HibernatePersistenceManagerTest.<init>(HibernatePersistenceManagerTest.java:52)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at junit.framework.TestSuite.createTest(TestSuite.java:131)
at junit.framework.TestSuite.addTestMethod(TestSuite.java:114)
at junit.framework.TestSuite.<init>(TestSuite.java:75)
at com.myapp.hibernate.HibernatePersistenceManagerTest.suite(HibernatePersistenceManagerTest.java:61)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.<init>(JUnitTestRunner.java:257)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.<init>(JUnitTestRunner.java:219)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeInVM(JUnitTask.java:822)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:556)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:532)
at org.apache.tools.ant.Task.perform(Task.java:341)
at org.apache.commons.jelly.tags.ant.AntTag.doTag(AntTag.java:232)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
at org.apache.commons.jelly.tags.core.IfTag.doTag(IfTag.java:88)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
at com.werken.werkz.jelly.GoalTag$1.performAction(GoalTag.java:128)
at com.werken.werkz.Goal.fire(Goal.java:639)
at com.werken.werkz.Goal.attain(Goal.java:575)
at com.werken.werkz.Goal.attainPrecursors(Goal.java:488)
at com.werken.werkz.Goal.attain(Goal.java:573)
at com.werken.werkz.Goal.attainPrecursors(Goal.java:488)
at com.werken.werkz.Goal.attain(Goal.java:573)
at com.werken.werkz.WerkzProject.attainGoal(WerkzProject.java:193)
at com.werken.werkz.jelly.AttainGoalTag.doTag(AttainGoalTag.java:134)
at org.apache.maven.jelly.tags.werkz.LazyAttainGoalTag.doTag(LazyAttainGoalTag.java:107)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
at org.apache.commons.jelly.TagSupport.invok

anyone can help??? thanx in advance and regards
marco


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 15, 2004 2:45 pm 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
hi,
there is surely one parameter missing, i don't have time to look more, just switch to another connexion pool (dbcp is the worst and probably won't be supported in next releases)
http://www.hibernate.org/214.html
or take a look at proxool

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 15, 2004 3:51 pm 
Newbie

Joined: Tue Sep 02, 2003 8:22 am
Posts: 19
Location: Chicago
DBCP has recently been picked up by a new maintainer and I believe that work is continuing on it. The new developer posted on the mailing list about the Hibernate team dropping support for DBCP, but I never saw the response from the Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 17, 2004 6:22 am 
Beginner
Beginner

Joined: Thu Apr 29, 2004 4:31 am
Posts: 42
Hello,
problem solved. i moved to use c3po, and everyhting looks fine

thanx and regards

marco


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 18, 2004 3:16 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
nheudecker wrote:
DBCP has recently been picked up by a new maintainer and I believe that work is continuing on it. The new developer posted on the mailing list about the Hibernate team dropping support for DBCP, but I never saw the response from the Hibernate team.


Actually it is *very* easy to implement/maintain your own ConnectionProvider.
Really, it is no big deal whether we will/won't support DBCP 1.2, previous or above versions. Just do it and publish it on the wiki or whereever you want. It's a single simple class.

Currently no one in the team actively use DBCP, it is too much a pain for us to maintain and support something we don't really use: as simple as that.

End of the story

Peace

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.