- This topic has 18 replies, 9 voices, and was last updated 17 years, 2 months ago by dkim18.
-
AuthorPosts
-
shampeterMemberAfter enabling my Java project with Hibernate 3, the enabling did not include antlr support into the build path. Thus when I tried running HQL, my program failed with a ClassDefNotFound error.
Does anyone have similiar experience or I have done something wrong?
Riyad KallaMemberAnother person reported this problem, we are looking into it.
Jose.LoraMemberHi Team, any idea on when will this be fixed or a way to modify the Hibernate3 Project Capabilities to add the missing jar using the MYECLIPSE_HIBERNATE_HOME variable?
Riyad KallaMemberJose,
If you navigate to Window > Prefereces > MyEclipse > Project Capabilities > Hibernate > 3.0 you can modify the libraries there and fix them, this stuff is all configurable. It’s just a matter of us possibly missing a library when we shipped it.
Jose.LoraMemberThanks for the quick answer. Indeed I noticed I can made the change, I was just wondering if instead of using an absolute path, the new jar could also make use of the relate path (with the MYECLIPSE_HIBERNATE_HOME variable).
fauviMemberThe antlr jar file is missing from the Hibernate 3 Project Capabilities, so if you get the following error “java.lang.NoClassDefFoundError: antlr/ANTLRException” download the hibernate-3.05.zip from the Hibernate site and do as mentioned above to add the antlr-2.7.5H3.jar.
Riyad KallaMemberWe should have this fixed in our next maintenence release, sorry for the issue guys.
kitmMemberRiyad,
Have you guys set a target date for the next maintenance release? If so, can you share it with us?
Thanks,
-Kit
Riyad KallaMemberThis message has not been recovered.
gzhuyeMemberHi, team:
I met this problem in ME 4.0. Therefore, I uninstalled ME and downloaded the most recent one — MyEclipse 4.1 M2( 1. MyEclipse Enterprise Workbench 4.1 M2 for Windows 98/2000/XP (12/15/2005) ) from: http://www.myeclipseide.com/Downloads%2Bindex-req-viewdownload-cid-4.html and eclipse V3.1.1
However, when I put codes like:
Query q = session.createQuery("from Message as m order by m.text asc"); List messages = q.list();
The same exception as:
00:01:40,467 WARN Configurator: No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/C:/BevertecProject/AlertServer/raining-all/HibernateDemo2/lib/ehcache-1.1.jar!/ehcache-failsafe.xml java.lang.NoClassDefFoundError: antlr/ANTLRException at org.hibernate.hql.ast.ASTQueryTranslatorFactory.createQueryTranslator(ASTQueryTranslatorFactory.java:31) at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:71) at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:53) at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71) at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:108) at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:88) at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1540) at com.alt.test.client.MyTest.test2(MyTest.java:37) at com.alt.test.client.MyTest.main(MyTest.java:21) Exception in thread "main"
How can I solve this problem?
Thanks
Paul
Brian FernandesModeratorPaul,
Can you see if antlr-2.7.x.jar is on the classpath of your project?
It is possible that somehow your hibernate project library preferences got dorked, please go to Window > Preferences > MyEclipse > Project Capabilities > Hibernate.
Go the the Hibernate tab that you’re interested in and see if the antlr lib mentioned above is listed. If it is not listed, you can press Restore Defaults that will reset the libraries added to new projects.You can then create a new hibernate project and see if the lib is added in there, or simply locate the jar file and copy it into a classpath folder for your existing project.
Hope this helps – let us know if you require further clarification.
Best,
Brian.
gzhuyeMemberThanks for your direction! It works very well.
However, I’m just curious why this jar file is not imported into Hibernate3 libs automatically?
Cheers,
Paul
Brian FernandesModeratorPaul,
Glad it’s working for you now. How did you solve your problem? Did you copy the jar file into your project or did you try “Restore Defaults” and created a new project?
The file is actually copied into hibernate projects by default, but we had some issues with a previous release in which the file was mistakenly omitted from the library set. In some cases that created problems with the prefereces, Restore Defaults fixes this.
Best,
Brian.
gzhuyeMemberHi, Brian:
Sorry, I didn’t make clear.
As you said:
1. go to Window > Preferences > MyEclipse > Project Capabilities > Hibernate.
2. press Restore Defaults
3. then create a new hibernate project and the lib can be added in thereAnyway, before you use Hibernate3, You have to do step 1,2 at first; otherwise, this lib can NOT be imported to the project.
So I think it is still a small bug with ME.Cheers,
Paul
Brian FernandesModeratorPaul,
Thank you for clarifying. You do not have to do the steps you outlined every time you create a Hibernate project, once is enough.
There certainly was a bug in a past version which sort of persists occasionaly if you continue to use the same workspace. After you “Restore Defaults” the preferences are reset to their correct values, and it will work okay from then on.
Thank you for your report all the same (and sorry for the inconvenienc), we wil be making some changes in this department to ensure that this does not happen again.
Best,
Brian. -
AuthorPosts