Page 1 of 3 123 LastLast
Results 1 to 10 of 25

Thread: Which ANTLR to use with 3.0 M1?

  1. #1
    Join Date
    Aug 2005
    Posts
    39

    Default 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. #2
    Join Date
    Dec 2008
    Posts
    4

    Unhappy

    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?

  3. #3
    Join Date
    Aug 2005
    Posts
    39

    Default

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

  4. #4
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,695

    Default

    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>
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  5. #5
    Join Date
    Aug 2005
    Posts
    39

    Default

    Quote 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

  6. #6
    Join Date
    Dec 2008
    Posts
    4

    Unhappy

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

  7. #7
    Join Date
    Aug 2005
    Posts
    39

    Default

    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.

  8. #8
    Join Date
    Dec 2008
    Posts
    4

    Default

    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

  9. #9
    Join Date
    Dec 2008
    Posts
    4

    Default

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

  10. #10

    Default shriva

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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •