facebook

hibernate enabled project missing antlr

  1. MyEclipse Archived
  2.  > 
  3. Bugs
Viewing 15 posts - 1 through 15 (of 19 total)
  • Author
    Posts
  • #237017 Reply

    shampeter
    Member

    After 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?

    #237044 Reply

    Riyad Kalla
    Member

    Another person reported this problem, we are looking into it.

    #237119 Reply

    Jose.Lora
    Member

    Hi 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?

    #237126 Reply

    Riyad Kalla
    Member

    Jose,
    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.

    #237146 Reply

    Jose.Lora
    Member

    Thanks 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).

    #237216 Reply

    fauvi
    Member

    The 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.

    #237219 Reply

    Riyad Kalla
    Member

    We should have this fixed in our next maintenence release, sorry for the issue guys.

    #237278 Reply

    kitm
    Member

    Riyad,

    Have you guys set a target date for the next maintenance release? If so, can you share it with us?

    Thanks,
    -Kit

    #237297 Reply

    Riyad Kalla
    Member

    This message has not been recovered.

    #243299 Reply

    gzhuye
    Member

    Hi, 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

    #243332 Reply

    Brian Fernandes
    Moderator

    Paul,

    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.

    #243345 Reply

    gzhuye
    Member

    Thanks 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

    #243346 Reply

    Brian Fernandes
    Moderator

    Paul,

    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.

    #243356 Reply

    gzhuye
    Member

    Hi, 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 there

    Anyway, 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

    #243360 Reply

    Brian Fernandes
    Moderator

    Paul,

    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.

Viewing 15 posts - 1 through 15 (of 19 total)
Reply To: hibernate enabled project missing antlr

You must be logged in to post in the forum log in