Announcement Announcement Module
Collapse
No announcement yet.
Which ANTLR to use with 3.0 M1? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Which ANTLR to use with 3.0 M1?

    Which version of ANTLR are we supposed to use with Spring 3.0 M1? It must be some version of ANTLR 3, given the org.antlr package space, but it doesn't work with antlr-runtime 3.1:

    Code:
    java.lang.NoSuchFieldError: ruleMemo
            at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:142)
            at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87)
            at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:244)
    SimpleInstantiationStrategy subclasses org.antlr.runtime.Parser, which has no ruleMemo field in antlr-runtime 3.1, and that's the current version.

  • #2
    I've got the same problem.
    Whatever i put antlr2.7.7.jar and antlr3.3.1-runtime.jar together or only antlr3.1.1.jar into the lib forder, when i start Tomcat it throw out this:
    java.lang.NoSuchFieldError: ruleMemo
    at org.springframework.expression.spel.generated.Spri ngExpressionsParser.<init>(SpringExpressionsParser .java:94)
    at org.springframework.expression.spel.internal.Sprin gExpressionsParserExtender.<init>(SpringExpression sParserExtender.java:30)
    at org.springframework.expression.spel.SpelExpression Parser.<init>(SpelExpressionParser.java:52)
    at org.springframework.context.expression.StandardBea nExpressionResolver.<init>(StandardBeanExpressionR esolver.java:40)
    at org.springframework.context.support.AbstractApplic ationContext.prepareBeanFactory(AbstractApplicatio nContext.java:442)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:353)
    at org.springframework.web.context.ContextLoader.crea teWebApplicationContext(ContextLoader.java:254)
    at org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:198)
    at org.springframework.web.context.ContextLoaderListe ner.contextInitialized(ContextLoaderListener.java: 47)
    at org.apache.catalina.core.StandardContext.listenerS tart(StandardContext.java:3830)
    at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4337)
    at org.apache.catalina.core.ContainerBase.addChildInt ernal(ContainerBase.java:791)
    at org.apache.catalina.core.ContainerBase.addChild(Co ntainerBase.java:771)
    at org.apache.catalina.core.StandardHost.addChild(Sta ndardHost.java:525)
    at org.apache.catalina.startup.HostConfig.deployDirec tory(HostConfig.java:920)
    at org.apache.catalina.startup.HostConfig.deployDirec tories(HostConfig.java:883)
    at org.apache.catalina.startup.HostConfig.deployApps( HostConfig.java:492)
    at org.apache.catalina.startup.HostConfig.start(HostC onfig.java:1138)
    at org.apache.catalina.startup.HostConfig.lifecycleEv ent(HostConfig.java:311)
    at org.apache.catalina.util.LifecycleSupport.fireLife cycleEvent(LifecycleSupport.java:117)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1053)
    at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:719)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(Sta ndardService.java:516)
    at org.apache.catalina.core.StandardServer.start(Stan dardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalin a.java:566)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootst rap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:413)
    I can't even start Tomcat! Anyone have idea with this?

    Comment


    • #3
      It seems that 3.0.M1 was built against some intermediate build of ANTLR 3.0. The fisheye repo for ANTLR shows that ruleMemo vanished from the BaseRecognizer class back in 2007.

      I've filed SPR-5343 to have this addressed.

      Why does ANTLR *always* cause grief......?

      Comment


      • #4
        Checking the supplied pomsmight give you a hint...

        Code:
        <dependency>
            <groupId>org.antlr</groupId>
            <artifactId>com.springsource.org.antlr</artifactId>
            <version>3.0.1</version>
        </dependency>

        Comment


        • #5
          Originally posted by Marten Deinum View Post
          Checking the supplied pomsmight give you a hint...

          Code:
          <dependency>
              <groupId>org.antlr</groupId>
              <artifactId>com.springsource.org.antlr</artifactId>
              <version>3.0.1</version>
          </dependency>
          It's a hint, but it's misleading. The 3.0.1 source from antlr.org doesn't have the ruleMemo field in BaseRecognizer. The one Spring builds against seems to be a custom build of ANTLR, and I can't figure out where it's getting it from.

          The hint is the com.springsource.org.antlr

          Comment


          • #6
            Use a custom build?...and don't supply the package within M1??

            Comment


            • #7
              That's life on the edge

              It may not be a custom build, per se, but it doesn't seem to be an off-the-shelf build, either.

              Comment


              • #8
                w w w.springsource.com/repository/app/bundle/version/detail?name=com.springsource.org.antlr&version=3.0 .1

                Seems this link sovles the problem

                Comment


                • #9
                  Put com.springsource.antlr-2.7.7.jar and com.springsource.org.antlr-3.0.1.jar together....or still catch problems

                  Comment


                  • #10
                    shriva

                    i am also facing this problem is any one really using spring2.5???

                    Comment


                    • #11
                      shriva

                      it works with antlr-3.0.1.jar

                      Comment


                      • #12
                        Originally posted by skaffman View Post
                        It's a hint, but it's misleading. The 3.0.1 source from antlr.org doesn't have the ruleMemo field in BaseRecognizer. The one Spring builds against seems to be a custom build of ANTLR, and I can't figure out where it's getting it from.

                        The hint is the com.springsource.org.antlr
                        The pom for antlr 3.0.1 has 2.7.7 as a non-optional dependency:

                        http://repo2.maven.org/maven2/org/an...ntlr-3.0.1.pom

                        Hence any use of 3.0.1 in a maven project will automatically import 2.7.7 into the build.

                        The com.springsource jars should be identical to the maven central versions apart from the addition of an OSGI-compatible manifest. So they aren't really custom builds in the sense that they have been recompiled with different source.

                        Comment


                        • #13
                          antlr-3.0.1.jar works for me with spring 3.0.0.M2

                          Comment


                          • #14
                            After upgrading to 3.0.0 M2 from 2.0, I run into the following exception:
                            java.lang.NoClassDefFoundError: org/antlr/runtime/RecognitionException
                            And I upgrade antlr to the current version 3.1.3. I get the exception other people mentioned in this thread. After replacing with antlr-3.0.1, I get another exception
                            Caused by: java.lang.NoClassDefFoundError: antlr/ANTLRException
                            org.hibernate.hql.ast.ASTQueryTranslatorFactory.cr eateQueryTranslator()
                            ...
                            It seems to me that Spring 3.0 and the current version Hibernate use different versions of Antlr.

                            How to solve this problem then?
                            Last edited by vw729; Mar 24th, 2009, 08:06 PM.

                            Comment


                            • #15
                              Any ideas? I have the same problem :-/

                              Comment

                              Working...
                              X