#2046 new
Andy Lewis

Javassist Exceptions in LocalvariablesNamesEnhancer.java

Reported by Andy Lewis | April 14th, 2016 @ 02:32 PM

This is essentially the same issue as described in #1867. It occurs in projects that compile fine in Play 1.2.7.2, and I've observed it in all versions of Play since 1.3 (using Java 8)

As in the referenced ticket, I've attempted to replicate the bug in a simple project, but have failed.

Some interesting notes:
- The first error is swallowed, and occurs in the call to codeAttribute.computeMaxStack() on line 215 of LocalvariablesNamesEnhancer. Once this has occurred, the visible error occurs while adding the LocalVariablesNamesTracer.enter(); method. - Whatever variable the error occurs on seems to be random - and there's no commonality in the variable types. - It happens chiefly (I think) where there is an await() call in the function being enhanced.

My suspicion is that the problem does not lie in LocalvariablesNamesEnhancer.java, but in something that happens before it runs. To this end, I had a play with the enhancer ordering in CorePlugin.enhance() - and I found that by moving the ContinuationEnhancer so that it ran last, all occurrences of the LVE error have (so far) disappeared.

Is there a specific reason for the current ordering? So far, I haven't found any problems from doing this.

Comments and changes to this ticket

  • peterpark

    peterpark February 9th, 2019 @ 06:37 PM

    I have a controller that receives requests to generate CSVs asynchronously with continuations that is giving me an Exception:

    Oops: UnexpectedException
    An unexpected error occured caused by exception UnexpectedException:
    While applying class play.classloading.enhancers.LocalvariablesNamesEnhancer on
    controllers.Productions I have managed to narrow down the problem to the await line. If I remove it, I don't get the exception. Can anyone help me how to debug the problem further or suggest a workaround?

    Productions controller:

    @Check("user") public static void exportz(int iDisplayStart, int sEcho, String sSearch,
    String searchFields) { ObjectType ztype = ObjectType.get(getControllerClass());

    Triple<String,String,String> triplet = parseListJSON(iDisplayStart, sEcho, sSearch, searchFields);
    String where = triplet.getLeft();
    String orderField = triplet.getMiddle();
    String orderDir = triplet.getRight();
    
    ExportCSV csvGen = new ExportCSV( ztype,  where, orderField,orderDir,sSearch,searchFields);
    response.contentType = "text/csv";
    do {
        Promise<String> csvGeneration =csvGen.now();
        String someCsvData =  await(csvGeneration);
        response.writeChunk(someCsvData);
    }while(csvGen.moreData());
    

    } i have a lots of coding just goto my website alexa setup problem

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