Hello friends,
Hibernate version: 3.0.1
Full stack trace of any exception that occurs:
Exception in thread "main" java.lang.ExceptionInInitializerError
at hibernate.simple.Storage.openDatabase(Storage.java:298)
Name and version of the database you are using:
name= simpleperson
version= mysql 4.1
Code where mysql settings are set for hibernate:
Code:
Configuration cfg = new Configuration()
.addClass( Person.class )
.setProperty( Environment.POOL_SIZE, "10" )
.setProperty( Environment.MAX_FETCH_DEPTH, "3" )
.setProperty( Environment.DIALECT,
"org.hibernate.dialect.MySQLDialect" )
.setProperty( Environment.DIALECT,
"org.hibernate.dialect.MySQLInnoDBDialect")
.setProperty( Environment.DIALECT,
"org.hibernate.dialect.MySQLMyISAMDialect")
.setProperty( "hibernate.connection.username", "PBPUBLIC" )
.setProperty( "hibernate.connection.password", "PBPUBLIC" )
.setProperty( "hibernate.connection.url",
"jdbc:mysql://localhost/simpleperson" )
.setProperty( "hibernate.connection.driver_class",
"org.gjt.mm.mysql.Driver" ) ;
Code where database is opened:
Code:
private void openDatabase( boolean create )
{
try
{
Configuration cfg = new Configuration()
.addClass( Person.class )
.setProperty( Environment.POOL_SIZE, "10" )
.setProperty( Environment.MAX_FETCH_DEPTH, "3" )
.setProperty( Environment.DIALECT,
"org.hibernate.dialect.MySQLDialect" )
.setProperty( Environment.DIALECT,
"org.hibernate.dialect.MySQLInnoDBDialect")
.setProperty( Environment.DIALECT,
"org.hibernate.dialect.MySQLMyISAMDialect")
.setProperty( "hibernate.connection.username", "PBPUBLIC" )
.setProperty( "hibernate.connection.password", "PBPUBLIC" )
.setProperty( "hibernate.connection.url",
"jdbc:mysql://localhost/simpleperson" )
.setProperty( "hibernate.connection.driver_class",
"org.gjt.mm.mysql.Driver" ) ;
if ( create )
cfg.setProperty( Environment.HBM2DDL_AUTO, "create" ) ;
sessionFactory = cfg.buildSessionFactory() ;
}
catch ( Throwable ex )
{
throw new ExceptionInInitializerError( ex ) ;
}
}
Can someone tell me where I am going wrong?
Thanks,
Manju