#705 ✓invalid
Peter Hilton

chat sample app compilation error

Reported by Peter Hilton | April 4th, 2011 @ 10:17 PM | in 1.2

I get the following compilation error when running samples-and-tests/chat/ on the current latest github version, master or 1.2.x branch.


$ ./play run samples-and-tests/chat/
~        _            _ 
~  _ __ | | __ _ _  _| |
~ | '_ \| |/ _' | || |_|
~ |  __/|_|\____|\__ (_)
~ |_|            |__/   
~
~ play! master-063c4d3, http://www.playframework.org
~
~ Ctrl+C to stop
~ 
Listening for transport dt_socket at address: 8000
00:10:36,448 INFO  ~ Starting /Users/peter/Documents/code/play/samples-and-tests/chat
00:10:38,392 WARN  ~ You're running Play! in DEV mode
00:10:38,834 INFO  ~ Listening for HTTP on port 9000 (Waiting a first request to start) ...
00:10:39,267 ERROR ~ Invalid route definition : WS /websocket/room/socket WebSocket.ChatRoomSocket.join
00:10:41,475 ERROR ~ 

@662fcedj3
Internal Server Error (500) for request GET /@documentation/

Compilation error (In /app/controllers/WebSocket.java around line 23)
The file /app/controllers/WebSocket.java could not be compiled. Error raised is : WebSocketController cannot be resolved to a type

play.exceptions.CompilationException: WebSocketController cannot be resolved to a type
    at play.classloading.ApplicationCompiler$2.acceptResult(ApplicationCompiler.java:246)
    at org.eclipse.jdt.internal.compiler.Compiler.handleInternalException(Compiler.java:672)
    at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:516)
    at play.classloading.ApplicationCompiler.compile(ApplicationCompiler.java:278)
    at play.classloading.ApplicationClassloader.getAllClasses(ApplicationClassloader.java:420)
    at play.Play.start(Play.java:419)
    at play.Play.detectChanges(Play.java:533)
    at play.Invoker$Invocation.init(Invoker.java:165)
    at Invocation.HTTP Request(Play!)

Comments and changes to this ticket

  • Guillaume Bort

    Guillaume Bort April 5th, 2011 @ 09:10 AM

    Are you sure that you're using Play 1.2RC? You log report master-063c4d3, that is a pretty old commit:

    https://github.com/playframework/play/commit/063c4d3

  • Peter Hilton

    Peter Hilton April 5th, 2011 @ 09:33 AM

    • State changed from “new” to “invalid”
    • Assigned user changed from “Guillaume Bort” to “Peter Hilton”

    Doh! Sorry, my bad.

  • Nicolas GIRARDIN

    Nicolas GIRARDIN May 18th, 2011 @ 11:45 AM

    I'd like to reopen this bug:
    - using the play-1.2.1.zip from the download page, the precompilation is OK but, - using play trunk I've got the same stack trace:

    gigi@gigi-laptop:~/Dev/workspace/test.play.sample.chat$ ../../play/play precompile
    ~ _ _ ~ _ | | _ _ | | ~ | ' \| |/ ' | || || ~ | /||_|_ () ~ |_| |__/
    ~ ~ play! master-7fe98ca, http://www.playframework.org ~ Listening for transport dt_socket at address: 8000
    13:13:46,237 INFO ~ Starting /home/gigi/Dev/workspace/test.play.sample.chat
    13:13:47,067 INFO ~ Precompiling ...
    13:13:50,602 ERROR ~

    @66ek396ki Cannot start in PROD mode with errors

    Oops: UnexpectedException
    An unexpected error occured caused by exception UnexpectedException: While applying class play.classloading.enhancers.PropertiesEnhancer on controllers.WebSocket$ChatRoomSocket

    play.exceptions.UnexpectedException: While applying play.CorePlugin@249c2715 on controllers.WebSocket$ChatRoomSocket

    at play.plugins.PluginCollection.enhance(PluginCollection.java:462)
    at play.classloading.ApplicationClasses$ApplicationClass.enhance(ApplicationClasses.java:208)
    at play.classloading.ApplicationClassloader.loadApplicationClass(ApplicationClassloader.java:163)
    at play.classloading.ApplicationClassloader.getAllClasses(ApplicationClassloader.java:427)
    at play.Play.preCompile(Play.java:562)
    at play.Play.init(Play.java:291)
    at play.server.Server.main(Server.java:158)
    

    Caused by: play.exceptions.UnexpectedException: While applying class play.classloading.enhancers.PropertiesEnhancer on controllers.WebSocket$ChatRoomSocket

    at play.CorePlugin.enhance(CorePlugin.java:301)
    at play.plugins.PluginCollection.enhance(PluginCollection.java:457)
    ... 6 more
    

    Caused by: javassist.CannotCompileException: invalid opcode address

    at javassist.expr.ExprEditor.doit(ExprEditor.java:116)
    at javassist.CtBehavior.instrument(CtBehavior.java:618)
    at play.classloading.enhancers.PropertiesEnhancer.enhanceThisClass(PropertiesEnhancer.java:133)
    at play.CorePlugin.enhance(CorePlugin.java:296)
    ... 7 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.expr.ExprEditor.doit(ExprEditor.java:112)
    ... 10 more
    
  • Nicolas GIRARDIN

    Nicolas GIRARDIN May 18th, 2011 @ 11:48 AM

    Sorry for the bad formatting on the previous comment! :s

    I'd like to reopen this bug:

    • using the play-1.2.1.zip from the download page, the precompilation is OK but,

    • using play trunk I've got the same stack trace:

    gigi@gigi-laptop:~/Dev/workspace/test.play.sample.chat$ ../../play/play precompile
    ~        _            _ 
    ~  _ __ | | __ _ _  _| |
    ~ | '_ \| |/ _' | || |_|
    ~ |  __/|_|\____|\__ (_)
    ~ |_|            |__/   
    ~
    ~ play! master-7fe98ca, http://www.playframework.org
    ~
    Listening for transport dt_socket at address: 8000
    13:13:46,237 INFO  ~ Starting /home/gigi/Dev/workspace/test.play.sample.chat
    13:13:47,067 INFO  ~ Precompiling ...
    13:13:50,602 ERROR ~ 
    
    @66ek396ki
    Cannot start in PROD mode with errors
    
    Oops: UnexpectedException
    An unexpected error occured caused by exception UnexpectedException: While applying class play.classloading.enhancers.PropertiesEnhancer on controllers.WebSocket$ChatRoomSocket
    
    play.exceptions.UnexpectedException: While applying play.CorePlugin@249c2715 on controllers.WebSocket$ChatRoomSocket
        at play.plugins.PluginCollection.enhance(PluginCollection.java:462)
        at play.classloading.ApplicationClasses$ApplicationClass.enhance(ApplicationClasses.java:208)
        at play.classloading.ApplicationClassloader.loadApplicationClass(ApplicationClassloader.java:163)
        at play.classloading.ApplicationClassloader.getAllClasses(ApplicationClassloader.java:427)
        at play.Play.preCompile(Play.java:562)
        at play.Play.init(Play.java:291)
        at play.server.Server.main(Server.java:158)
    Caused by: play.exceptions.UnexpectedException: While applying class play.classloading.enhancers.PropertiesEnhancer on controllers.WebSocket$ChatRoomSocket
        at play.CorePlugin.enhance(CorePlugin.java:301)
        at play.plugins.PluginCollection.enhance(PluginCollection.java:457)
        ... 6 more
    Caused by: javassist.CannotCompileException: invalid opcode address
        at javassist.expr.ExprEditor.doit(ExprEditor.java:116)
        at javassist.CtBehavior.instrument(CtBehavior.java:618)
        at play.classloading.enhancers.PropertiesEnhancer.enhanceThisClass(PropertiesEnhancer.java:133)
        at play.CorePlugin.enhance(CorePlugin.java:296)
        ... 7 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.expr.ExprEditor.doit(ExprEditor.java:112)
        ... 10 more
    
  • Lukasz

    Lukasz October 19th, 2011 @ 07:35 AM

    • Tag changed from samples to chat, samples

    Hi, I have the same error as Nicolas with current Play! version (master-5b41faa). The chat sample application does not start. Any ideas how to solve this?

    Thanks, Lukasz

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.

Tags

Pages