-->
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.  [ 1 post ] 
Author Message
 Post subject: connection Hibernate-mysql
PostPosted: Thu Jun 01, 2006 9:55 am 
Newbie

Joined: Thu Jun 01, 2006 9:48 am
Posts: 2
I have a local data base called pruebasjava in mysql and have created hibernate.cfg.xml

<? xml version=' 1,0' encoding=' utf-8'? > <! DOCTYPE hibernate-configuration PUBLIC “- //Hibernate/Hibernate Configuration DTD//EN” “http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd” > <hibernate-configuration>
<session-factory name=” /jndi/ContactsSessionFactory” >
<! -- properties org.gjt.mm.mysql. Driver com.mysql.jdbc. Driver--> <property name=” hibernate.connection.driver_class” > com.mysql.jdbc. Driver </property> <property name=” hibernate.connection.url” > jdbc: mysql: ///pruebasjava </property> <property name=” hibernate.connection.username” > root </property> <property name=” hibernate.connection.password” > </property> <property name=” hibernate.dialect” > net.sf.hibernate.dialect.MySQLDialect </property> <property name=” hibernate.connection.pool_size” > 4 </property> <property name=” hibernate.show_sql” > true </property> <property name= " transaction.factory_class " > org.hibernate.transaction.JDBCTransactionFactory </property> <property name= " hibernate.hbm2ddl.auto " > update </property> <! -- mapping you case out --> <mapping resource=” contacts/ContactInfo.hbm.xml”/> </session-factory> </hibernate-configuration>

but the connection does not work to me.

Error --->
java.lang.ExceptionInInitializerError AT contacts. Hibernate1.main (Hibernate1.java: 13) Caused by: org.apache.commons.log ging.LogConfigurationException: org.apache.commons.log ging.LogConfigurationException: java.lang.NullPointerException (Caused by java.lang.NullPointerException) (Caused by org.apache.commons.log ging.LogConfigurationException: java.lang.NullPointerException (Caused by java.lang.NullPointerException)) AT org.apache.commons.log ging.impl.LogFactoryImpl.newInstance (LogFactoryImpl.java: 543) AT org.apache.commons.log ging.impl.LogFactoryImpl.getInstance (LogFactoryImpl.java: 235) AT org.apache.commons.log ging.impl.LogFactoryImpl.getInstance (LogFactoryImpl.java: 209) AT org.apache.commons.log ging.LogFactory.getLog (LogFactory.java: 351) AT org.hibernate.cfg. Configuration.<clinit> (Configuration.java: 116) … 1 dwells Caused by: org.apache.commons.log ging.LogConfigurationException: java.lang.NullPointerException (Caused by java.lang.NullPointerException) ging.impl.LogFactoryImpl.getLogConstructor AT org.apache.commons.log (LogFactoryImpl.java: 397) AT org.apache.commons.log ging.impl.LogFactoryImpl.newInstance (LogFactoryImpl.java: 529) … 5 dwell Caused by: java.lang.NullPointerException ging.impl.LogFactoryImpl.getLogConstructor AT org.apache.commons.log (LogFactoryImpl.java: 374) … 6 dwell Exception in thread “main”

As the connection can be done?


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

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.