Thread:
 Another tip 
 cleland   29 Apr 2008, 13:14 

Comment
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
From: cleland (29 Apr 2008, 13:14) Replies: 0, Views: 342
Subject: Another tip
I never got the IllegalAccessException above, but I still had some
problems that the original post didn't solve.  

In my case I was using one plugin which I'll call myPluginA (which uses
the hibernate plugin) as a plugin for another application (myPluginB) so
I didn't want to have the hibernate.cfg.xml inside the myPluginB project.

What I had to do was put the "Eclipse-BuddyPolicy: registered" line
in the manifest.mf's of both the hibernate plugin and of myPluginA

I then put the "Eclipse-RegisterBuddy: org.hibernate.eclipse, myPluginA"
in the manifest.mf of myPluginB and 
"Eclipse-RegisterBuddy: org.hibernate.eclipse" in myPluginA's manifest.mf.

I then had to put the line:

URL url = HibernateUtil.class.getResource("../hibernate.cfg.xml");  

inside HibernateUtil and then use the configure which takes a URL argument 

sessionFactory = new Configuration().configure(url).buildSessionFactory();

instead of 

sessionFactory = new Configuration().configure().buildSessionFactory();
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
© Copyright 2006, Red Hat Middleware, LLC. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc. [Privacy Policy]