-->
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.  [ 2 posts ] 
Author Message
 Post subject: ExceptionInInitialization error when using Hibernate3.0
PostPosted: Sat Aug 12, 2006 5:03 pm 
Newbie

Joined: Sat Aug 12, 2006 3:52 pm
Posts: 2
Hello i am using Hibernate 3.0 with eclipse 3.2 + JDK 1.5.

I am trying to create a sessionFactory, but i get the following error ( i am including the config file). I have cglib-2.1.jar in my class path. I tried cglig2.1.2 & 2.1_3.jar also but that doesn't seem to solve the problem.

I also tried hibernate3.2 with cglib2.1_3.jar.

I tried googling, and found the following post with similar error
http://66.102.7.104/search?q=cache:Huk9 ... =firefox-a

since i do not understand the language, i tried translating it online, and i think
the user said it was a problem with not having a jar in the class path (i was not sure which on). I have included commons-logging, asm, cglib, etc in my classpath.

--------------------
Exception :
--------------------

Exception in thread "main" java.lang.ExceptionInInitializerError
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005)
at amazon.contributionProfit.reportMaster.NewReport.main(NewReport.java:51)
Caused by: net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:236)
at net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:145)
at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:117)
at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108)
at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104)
at org.hibernate.impl.SessionFactoryImpl.<clinit>(SessionFactoryImpl.java:321)
... 2 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:373)
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:218)
... 7 more
Caused by: java.lang.IllegalAccessError: class org.hibernate.impl.SessionFactoryImpl$QueryCacheKeyFactory$$KeyFactoryByCGLIB$$f37b4e4d cannot access its superinterface org.hibernate.impl.SessionFactoryImpl$QueryCacheKeyFactory
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
... 13 more

-------------
Config file
-------------

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

<hibernate-configuration>
<session-factory>
<property name="current_session_context_class">thread</property>
<property name="hibernate.jndi.class">....MyJNDI source...</property>
<property name="hibernate.connection.provider_class">org.hibernate.connection.DatasourceConnectionProvider</property>
<property name="hibernate.connection.datasource">...MyDataSource</property>
<property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>
</session-factory>
</hibernate-configuration>


The Database i am working with it Oralce 9.2.0.5

What am i missing?


Thank in advance,
moon.


Top
 Profile  
 
 Post subject: (including the source code)
PostPosted: Sat Aug 12, 2006 5:08 pm 
Newbie

Joined: Sat Aug 12, 2006 3:52 pm
Posts: 2
sorry, this is the code i am using :

File hibernateCfgXml = new File("hibernate.cfg.xml");
Configuration configuration = new Configuration().configure(hibernateCfgXml);
SessionFactory factory = configuration.buildSessionFactory();


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