#1528 ✓resolved
Ron Gross

Dependency problem + LocalvariablesNamesEnhancer issue

Reported by Ron Gross | May 17th, 2012 @ 04:25 PM | in 1.2.5 (closed)

Framework version: 1.2.x-84b46a2
Platform you're using: Windows 7 64 bit, Java 7 64 bit

Reproduction steps: No extra reproduction steps yet, if needed I will try to update this bug later with a sscce.

Details:

Today I built the latest version of Play off the 1.2.x branch, and ran play deps --sync on my project with this dependencies.yml file:

Application dependencies

require:

- play:
    exclude:
      - org.hibernate -> hibernate-core
- play -> secure
- play -> crud
- play -> less 0.9

Buggy:

- play -> associations 1.0.1

- com.google.guava -> guava 10.0.1
- org.hibernate -> hibernate-validator 4.1.0.Final
- org.hibernate -> hibernate-core 3.6.1.Final:
    exclude:
        - ant -> ant * # not working: http://stackoverflow.com/questions/8563043/why-isnt-play-excluding-my-dependency

# For groovy:
- groovy -> groovy-all-1.0-jsr 05
- org.apache.ant -> ant 1.8.2

- commons-io -> commons-io 2.1:
    force: true
- com.google.inject -> guice 3.0

- net.lingala.zip4j -> zip4j 1.2.9

- org.antlr -> stringtemplate 4.0.2
- org.mindrot -> jbcrypt 0.3m
- net.schmizz -> sshj 0.7.0

I got missing/evicted dependencies (attached), and then when I ran play start I got java.lang.ArrayIndexOutOfBoundsException: -1

I tried upgrading hibernate-core to 3.6.10, but the same errors happened.

Are the specific libraries I should watch for / upgrade / downgrade in my dependencies?
Any steps I should do to proceed with the investigation, beyond coming up with a sscce?

Comments and changes to this ticket

  • Nicolas Leroux

    Nicolas Leroux May 17th, 2012 @ 04:47 PM

    • State changed from “new” to “inprogress”
    • Milestone set to 1.2.5
    • Milestone order changed from “1102” to “0”

    The bug

  • Nicolas Leroux

    Nicolas Leroux May 17th, 2012 @ 04:48 PM

    Did you run play clean first?

  • Ron Gross

    Ron Gross May 17th, 2012 @ 05:11 PM

    No, but I deleted the project's temp folder.
    Does play clean do anything else other than clean this temp folder?

  • Play Duck
  • Nicolas Leroux

    Nicolas Leroux May 17th, 2012 @ 05:15 PM

    No, nothing else... I have a problem with the exception you have. Can you make sure you only have javassist-3.9.0.GA.jar? Most regression with the LocalvariablesNamesEnhancer were coming from the javassist upgrade.

  • Ron Gross

    Ron Gross May 17th, 2012 @ 05:25 PM

    I'll take a look tomorrow and let you know, I'm done working for today.
    Thanks for the attention.

  • Ron Gross

    Ron Gross May 18th, 2012 @ 01:09 PM

    OK, these are my findings:

    When running play-1.2.4-mbknor-3:

    1. I do not have a direct dependency on any version of javassist.
    2. After running play --deps, my lib folder does not contain a javassist jar.
    3. My play\framework\lib folder contains javassist-3.9.0.GA.jar and no other versions.
    4. The output from play --deps does not mention javassist
    5. Play seems to work well.

    When I switch my framework version to 1.2.x-84b46a2, run play clean and deps --sync, I get javassist-3.12.0.GA.jar in my lib folder, and the exception I specified.

    So, something about switching to the latest version caused me to have the incorrect javassist version dependency. Please check out the attached play deps logs. If there's any more experiments I can do to help analyze the problem, please let me know.

  • Nicolas Leroux

    Nicolas Leroux May 18th, 2012 @ 01:31 PM

    On the latest version the dependencies should be correct since I updated all of them. And you should have javassist 3.9 . I will have a second look later today.

  • Feroz Salam

    Feroz Salam May 20th, 2012 @ 05:38 PM

    Hi,

    I was also running the release found at https://github.com/mbknor/play/tree/1.2.4-mbknor-custom-release, which had solved my problems with the ContinuationEnhancer issue. However, just today I started receiving the similar LocalVariablesNamesEnhancer issue.

    I haven't updated javassist in my lib folder, it is still at 3.9.0.GA. Could there be anything else creating this issue or anywhere else I should look?

    Thanks.

  • Feroz Salam

    Feroz Salam May 20th, 2012 @ 05:55 PM

    Just to give you some more information, this is the error I am receiving:

    
    Oops: UnexpectedException
    An unexpected error occured caused by exception UnexpectedException: While applying class play.classloading.enhancers.LocalvariablesNamesEnhancer on controllers.StreamManager
    
    play.exceptions.UnexpectedException: While applying play.CorePlugin@4d3c7378 on controllers.StreamManager
        at play.plugins.PluginCollection.enhance(PluginCollection.java:556)
        at play.classloading.ApplicationClasses$ApplicationClass.enhance(ApplicationClasses.java:235)
        at play.classloading.ApplicationClassloader.loadApplicationClass(ApplicationClassloader.java:167)
        at play.classloading.ApplicationClassloader.getAllClasses(ApplicationClassloader.java:431)
        at play.Play.start(Play.java:516)
        at play.Play.detectChanges(Play.java:630)
        at play.Invoker$Invocation.init(Invoker.java:198)
        at Invocation.HTTP Request(Play!)
    Caused by: play.exceptions.UnexpectedException: While applying class play.classloading.enhancers.LocalvariablesNamesEnhancer on controllers.StreamManager
        at play.CorePlugin.enhance(CorePlugin.java:302)
        at play.plugins.PluginCollection.enhance(PluginCollection.java:551)
        ... 7 more
    Caused by: javassist.CannotCompileException: by javassist.bytecode.BadBytecode: invalid opcode address
        at javassist.CtBehavior.insertAfter(CtBehavior.java:777)
        at play.classloading.enhancers.LocalvariablesNamesEnhancer.enhanceThisClass(LocalvariablesNamesEnhancer.java:269)
        at play.CorePlugin.enhance(CorePlugin.java:297)
        ... 8 more
    Caused by: javassist.bytecode.BadBytecode: invalid opcode address
        at javassist.bytecode.CodeIterator.nextOpcode(CodeIterator.java:586)
        at javassist.bytecode.CodeIterator.next(CodeIterator.java:157)
        at javassist.bytecode.stackmap.Liveness.analyze(Liveness.java:237)
        at javassist.bytecode.stackmap.Liveness.computeUsage(Liveness.java:216)
        at javassist.bytecode.stackmap.Liveness.compute(Liveness.java:38)
        at javassist.bytecode.stackmap.TypedBlock.makeBlocks(TypedBlock.java:54)
        at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:91)
        at javassist.bytecode.MethodInfo.rebuildStackMap(MethodInfo.java:404)
        at javassist.bytecode.MethodInfo.rebuildStackMapIf6(MethodInfo.java:389)
        at javassist.CtBehavior.insertAfter(CtBehavior.java:768)
        ... 10 more
    
  • Feroz Salam

    Feroz Salam May 20th, 2012 @ 07:02 PM

    Sorry about the continuous messages regarding this, but I have some more information regarding the source of the error!

    After some extensive fiddling with the code, I realised that the error was being created whenever I added a println statement involving a variable to a very large function in one particular class. I have verified that printlns in other classes work fine, as well as that printlns in other functions within the class work fine.

    From this, and given the abnormally large size of the function in question, I suspect that it's some sort of (possibly implicit) limit to the number of variables that can be declared in a subfunction?

    I can provide you with more information if you require it.

  • Nicolas Leroux

    Nicolas Leroux May 20th, 2012 @ 09:36 PM

    Could you please provide me with an example that reproduces the bug? Thanks

  • Ron Gross

    Ron Gross May 21st, 2012 @ 08:05 AM

    @Feroz - it seems like a different issue, not directly related to this one. I suggest you open another one and assign it to @Nicolas.

    @Nicolas - here is an example.

    https://github.com/ripper234/play-LocalvariablesNamesEnhancer-bug-1528

    I haven't gone all the way to reproduce the local variable bug itself yet, but it running "play deps --sync" does bring in javassist 3.12.0.GA instead of 3.9.0, and I get this log:

    ~ ***************************************************************************** ~ WARNING: These dependencies are missing, your application may not work properly (use --verbose for details), ~ ~ org.jboss.javaee->jboss-jacc-api_JDK4 1.1.0 ~ commons-collections->commons-collections 3.2.1 ~ org.hibernate->hibernate-entitymanager 4.1.3.Final ~ mysql->mysql-connector-java 5.1.20 ~ org.hibernate->jboss-logging 3.1.0.GA ~ org.hibernate->hibernate-commons-annotations 4.0.1.Final

    Here is the result of the deps --sync --verbose run:

    https://gist.github.com/2761101

  • Ron Gross

    Ron Gross May 23rd, 2012 @ 01:52 PM

    Any news?

    I would really hate for us to not be able to upgrade to 1.2.5 because of this issue.

  • Nicolas Leroux

    Nicolas Leroux May 23rd, 2012 @ 02:00 PM

    I haven't got much time lately. Are we talking about the latest 1.2.x branch? Because you should really have javassist 3.9 in that branch (see framework/dependencies.yml) with the hibernate 3.6.10.

  • Ron Gross

    Ron Gross May 23rd, 2012 @ 02:11 PM

    We are indeed talking about the latest version (as per May 17 2012) of 1.2.x branch.

    If you clone the repository I linked to (https://github.com/ripper234/play-LocalvariablesNamesEnhancer-bug-1528), hopefully you should be able to reproduce the issue.

    If you're too busy, is there someone else that could help with this?

  • Nicolas Leroux

    Nicolas Leroux May 23rd, 2012 @ 02:21 PM

    https://github.com/playframework/play/blob/1.2.x/framework/dependen... mentioned javassist 3.9, hibernate 3.6.10. In you project you are introducing a dependency on javassist. Please comment out the following lines in your example:

    #- org.hibernate -> hibernate-validator 4.1.0.Final

    #- org.hibernate -> hibernate-core 3.6.1.Final:
    #    exclude:
    #        - ant -> ant * # not working: http://stackoverflow.com/questions/8563043/why-isnt-play-excluding-my-dependency
    

    Or tell the dependency to exclude javassist.

  • Ron Gross

    Ron Gross May 23rd, 2012 @ 02:44 PM

    Which version of hibernate-validator should I use? It seems excluding files is not working properly:

    I tried adding an exclude for javassist, indeed the javassist.jar is not longer loaded into my lib folder.
    However, I still get loads of other warnings from play deps --sync, and when I start play I get critical errors. These errors do not go away if I remove the hibernate-validator dependency:

    ~ ~ WARNING: These dependencies are missing, your application may not work properly ~ details), ~ ~ org.jboss.javaee->jboss-jacc-api_JDK4 1.1.0 ~ commons-collections->commons-collections 3.2.1 ~ org.hibernate->hibernate-entitymanager 4.1.3.Final ~ mysql->mysql-connector-java 5.1.20 ~ org.hibernate->jboss-logging 3.1.0.GA ~ org.hibernate->hibernate-commons-annotations 4.0.1.Final ~

    Oops: NoSuchMethodError
    An unexpected error occured caused by exception NoSuchMethodError: org.hibernate.cfg.AnnotationConfiguration.getPersisterClassProvider()Lorg/hibernate/persister/PersisterClassProvider;

    play.exceptions.UnexpectedException: Unexpected Error

    at play.Invoker$Invocation.onException(Invoker.java:244)
    at play.Invoker$Invocation.run(Invoker.java:286)
    at Invocation.HTTP Request(Play!)
    

    Caused by: java.lang.NoSuchMethodError: org.hibernate.cfg.AnnotationConfiguration.getPersisterClassProvider()Lorg/hibernate/persister/PersisterClassProvider;

    at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:1055)
    at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:904)
    at play.db.jpa.JPAPlugin.onApplicationStart(JPAPlugin.java:267)
    at play.plugins.PluginCollection.onApplicationStart(PluginCollection.java:525)
    at play.Play.start(Play.java:526)
    at play.Play.detectChanges(Play.java:630)
    at play.Invoker$Invocation.init(Invoker.java:198)
    ... 1 more
    
  • Nicolas Leroux

    Nicolas Leroux May 23rd, 2012 @ 03:12 PM

    hibernate validator is included in play: hibernate-validator-4.1.0.Final.jar and indeed it is missing from framework/dependencies.yml. I will add it. You should not have any dependencies about hibernate in your project. I don't understand why it is trying to load hibernate 4.1 since it is no more part of play 1.2.x

  • Nicolas Leroux

    Nicolas Leroux May 23rd, 2012 @ 03:12 PM

    Btw I can run your project just fine.

  • Ron Gross

    Ron Gross May 23rd, 2012 @ 03:45 PM

    I added validator a long time ago because otherwise Play wouldn't validate my entities.
    When did Play start including validator?

    I will try updating to the latest Play version, and removing my dependency on hibernate.

  • Nicolas Leroux

    Nicolas Leroux May 23rd, 2012 @ 03:51 PM

    Not long ago. Actually you are right, maybe I should not include it. I think I included it because it was packaged with hibernate 3.6 but now that I think about it, I should not do so.

  • Nicolas Leroux

    Nicolas Leroux May 23rd, 2012 @ 03:56 PM

    I have just checked and there is a dependency from hibernate 3.6.10 on hibernate validator. Therefore hibernate validator will be included with play 1.2.5

  • Nicolas Leroux

    Nicolas Leroux May 23rd, 2012 @ 03:58 PM

    Is everything ok now for you?

  • Play Duck

    Play Duck May 24th, 2012 @ 12:38 PM

    (from [f1070eac985b3d8eba3b7ddda9a3c0c2895569a8]) [#1528] Dependency problem. Added hibernate validator in dependencies.yml as it is required by hibernate now https://github.com/playframework/play/commit/f1070eac985b3d8eba3b7d...

  • Nicolas Leroux

    Nicolas Leroux May 24th, 2012 @ 12:39 PM

    • State changed from “inprogress” to “resolved”
  • Ron Gross

    Ron Gross May 24th, 2012 @ 12:44 PM

    I am just testing this issue right now.

    It seems to be resolved, but upgrading to latest play 1.2.x now exposes a different issue with hibernate and this error:

    An unexpected error occured caused by exception TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: models.WebsiteConfig

    I am trying to reproduce it right now ... but I guess you're right, this bug can be closed, I will open another one when I have some more details (trying to reproduce in a stand alone example).

  • Nicolas Leroux
  • Ron Gross

    Ron Gross May 24th, 2012 @ 01:00 PM

    Thanks for the reference.
    I'm not sure whether this is the issue or not, I'll need to investigate some more. Our error message is different.

    It started when I applied these two changes:
    1. Removed explicit dependency on hibernate
    2. Migrated from play-1.2.4-mbknor-3 to latest 1.2.x branch (today, 24 May 2012, I pulled and built 1.2.x-04cb436).

  • Ron Gross

    Ron Gross May 28th, 2012 @ 08:07 AM

    @Nicolas, I believe there's a good chance my issue is indeed #1410.

    My problem involves updating a model that has a List of a SubModel, that has two maps (Map<String, SubSubModel1> and Map<String, SubSubModel2>).

    I will wait for a resolution of #1410, and attempt to apply it to my case.

    Thanks,
    Ron

  • Grzegorz Slowikowski

    Grzegorz Slowikowski June 1st, 2012 @ 07:39 AM

    • Milestone order changed from “74” to “0”

    I'm just trying 1.2.5rc4 version and I found hibernate-validator added as a dependency.
    This is not required dependency of hibernate-core. It's "test" dependency in fact and it was there (in hibernate-core's pom.xml file) for long time (it was there in 3.6.1.Final version used in Play! versions 1.2 - 1.2.4).
    Since it was not required by Play! since 1.2 version, it's not required now.

  • Nicolas Leroux

    Nicolas Leroux June 1st, 2012 @ 08:14 AM

    Well something must have changed because I cannot start hibernate without the validator lib. I will check that again.

  • gtbtfhftg
  • yoyo888

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.

Attachments

Pages