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?
|
|