await() method causing UnexpectedException

172 views
Skip to first unread message

My Head Hurts

unread,
Jun 1, 2011, 8:10:03 AM6/1/11
to play-framework
Hi

I was wondering if you may be able to help me better understand the
way await() is used.

When I use the example below, from the Play documentation ( * I am
using a different method name * ), I receive an UnexpectedException
error.

public static void loopWithoutBlocking() {
for(int i=0; i<=10; i++) {
Logger.info(i);
await("1s");
}
renderText("Loop finished");
}

---------------------------------------

The error is as follows:


Oops: UnexpectedException

An unexpected error occured caused by exception UnexpectedException:
While applying class play.classloading.enhancers.ContinuationEnhancer
on controllers.Application

--------------------------------------


The example method above is placed within the Application controller
and I have included the play.libs.F library.

Does the method using the await() call need to be nested within
something deeper?

( I am using Play 1.2.1 )

My Head Hurts

unread,
Jun 1, 2011, 9:37:00 AM6/1/11
to play-framework
I would be grateful for any hints or tips on this one. I have checked
the https://github.com/playframework/play/tree/master/samples-and-tests/chat
example and I cannot find anything in the config files or anything in
the code that helps me understand what I am currently doing wrong.

I have tried calling the await() method using a direct call
[ play.mvc.Controller.await( ... ) ] but I am still not having any
success.

Is there something in addition that needs to be installed?

Thank you for your time.

Julien Tournay

unread,
Jun 1, 2011, 9:47:17 AM6/1/11
to play-fr...@googlegroups.com
Is Application extending Controller or WebSocketController ?

jto


--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.




--
Real Programmers don't need comments-- the code is obvious.

My Head Hurts

unread,
Jun 1, 2011, 9:56:38 AM6/1/11
to play-framework
Hi Julien

I am not sure if my last message sent to you or not as it is taking a
little time to come up.

Application is currently extending Controller.

Thank you for your response.

On Jun 1, 2:47 pm, Julien Tournay <boudhe...@gmail.com> wrote:
> Is Application extending Controller or WebSocketController ?
>
> jto
>

My Head Hurts

unread,
Jun 1, 2011, 10:11:15 AM6/1/11
to play-framework
This is the error stack that I receive:

Oops: UnexpectedException
An unexpected error occured caused by exception UnexpectedException:
While applying class play.classloading.enhancers.ContinuationEnhancer
on controllers.Application

play.exceptions.UnexpectedException: While applying
play.CorePlugin@a53de4 on controllers.Application
at play.plugins.PluginCollection.enhance(PluginCollection.java:
437)
at play.classloading.ApplicationClasses
$ApplicationClass.enhance(ApplicationClasses.java:208)
at
play.classloading.ApplicationClassloader.loadApplicationClass(ApplicationClassloader.java:
151)
at
play.classloading.ApplicationClassloader.getAllClasses(ApplicationClassloader.java:
409)
at play.Play.start(Play.java:453)
at play.Play.detectChanges(Play.java:563)
at play.Invoker$Invocation.init(Invoker.java:186)
at Invocation.HTTP Request(Play!)
Caused by: play.exceptions.UnexpectedException: While applying class
play.classloading.enhancers.ContinuationEnhancer on
controllers.Application
at play.CorePlugin.enhance(CorePlugin.java:299)
at play.plugins.PluginCollection.enhance(PluginCollection.java:
434)
... 7 more
Caused by: java.lang.IllegalArgumentException: Invalid operand (must
be a signedbyte): 128
at
org.objectweb.asm.util.CheckMethodAdapter.checkSignedByte(Unknown
Source)
at
org.objectweb.asm.util.CheckMethodAdapter.visitIntInsn(Unknown Source)
at
org.apache.commons.javaflow.bytecode.transformation.asm.ContinuationMethodAdapter.visitMethodInsn(ContinuationMethodAdapter.java:
279)
at org.objectweb.asm.tree.MethodInsnNode.accept(Unknown
Source)
at org.objectweb.asm.tree.InsnList.accept(Unknown Source)
at org.objectweb.asm.tree.MethodNode.accept(Unknown Source)
at
org.apache.commons.javaflow.bytecode.transformation.asm.ContinuationMethodAnalyzer.visitEnd(ContinuationMethodAnalyzer.java:
140)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at
org.apache.commons.javaflow.bytecode.transformation.asm.AsmClassTransformer.transform(AsmClassTransformer.java:
49)
at
org.apache.commons.javaflow.bytecode.transformation.asm.AsmClassTransformer.transform(AsmClassTransformer.java:
41)
at
play.classloading.enhancers.ContinuationEnhancer.enhanceThisClass(ContinuationEnhancer.java:
62)
at play.CorePlugin.enhance(CorePlugin.java:296)
... 8 more

My Head Hurts

unread,
Jun 1, 2011, 11:48:00 AM6/1/11
to play-framework
This issue is now closed.

There seemed to be code conflicting in a seperate method in the
Application class.

It was a good excuse to tidy up some code, but I never really found
out what the actual cause of this issue was.
Reply all
Reply to author
Forward
0 new messages