This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes java.lang.IllegalAccessError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "java.lang.IllegalAccessError" Watch "java.lang.IllegalAccessError" New topic


Danny Rebello

Joined: Dec 30, 2005
Posts: 6
Hi All,
I have not been able to build the hibernate SessionFactory from
hibernate.cfg.xml file using the code
sessionFactory = cfg.configure().buildSessionFactory();
since the hibernate.cfg.xml not found error occired.
what I did was tried changing the above code to
sessionFactory = cfg.buildSessionFactory();
for reading from the file.
I have all hibernate2.jar and 3rd party jar files in my classpath, but I am still getting the error as :
231 [main] WARN net.sf.ehcache.config.Configurator - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/C:/j2sdk1.4.2_10/jre/lib/ext/ehcache-0.9
Exception in thread "main" java.lang.IllegalAccessError
at net.sf.cglib.core.ClassEmitter.setTarget(
at net.sf.cglib.core.ClassEmitter.<init>(
at net.sf.cglib.core.KeyFactory$Generator.generateClass(
at net.sf.cglib.core.DefaultGeneratorStrategy.generate(
at net.sf.cglib.core.AbstractClassGenerator.create(
at net.sf.cglib.core.KeyFactory$Generator.create(
at net.sf.cglib.core.KeyFactory.create(
at net.sf.cglib.core.KeyFactory.create(
at net.sf.cglib.core.KeyFactory.create(
at net.sf.hibernate.impl.SessionFactoryImpl.<clinit>(
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(
at de.laliluna.example.HibernateSessionFactory.currentSession(
at de.laliluna.example.TestClient.createHoney(
at de.laliluna.example.TestClient.main(

Can some on help me on this
Thanks in Advance
Danny Rebello
Don't get me started about those stupid light bulbs.
subject: java.lang.IllegalAccessError
It's not a secret anymore!