#387 ✓duplicate
Matthew Lloyd

Incompatibility with ANTLR parsers

Reported by Matthew Lloyd | November 6th, 2010 @ 03:19 AM | in 1.3 (closed)

Please include as much relevant information as possible including the exact framework version you're using and a code snippet that reproduces the problem.

Framework version: 1.1
Platform you're using: Windows x64

Reproduction steps:

Details:

The PropertiesEnhancer is throwing the exception below when my code executes an ANTLR v3 generated parser. The GrammarParser is accessing a public field 'index' which is declared in its superclass Parser (part of the ANTLR runtime).

Internal Server Error (500) for request GET /

Execution exception (In /app/parsers/GrammarParser.java around line 2942)
NoSuchMethodException occured : parsers.GrammarParser.getInput()

play.exceptions.JavaExecutionException: parsers.GrammarParser.getInput()

    at play.mvc.ActionInvoker.invoke(ActionInvoker.java:285)
    at Invocation.HTTP Request(Play!)

Caused by: java.lang.NoSuchMethodException: parsers.GrammarParser.getInput()

    at java.lang.Class.getMethod(Unknown Source)
    at play.classloading.enhancers.PropertiesEnhancer$FieldAccessor.invokeRe

adProperty(PropertiesEnhancer.java:181)

    at parsers.GrammarParser.shortcut_file(GrammarParser.java:2942)
    at users.ShortcutFile.load(ShortcutFile.java:31)
    at users.User.runCommand(User.java:118)
    at controllers.Application.index(Application.java:28)
    at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:408)

    at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:403)

    at play.mvc.ActionInvoker.invoke(ActionInvoker.java:176)
    ... 1 more

Comments and changes to this ticket

  • opensource21
  • Matthew Lloyd

    Matthew Lloyd November 6th, 2010 @ 06:50 PM

    Thanks - looks like that bug has already been fixed. I'll try out the latest nightly build and see whether this bug is also fixed.

  • Matthew Lloyd

    Matthew Lloyd November 6th, 2010 @ 07:22 PM

    I'm still seeing this issue with the latest nightly build, 1.1RC2-111-gcf79c21. I wish there was a way to configure the PropertiesEnhancer to restrict its activities to specific packages or classes; it's a serious performance concern for my app that every public field reference in my entire application will go through an extra level of indirection.

  • Morten Kjetland

    Morten Kjetland June 8th, 2011 @ 10:29 PM

    Is this still a problem?

  • Nicolas Leroux

    Nicolas Leroux October 28th, 2011 @ 08:32 PM

    • Assigned user set to “Nicolas Leroux”
    • State changed from “new” to “duplicate”
    • Milestone set to 1.3
    • Milestone order changed from “217” to “0”

    I guess not. Reopen the bug if there is still an issue.

  • cifey

    cifey December 3rd, 2011 @ 05:50 AM

    I'm getting the same error with play 1.2.4,
    seems to be a different code path from the duplicate

    1. added antlr-3-2.jar to the ./lib/directory
    2. antlr generated a parser.java and put it into the app codebase.

    The problem seems like this:
    The child class in the app IS using the play class loader and thinks it should have a getInput() method.

    The parent class comes from the antlr-3-2.jar and does NOT use the play class loader.
    org.antlr.runtime.Parser classloader = sun.misc.Launcher$AppClassLoader@3093dee9

    see

    PropertiesEnhancer.java FieldAccessor {
    
    if (o.getClass().getClassLoader() == null || !o.getClass().getClassLoader().equals(Play.classloader)) 
    {
     return o.getClass().getField(property).get(o);  // should get into here but doesn't
    }
    

    ========

    =========== java.lang.NoSuchMethodException: com.prosrm.aware.antlrgenerated.RuleExpressionP
    arser.getInput()

        at java.lang.Class.getMethod(Class.java:1605)
        at play.classloading.enhancers.PropertiesEnhancer$FieldAccessor.invokeRe
    

    adProperty(PropertiesEnhancer.java:212)

        at com.prosrm.aware.antlrgenerated.RuleExpressionParser.root(RuleExpress
    

    ionParser.java:120)

    ....

    /**/
    public class Parser extends org.antlr.runtime.BaseRecognizer {
        public org.antlr.runtime.TokenStream input;
    
    ....
        public final RuleExpressionParser.root_return root() throws RecognitionException {
            RuleExpressionParser.root_return retval = new RuleExpressionParser.root_return();
            retval.start = input.LT(1);
    /**/
    
  • AnnySally

    AnnySally May 24th, 2018 @ 06:52 AM

    Remarkable article, it is particularly useful! I quietly began in this, and I'm becoming more acquainted with it better! Delights, keep doing more and extra impressive! Dianabol Results

  • bravehassan222

    bravehassan222 May 27th, 2018 @ 06:14 PM

    Thanks for sharing this quality information with us. I really enjoyed reading. Will surely going to share this URL with my friends. Security Service Munich

  • AnnySally

    AnnySally May 29th, 2018 @ 10:43 AM

    I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here! keep up the good work... Clenbuterol

  • AnnySally

    AnnySally June 2nd, 2018 @ 07:19 AM

    I was reading your article and wondered if you had considered creating an ebook on this subject. Your writing would sell it fast. You have a lot of writing talent. These are not steroids

  • AnnySally

    AnnySally August 6th, 2018 @ 07:41 PM

    Hello, I have browsed most of your posts. This post is probably where I got the most useful information for my research. Thanks for posting, maybe we can see more on this. Are you aware of any other websites on this subject. Maids in dubai

  • aileen123

    aileen123 August 11th, 2018 @ 08:36 AM

    blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here! keep up the good work.Best Upright Exercise Bike

  • AnnySally

    AnnySally August 16th, 2018 @ 08:24 AM

    I am happy to find this post very useful for me, as it contains lot of information. I always prefer to read the quality content and this thing I found in you post. Thanks for sharing. Home inspection Seattle

  • Anna justin

    Anna justin August 21st, 2018 @ 07:52 AM

    Male Extra is considered to have a totally natural formula especially for individuals who are facing the problem of the hair treatment, genetic hair loss.
    https://www.maleextrareviewguide.com/

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2>Play framework</h2>

Play makes it easier to build Web applications with Java. It is a clean alternative to bloated Enterprise Java stacks. It focuses on developer productivity and targets RESTful architectures. Learn more on the <a href="http://www.playframework.org">http://www.playframework.org</a> website.<br><br>

<h2>Source code is hosted on github</h2>Check out our repository at <a href="http://github.com/playframework/play">http://github.com/playframework/play</a><br><br>

<h2>Contributing, creating a patch</h2> Please read the <a href="http://play.lighthouseapp.com/projects/57987/contributor-guide">contributor guide</a><br><br>

<h2>Reporting Security Vulnerabilities</h2> Since all bug reports are public, please report any security vulnerability directly to <em>guillaume dot bort at gmail dot com</em>.<br><br>

<h2>Creating a bug report</h2> Bug reports are incredibly helpful, so take time to report bugs and request features in our ticket tracker. We’re always grateful for patches to Play’s code. Indeed, bug reports with attached patches will get fixed far quickly than those without any.<br><br>

Please include as much relevant information as possible including the exact framework version you're using and a code snippet that reproduces the problem.<br><br>

Don't have too much expectations. Unless the bug is really a serious "everything is broken" thing, you're creating a ticket to start a discussion. Having a patch (or a branch on Github we can pull from) is better, but then again we'll only pull high quality branches that make sense to be in the core of Play.

Pages