[appengine-java] Re: Compile and execute at runtime

2009-09-12 Thread Clint

I'm having a similar issue when using the Janino compiler in Drools,
(after I patched Drools' use of unauthorized class loader behavior,
that is).  I'd like to understand better how to patch Janino?

On Aug 31, 11:08 am, Toby Reyelts  wrote:
> Thanks for filing the issue. As it stands right now, you won't be able to
> load any classes from javax.tools, regardless of whether your intent is or
> is not to write to the file system. If you want to implement the javax.tools
> API, you'll need to use a different package (e.g. my.javax.tools.*). Another
> possibility is that you can patch janino's
> ReflectionIClass.getDeclaredIClasses2 to work without reflection. You should
> be able to get access to the declared classes just by looking at the class
> files corresponding to a class.
>
> On Sat, Aug 29, 2009 at 9:17 AM, Albert Attard wrote:
>
> > Hey Toby:
>
> > Hope you had a nice weekend.
>
> > Just did: issue 
> > 2042
> > What other option do I have? Is it possible to include a library (a jar
> > file) similar to janino which makes use of the *javax.tools* but does not
> > write to the file system? All persistence happens to the datastore similar
> > to the: gaevfs . I was thinking of
> > writing a small API using the *javax.tools* and expose an interface. Then
> > will use this interface to compile and execute code at runtime.
>
> > Possible?
> > Albert Attard
>
> > Stephen 
> > Leacock - 
> > "I detest life-insurance agents: they always argue that I shall some day
> > die, which is not so."
>
> > 2009/8/29 Toby Reyelts 
>
> > Hey Albert,
>
> >> I've tracked this down to an oversight on our part. Mind filing an issue?
>
> >> On Fri, Aug 28, 2009 at 3:06 AM, Albert Attard 
> >> wrote:
>
> >>> Hey Toby:
> >>> Thanks for your input.
>
> >>> Following is the stack trace for the other problem I was talking about.
> >>> Locally Janino compiles this without any issues, but it's throwing the
> >>> following exception when executed on the app-engine.
>
> >>> JaninoJavaAssessorHelper compile: THROW
> >>> java.security.AccessControlException: access denied 
> >>> (java.lang.RuntimePermission accessDeclaredMembers)
> >>>    at java.security.AccessControlContext.checkPermission(Unknown Source)
> >>>    at java.security.AccessController.checkPermission(Unknown Source)
> >>>    at java.lang.SecurityManager.checkPermission(Unknown Source)
> >>>    at java.lang.SecurityManager.checkMemberAccess(Unknown Source)
> >>>    at java.lang.Class.checkMemberAccess(Unknown Source)
> >>>    at java.lang.Class.getDeclaredClasses(Unknown Source)
> >>>    at 
> >>> org.codehaus.janino.ReflectionIClass.getDeclaredIClasses2(ReflectionIClass.java:101)
> >>>    at org.codehaus.janino.IClass.getDeclaredIClasses(IClass.java:252)
> >>>    at org.codehaus.janino.IClass.findMemberType(IClass.java:617)
> >>>    at org.codehaus.janino.IClass.findMemberType(IClass.java:634)
> >>>    at org.codehaus.janino.IClass.findMemberType(IClass.java:604)
> >>>    at 
> >>> org.codehaus.janino.UnitCompiler.findMemberType(UnitCompiler.java:8011)
> >>>    at org.codehaus.janino.UnitCompiler.getType2(UnitCompiler.java:4022)
> >>>    at org.codehaus.janino.UnitCompiler.access$102(UnitCompiler.java:3990)
> >>>    at 
> >>> org.codehaus.janino.UnitCompiler$16.visitReferenceType(UnitCompiler.java:3936)
> >>>    at org.codehaus.janino.Java$ReferenceType.accept(Java.java:1868)
> >>>    at org.codehaus.janino.UnitCompiler.getType(UnitCompiler.java:3969)
> >>>    at org.codehaus.janino.UnitCompiler.access$136(UnitCompiler.java:3927)
> >>>    at 
> >>> org.codehaus.janino.UnitCompiler$31.getParameterTypes(UnitCompiler.java:6674)
> >>>    at org.codehaus.janino.IClass$IMethod.getDescriptor(IClass.java:762)
> >>>    at org.codehaus.janino.IClass.getIMethods(IClass.java:180)
> >>>    at org.codehaus.janino.IClass.getIMethods(IClass.java:169)
> >>>    at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:328)
> >>>    at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:313)
> >>>    at 
> >>> org.codehaus.janino.UnitCompiler$3.visitPackageMemberClassDeclaration(UnitCompiler.java:286)
> >>>    at 
> >>> org.codehaus.janino.Java$PackageMemberClassDeclaration.accept(Java.java:701)
> >>>    at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:292)
> >>>    at org.codehaus.janino.UnitCompiler.compileUnit(UnitCompiler.java:270)
> >>>    at 
> >>> org.codehaus.janino.SimpleCompiler.compileToClassLoader(SimpleCompiler.java:423)
> >>>    at org.codehaus.janino.SimpleCompiler.cook(SimpleCompiler.java:231)
> >>>    at org.codehaus.janino.Cookable.cook(Cookable.java:72)
> >>>    at org.codehaus.janino.Cookable.cook(Cookable.java:64)
> >>>    at org.codehaus.janino.Cookable.cook(Cookable.java:114)
> >>>    at 
> >>> com.albertattard.askme.server.utils.JaninoJavaAssessorHelper.compile(JaninoJavaAssess

[appengine-java] Re: Compile and execute at runtime

2009-08-28 Thread Toby Reyelts
Hey Albert,

I've tracked this down to an oversight on our part. Mind filing an issue?

On Fri, Aug 28, 2009 at 3:06 AM, Albert Attard wrote:

> Hey Toby:
> Thanks for your input.
>
> Following is the stack trace for the other problem I was talking about.
> Locally Janino compiles this without any issues, but it's throwing the
> following exception when executed on the app-engine.
>
> JaninoJavaAssessorHelper compile: THROW
> java.security.AccessControlException: access denied 
> (java.lang.RuntimePermission accessDeclaredMembers)
>   at java.security.AccessControlContext.checkPermission(Unknown Source)
>   at java.security.AccessController.checkPermission(Unknown Source)
>   at java.lang.SecurityManager.checkPermission(Unknown Source)
>   at java.lang.SecurityManager.checkMemberAccess(Unknown Source)
>   at java.lang.Class.checkMemberAccess(Unknown Source)
>   at java.lang.Class.getDeclaredClasses(Unknown Source)
>   at 
> org.codehaus.janino.ReflectionIClass.getDeclaredIClasses2(ReflectionIClass.java:101)
>   at org.codehaus.janino.IClass.getDeclaredIClasses(IClass.java:252)
>   at org.codehaus.janino.IClass.findMemberType(IClass.java:617)
>   at org.codehaus.janino.IClass.findMemberType(IClass.java:634)
>   at org.codehaus.janino.IClass.findMemberType(IClass.java:604)
>   at 
> org.codehaus.janino.UnitCompiler.findMemberType(UnitCompiler.java:8011)
>   at org.codehaus.janino.UnitCompiler.getType2(UnitCompiler.java:4022)
>   at org.codehaus.janino.UnitCompiler.access$102(UnitCompiler.java:3990)
>   at 
> org.codehaus.janino.UnitCompiler$16.visitReferenceType(UnitCompiler.java:3936)
>   at org.codehaus.janino.Java$ReferenceType.accept(Java.java:1868)
>   at org.codehaus.janino.UnitCompiler.getType(UnitCompiler.java:3969)
>   at org.codehaus.janino.UnitCompiler.access$136(UnitCompiler.java:3927)
>   at 
> org.codehaus.janino.UnitCompiler$31.getParameterTypes(UnitCompiler.java:6674)
>   at org.codehaus.janino.IClass$IMethod.getDescriptor(IClass.java:762)
>   at org.codehaus.janino.IClass.getIMethods(IClass.java:180)
>   at org.codehaus.janino.IClass.getIMethods(IClass.java:169)
>   at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:328)
>   at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:313)
>   at 
> org.codehaus.janino.UnitCompiler$3.visitPackageMemberClassDeclaration(UnitCompiler.java:286)
>   at 
> org.codehaus.janino.Java$PackageMemberClassDeclaration.accept(Java.java:701)
>   at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:292)
>   at org.codehaus.janino.UnitCompiler.compileUnit(UnitCompiler.java:270)
>   at 
> org.codehaus.janino.SimpleCompiler.compileToClassLoader(SimpleCompiler.java:423)
>   at org.codehaus.janino.SimpleCompiler.cook(SimpleCompiler.java:231)
>   at org.codehaus.janino.Cookable.cook(Cookable.java:72)
>   at org.codehaus.janino.Cookable.cook(Cookable.java:64)
>   at org.codehaus.janino.Cookable.cook(Cookable.java:114)
>   at 
> com.albertattard.askme.server.utils.JaninoJavaAssessorHelper.compile(JaninoJavaAssessorHelper.java:30)
>   at 
> com.albertattard.askme.server.BuilderServiceImpl.validateAssessor(BuilderServiceImpl.java:40)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>   at java.lang.reflect.Method.invoke(Unknown Source)
>   at 
> com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.Method_$3.run(Method_.java:149)
>   at java.security.AccessController.doPrivileged(Native Method)
>   at 
> com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.Method_.privilegedInvoke(Method_.java:147)
>   at 
> com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.Method_.invoke(Method_.java:120)
>   at 
> com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:527)
>   at 
> com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:166)
>   at 
> com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
>   at 
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
>   at 
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
>   at 
> com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
>   at 
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
>   at 
> com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
>   at 
> org.mortbay.jetty.ser

[appengine-java] Re: Compile and execute at runtime

2009-08-28 Thread Albert Attard
Hey Toby:
Thanks for your input.

Following is the stack trace for the other problem I was talking about.
Locally Janino compiles this without any issues, but it's throwing the
following exception when executed on the app-engine.

JaninoJavaAssessorHelper compile: THROW
java.security.AccessControlException: access denied
(java.lang.RuntimePermission accessDeclaredMembers)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkMemberAccess(Unknown Source)
at java.lang.Class.checkMemberAccess(Unknown Source)
at java.lang.Class.getDeclaredClasses(Unknown Source)
at 
org.codehaus.janino.ReflectionIClass.getDeclaredIClasses2(ReflectionIClass.java:101)
at org.codehaus.janino.IClass.getDeclaredIClasses(IClass.java:252)
at org.codehaus.janino.IClass.findMemberType(IClass.java:617)
at org.codehaus.janino.IClass.findMemberType(IClass.java:634)
at org.codehaus.janino.IClass.findMemberType(IClass.java:604)
at 
org.codehaus.janino.UnitCompiler.findMemberType(UnitCompiler.java:8011)
at org.codehaus.janino.UnitCompiler.getType2(UnitCompiler.java:4022)
at org.codehaus.janino.UnitCompiler.access$102(UnitCompiler.java:3990)
at 
org.codehaus.janino.UnitCompiler$16.visitReferenceType(UnitCompiler.java:3936)
at org.codehaus.janino.Java$ReferenceType.accept(Java.java:1868)
at org.codehaus.janino.UnitCompiler.getType(UnitCompiler.java:3969)
at org.codehaus.janino.UnitCompiler.access$136(UnitCompiler.java:3927)
at 
org.codehaus.janino.UnitCompiler$31.getParameterTypes(UnitCompiler.java:6674)
at org.codehaus.janino.IClass$IMethod.getDescriptor(IClass.java:762)
at org.codehaus.janino.IClass.getIMethods(IClass.java:180)
at org.codehaus.janino.IClass.getIMethods(IClass.java:169)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:328)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:313)
at 
org.codehaus.janino.UnitCompiler$3.visitPackageMemberClassDeclaration(UnitCompiler.java:286)
at 
org.codehaus.janino.Java$PackageMemberClassDeclaration.accept(Java.java:701)
at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:292)
at org.codehaus.janino.UnitCompiler.compileUnit(UnitCompiler.java:270)
at 
org.codehaus.janino.SimpleCompiler.compileToClassLoader(SimpleCompiler.java:423)
at org.codehaus.janino.SimpleCompiler.cook(SimpleCompiler.java:231)
at org.codehaus.janino.Cookable.cook(Cookable.java:72)
at org.codehaus.janino.Cookable.cook(Cookable.java:64)
at org.codehaus.janino.Cookable.cook(Cookable.java:114)
at 
com.albertattard.askme.server.utils.JaninoJavaAssessorHelper.compile(JaninoJavaAssessorHelper.java:30)
at 
com.albertattard.askme.server.BuilderServiceImpl.validateAssessor(BuilderServiceImpl.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at 
com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.Method_$3.run(Method_.java:149)
at java.security.AccessController.doPrivileged(Native Method)
at 
com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.Method_.privilegedInvoke(Method_.java:147)
at 
com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.Method_.invoke(Method_.java:120)
at 
com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:527)
at 
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:166)
at 
com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at 
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
at 
com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at 
com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at 
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
at 
org.mortbay.jetty.security.SecurityHandl

[appengine-java] Re: Compile and execute at runtime

2009-08-28 Thread Albert Attard
Just to clarify, the dynamic code (the code compiled by Janino) have an
intentional error. Locally I get the line number etc., which is great for
the user. I cannot get this information on the app-engine.
Sorry for the confusion.

Albert Attard

Charles de 
Gaulle
- "The better I get to know men, the more I find myself loving dogs."

2009/8/28 Albert Attard 

> Hey Toby:
> Thanks for your input.
>
> Following is the stack trace for the other problem I was talking about.
> Locally Janino compiles this without any issues, but it's throwing the
> following exception when executed on the app-engine.
>
> JaninoJavaAssessorHelper compile: THROW
> java.security.AccessControlException: access denied 
> (java.lang.RuntimePermission accessDeclaredMembers)
>   at java.security.AccessControlContext.checkPermission(Unknown Source)
>   at java.security.AccessController.checkPermission(Unknown Source)
>   at java.lang.SecurityManager.checkPermission(Unknown Source)
>   at java.lang.SecurityManager.checkMemberAccess(Unknown Source)
>   at java.lang.Class.checkMemberAccess(Unknown Source)
>   at java.lang.Class.getDeclaredClasses(Unknown Source)
>   at 
> org.codehaus.janino.ReflectionIClass.getDeclaredIClasses2(ReflectionIClass.java:101)
>   at org.codehaus.janino.IClass.getDeclaredIClasses(IClass.java:252)
>   at org.codehaus.janino.IClass.findMemberType(IClass.java:617)
>   at org.codehaus.janino.IClass.findMemberType(IClass.java:634)
>   at org.codehaus.janino.IClass.findMemberType(IClass.java:604)
>   at 
> org.codehaus.janino.UnitCompiler.findMemberType(UnitCompiler.java:8011)
>   at org.codehaus.janino.UnitCompiler.getType2(UnitCompiler.java:4022)
>   at org.codehaus.janino.UnitCompiler.access$102(UnitCompiler.java:3990)
>   at 
> org.codehaus.janino.UnitCompiler$16.visitReferenceType(UnitCompiler.java:3936)
>   at org.codehaus.janino.Java$ReferenceType.accept(Java.java:1868)
>   at org.codehaus.janino.UnitCompiler.getType(UnitCompiler.java:3969)
>   at org.codehaus.janino.UnitCompiler.access$136(UnitCompiler.java:3927)
>   at 
> org.codehaus.janino.UnitCompiler$31.getParameterTypes(UnitCompiler.java:6674)
>   at org.codehaus.janino.IClass$IMethod.getDescriptor(IClass.java:762)
>   at org.codehaus.janino.IClass.getIMethods(IClass.java:180)
>   at org.codehaus.janino.IClass.getIMethods(IClass.java:169)
>   at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:328)
>   at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:313)
>   at 
> org.codehaus.janino.UnitCompiler$3.visitPackageMemberClassDeclaration(UnitCompiler.java:286)
>   at 
> org.codehaus.janino.Java$PackageMemberClassDeclaration.accept(Java.java:701)
>   at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:292)
>   at org.codehaus.janino.UnitCompiler.compileUnit(UnitCompiler.java:270)
>   at 
> org.codehaus.janino.SimpleCompiler.compileToClassLoader(SimpleCompiler.java:423)
>   at org.codehaus.janino.SimpleCompiler.cook(SimpleCompiler.java:231)
>   at org.codehaus.janino.Cookable.cook(Cookable.java:72)
>   at org.codehaus.janino.Cookable.cook(Cookable.java:64)
>   at org.codehaus.janino.Cookable.cook(Cookable.java:114)
>   at 
> com.albertattard.askme.server.utils.JaninoJavaAssessorHelper.compile(JaninoJavaAssessorHelper.java:30)
>   at 
> com.albertattard.askme.server.BuilderServiceImpl.validateAssessor(BuilderServiceImpl.java:40)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>   at java.lang.reflect.Method.invoke(Unknown Source)
>   at 
> com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.Method_$3.run(Method_.java:149)
>   at java.security.AccessController.doPrivileged(Native Method)
>   at 
> com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.Method_.privilegedInvoke(Method_.java:147)
>   at 
> com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.Method_.invoke(Method_.java:120)
>   at 
> com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:527)
>   at 
> com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:166)
>   at 
> com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
>   at 
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
>   at 
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
>   at 
> com.google.apphosting.runtime.jetty.SaveSessionFilter.doFi

[appengine-java] Re: Compile and execute at runtime

2009-08-27 Thread Toby Reyelts
Logger.throwing logs at Level.FINER. Do you have your logging configured to
log at that level (or more fine)?

On Thu, Aug 27, 2009 at 2:20 PM, Albert Attard wrote:

> Hey Toby:
> I'm having some trouble with the logging functionality. I'm logging my
> exceptions but nothing is showing on the logs. Following a simple class
> which uses logging.
>
>  private static final Logger log =
> Logger.getLogger(MyClass.class.getName());
>
>  ...
>  }catch(Exception e)
> log.throwing("MyClass", "MyMethod", e);
>  }
>
> Am I missing something?
>
> Regards,
> Albert Attard
>
> Pablo Picasso 
> - "Computers are useless. They can only give you answers."
>
> 2009/8/26 Toby Reyelts 
>
>> Can you provide the full stacktrace for the exception?
>>
>>
>> On Wed, Aug 26, 2009 at 2:58 PM, Albert Attard wrote:
>>
>>> Hey Toby:
>>> Did as you instructed and worked. Thanks a lot Toby. Let me know should
>>> you need anything. I'm glad to help.
>>>
>>>
>>> Another question about Janino: I'm getting the following exception on the
>>> live app-engine when the dynamic code (the code that is compiled by janino)
>>> has a compilation error:
>>>
>>> An error occurred: java.security.AccessControlException: access denied
>>> (java.lang.RuntimePermissions accessDeclaredMembers)
>>>
>>>
>>> On the local environment, janino returns the line number where the error
>>> occurred, which is very helpful for the students.
>>>
>>> Cheers,
>>> Albert Attard
>>>
>>> Samuel 
>>> Goldwyn - 
>>> "I'm willing to admit that I may not always be right, but I am never
>>> wrong."
>>>
>>> 2009/8/26 Toby Reyelts 
>>>
>>>
 Hey Albert,

 Even though I haven't actually seen the changes that you made, I believe
 they were unnecessary. (Go out on a limb with me here). I tracked the fault
 down to an error in our runtime that can be worked around by just
 recompiling the code. You should be able to confirm this on your end by
 recompiling Janino from source *without* any of the changes you made.
 Please make sure you've set the target version to 1.5 or 1.6.

 On Wed, Aug 26, 2009 at 4:51 AM, Albert Attard 
 wrote:

> Hey Toby:
> Janino api include classes that are not supported by the app-engine.
> All I did is commented out the code that the app-engine didn't like in
> janino and repackaged it.
>
> I did the following:
>
>- Downloaded the source for janino:
>http://www.janino.net/download/janino-2.5.15.zip
>- I've created a new Google Web Project in Eclipse
>- I've copied the source into the Google Web Project
>- Than I've *unsafely* commented out code that was not supported by
>the Google app-engine
>- Repackaged the edited code into a new jar and deployed it with my
>project instead of the original one
>- The simple proof of concept seams to work
>
> As you can see at the simple demo: http://ask-me.appspot.com/ the code
> seams to work. Hope you manage to complete this question :)
>
> Cheers,
> Albert Attard
>
> Stephen 
> Leacock 
> - "I detest life-insurance agents: they always argue that I shall some day
> die, which is not so."
>
> 2009/8/25 Toby Reyelts 
>
> Hey Albert,
>>
>> That code should actually work ok, but you've managed to tickle a bug
>> in our runtime. I've filed an 
>> issuefor 
>> you here. The fix for this probably won't make the next release, but it
>> should come shortly thereafter.
>>
>>
>> On Tue, Aug 25, 2009 at 6:33 AM, Albert Attard <
>> albertatt...@gmail.com> wrote:
>>
>>> Hi  Toby:
>>> Thanks for you feedback.
>>>
>>> I've did a small prototype: http://ask-me.appspot.com/ . It's
>>> working fine locally, but it's throwing the following exception when
>>> executed on the app-engine:
>>>
>>> javax.servlet.ServletContext log: Exception while dispatching
>>> incoming RPC call
>>> com.google.gwt.user.server.rpc.UnexpectedException: Service method
>>> 'public abstract com.albertattard.askme.client.utils.AssessmentTO
>>> com.albertattard.askme.client.AssessorService.assessCode(java.lang.String)'
>>> threw an unexpected exception: java.lang.VerifyError: (class:
>>> org/codehaus/janino/ByteArrayClassLoader, method: findClass signature:
>>> (Ljava/lang/String;)Ljava/lang/Class;) Illegal type in constant pool
>>>  at
>>> com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:360)
>>> at
>>> com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:546)
>>>  at
>>> com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteService

[appengine-java] Re: Compile and execute at runtime

2009-08-27 Thread Albert Attard
Hey Toby:
I'm having some trouble with the logging functionality. I'm logging my
exceptions but nothing is showing on the logs. Following a simple class
which uses logging.

 private static final Logger log =
Logger.getLogger(MyClass.class.getName());

 ...
}catch(Exception e)
log.throwing("MyClass", "MyMethod", e);
}

Am I missing something?

Regards,
Albert Attard

Pablo Picasso
- "Computers are useless. They can only give you answers."

2009/8/26 Toby Reyelts 

> Can you provide the full stacktrace for the exception?
>
>
> On Wed, Aug 26, 2009 at 2:58 PM, Albert Attard wrote:
>
>> Hey Toby:
>> Did as you instructed and worked. Thanks a lot Toby. Let me know should
>> you need anything. I'm glad to help.
>>
>>
>> Another question about Janino: I'm getting the following exception on the
>> live app-engine when the dynamic code (the code that is compiled by janino)
>> has a compilation error:
>>
>> An error occurred: java.security.AccessControlException: access denied
>> (java.lang.RuntimePermissions accessDeclaredMembers)
>>
>>
>> On the local environment, janino returns the line number where the error
>> occurred, which is very helpful for the students.
>>
>> Cheers,
>> Albert Attard
>>
>> Samuel 
>> Goldwyn - 
>> "I'm willing to admit that I may not always be right, but I am never
>> wrong."
>>
>> 2009/8/26 Toby Reyelts 
>>
>>
>>> Hey Albert,
>>>
>>> Even though I haven't actually seen the changes that you made, I believe
>>> they were unnecessary. (Go out on a limb with me here). I tracked the fault
>>> down to an error in our runtime that can be worked around by just
>>> recompiling the code. You should be able to confirm this on your end by
>>> recompiling Janino from source *without* any of the changes you made.
>>> Please make sure you've set the target version to 1.5 or 1.6.
>>>
>>> On Wed, Aug 26, 2009 at 4:51 AM, Albert Attard 
>>> wrote:
>>>
 Hey Toby:
 Janino api include classes that are not supported by the app-engine. All
 I did is commented out the code that the app-engine didn't like in janino
 and repackaged it.

 I did the following:

- Downloaded the source for janino:
http://www.janino.net/download/janino-2.5.15.zip
- I've created a new Google Web Project in Eclipse
- I've copied the source into the Google Web Project
- Than I've *unsafely* commented out code that was not supported by
the Google app-engine
- Repackaged the edited code into a new jar and deployed it with my
project instead of the original one
- The simple proof of concept seams to work

 As you can see at the simple demo: http://ask-me.appspot.com/ the code
 seams to work. Hope you manage to complete this question :)

 Cheers,
 Albert Attard

 Stephen 
 Leacock 
 - "I detest life-insurance agents: they always argue that I shall some day
 die, which is not so."

 2009/8/25 Toby Reyelts 

 Hey Albert,
>
> That code should actually work ok, but you've managed to tickle a bug
> in our runtime. I've filed an 
> issuefor 
> you here. The fix for this probably won't make the next release, but it
> should come shortly thereafter.
>
>
> On Tue, Aug 25, 2009 at 6:33 AM, Albert Attard  > wrote:
>
>> Hi  Toby:
>> Thanks for you feedback.
>>
>> I've did a small prototype: http://ask-me.appspot.com/ . It's working
>> fine locally, but it's throwing the following exception when executed on 
>> the
>> app-engine:
>>
>> javax.servlet.ServletContext log: Exception while dispatching incoming
>> RPC call
>> com.google.gwt.user.server.rpc.UnexpectedException: Service method
>> 'public abstract com.albertattard.askme.client.utils.AssessmentTO
>> com.albertattard.askme.client.AssessorService.assessCode(java.lang.String)'
>> threw an unexpected exception: java.lang.VerifyError: (class:
>> org/codehaus/janino/ByteArrayClassLoader, method: findClass signature:
>> (Ljava/lang/String;)Ljava/lang/Class;) Illegal type in constant pool
>>  at
>> com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:360)
>> at
>> com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:546)
>>  at
>> com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:166)
>> at
>> com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)
>>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
>>  at
>> org.mortbay.jetty.servlet.ServletHolder.handle(

[appengine-java] Re: Compile and execute at runtime

2009-08-26 Thread Toby Reyelts
Can you provide the full stacktrace for the exception?

On Wed, Aug 26, 2009 at 2:58 PM, Albert Attard wrote:

> Hey Toby:
> Did as you instructed and worked. Thanks a lot Toby. Let me know should you
> need anything. I'm glad to help.
>
>
> Another question about Janino: I'm getting the following exception on the
> live app-engine when the dynamic code (the code that is compiled by janino)
> has a compilation error:
>
> An error occurred: java.security.AccessControlException: access denied
> (java.lang.RuntimePermissions accessDeclaredMembers)
>
>
> On the local environment, janino returns the line number where the error
> occurred, which is very helpful for the students.
>
> Cheers,
> Albert Attard
>
> Samuel 
> Goldwyn - 
> "I'm willing to admit that I may not always be right, but I am never
> wrong."
>
> 2009/8/26 Toby Reyelts 
>
>
>> Hey Albert,
>>
>> Even though I haven't actually seen the changes that you made, I believe
>> they were unnecessary. (Go out on a limb with me here). I tracked the fault
>> down to an error in our runtime that can be worked around by just
>> recompiling the code. You should be able to confirm this on your end by
>> recompiling Janino from source *without* any of the changes you made.
>> Please make sure you've set the target version to 1.5 or 1.6.
>>
>> On Wed, Aug 26, 2009 at 4:51 AM, Albert Attard wrote:
>>
>>> Hey Toby:
>>> Janino api include classes that are not supported by the app-engine. All
>>> I did is commented out the code that the app-engine didn't like in janino
>>> and repackaged it.
>>>
>>> I did the following:
>>>
>>>- Downloaded the source for janino:
>>>http://www.janino.net/download/janino-2.5.15.zip
>>>- I've created a new Google Web Project in Eclipse
>>>- I've copied the source into the Google Web Project
>>>- Than I've *unsafely* commented out code that was not supported by
>>>the Google app-engine
>>>- Repackaged the edited code into a new jar and deployed it with my
>>>project instead of the original one
>>>- The simple proof of concept seams to work
>>>
>>> As you can see at the simple demo: http://ask-me.appspot.com/ the code
>>> seams to work. Hope you manage to complete this question :)
>>>
>>> Cheers,
>>> Albert Attard
>>>
>>> Stephen 
>>> Leacock - 
>>> "I detest life-insurance agents: they always argue that I shall some day
>>> die, which is not so."
>>>
>>> 2009/8/25 Toby Reyelts 
>>>
>>> Hey Albert,

 That code should actually work ok, but you've managed to tickle a bug in
 our runtime. I've filed an 
 issuefor 
 you here. The fix for this probably won't make the next release, but it
 should come shortly thereafter.


 On Tue, Aug 25, 2009 at 6:33 AM, Albert Attard 
 wrote:

> Hi  Toby:
> Thanks for you feedback.
>
> I've did a small prototype: http://ask-me.appspot.com/ . It's working
> fine locally, but it's throwing the following exception when executed on 
> the
> app-engine:
>
> javax.servlet.ServletContext log: Exception while dispatching incoming
> RPC call
> com.google.gwt.user.server.rpc.UnexpectedException: Service method
> 'public abstract com.albertattard.askme.client.utils.AssessmentTO
> com.albertattard.askme.client.AssessorService.assessCode(java.lang.String)'
> threw an unexpected exception: java.lang.VerifyError: (class:
> org/codehaus/janino/ByteArrayClassLoader, method: findClass signature:
> (Ljava/lang/String;)Ljava/lang/Class;) Illegal type in constant pool
>  at
> com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:360)
> at
> com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:546)
>  at
> com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:166)
> at
> com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
>  at
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
> at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
>  at
> com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
> at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
>  at
> com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
> at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
>  at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
> 

[appengine-java] Re: Compile and execute at runtime

2009-08-26 Thread Albert Attard
Hey Toby:
Did as you instructed and worked. Thanks a lot Toby. Let me know should you
need anything. I'm glad to help.


Another question about Janino: I'm getting the following exception on the
live app-engine when the dynamic code (the code that is compiled by janino)
has a compilation error:

An error occurred: java.security.AccessControlException: access denied
(java.lang.RuntimePermissions accessDeclaredMembers)


On the local environment, janino returns the line number where the error
occurred, which is very helpful for the students.

Cheers,
Albert Attard

Samuel Goldwyn
- "I'm willing to admit that I may not always be right, but I am never
wrong."

2009/8/26 Toby Reyelts 

>
> Hey Albert,
>
> Even though I haven't actually seen the changes that you made, I believe
> they were unnecessary. (Go out on a limb with me here). I tracked the fault
> down to an error in our runtime that can be worked around by just
> recompiling the code. You should be able to confirm this on your end by
> recompiling Janino from source *without* any of the changes you made.
> Please make sure you've set the target version to 1.5 or 1.6.
>
> On Wed, Aug 26, 2009 at 4:51 AM, Albert Attard wrote:
>
>> Hey Toby:
>> Janino api include classes that are not supported by the app-engine. All I
>> did is commented out the code that the app-engine didn't like in janino and
>> repackaged it.
>>
>> I did the following:
>>
>>- Downloaded the source for janino:
>>http://www.janino.net/download/janino-2.5.15.zip
>>- I've created a new Google Web Project in Eclipse
>>- I've copied the source into the Google Web Project
>>- Than I've *unsafely* commented out code that was not supported by
>>the Google app-engine
>>- Repackaged the edited code into a new jar and deployed it with my
>>project instead of the original one
>>- The simple proof of concept seams to work
>>
>> As you can see at the simple demo: http://ask-me.appspot.com/ the code
>> seams to work. Hope you manage to complete this question :)
>>
>> Cheers,
>> Albert Attard
>>
>> Stephen 
>> Leacock - 
>> "I detest life-insurance agents: they always argue that I shall some day
>> die, which is not so."
>>
>> 2009/8/25 Toby Reyelts 
>>
>> Hey Albert,
>>>
>>> That code should actually work ok, but you've managed to tickle a bug in
>>> our runtime. I've filed an 
>>> issuefor 
>>> you here. The fix for this probably won't make the next release, but it
>>> should come shortly thereafter.
>>>
>>>
>>> On Tue, Aug 25, 2009 at 6:33 AM, Albert Attard 
>>> wrote:
>>>
 Hi  Toby:
 Thanks for you feedback.

 I've did a small prototype: http://ask-me.appspot.com/ . It's working
 fine locally, but it's throwing the following exception when executed on 
 the
 app-engine:

 javax.servlet.ServletContext log: Exception while dispatching incoming
 RPC call
 com.google.gwt.user.server.rpc.UnexpectedException: Service method
 'public abstract com.albertattard.askme.client.utils.AssessmentTO
 com.albertattard.askme.client.AssessorService.assessCode(java.lang.String)'
 threw an unexpected exception: java.lang.VerifyError: (class:
 org/codehaus/janino/ByteArrayClassLoader, method: findClass signature:
 (Ljava/lang/String;)Ljava/lang/Class;) Illegal type in constant pool
  at
 com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:360)
 at
 com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:546)
  at
 com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:166)
 at
 com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
  at
 org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
 at
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
  at
 com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
 at
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
  at
 com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
 at
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
  at
 org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
 at
 org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
  at
 org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
 at
 org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.jav

[appengine-java] Re: Compile and execute at runtime

2009-08-26 Thread Toby Reyelts
Hey Albert,

Even though I haven't actually seen the changes that you made, I believe
they were unnecessary. (Go out on a limb with me here). I tracked the fault
down to an error in our runtime that can be worked around by just
recompiling the code. You should be able to confirm this on your end by
recompiling Janino from source *without* any of the changes you made. Please
make sure you've set the target version to 1.5 or 1.6.

On Wed, Aug 26, 2009 at 4:51 AM, Albert Attard wrote:

> Hey Toby:
> Janino api include classes that are not supported by the app-engine. All I
> did is commented out the code that the app-engine didn't like in janino and
> repackaged it.
>
> I did the following:
>
>- Downloaded the source for janino:
>http://www.janino.net/download/janino-2.5.15.zip
>- I've created a new Google Web Project in Eclipse
>- I've copied the source into the Google Web Project
>- Than I've *unsafely* commented out code that was not supported by the
>Google app-engine
>- Repackaged the edited code into a new jar and deployed it with my
>project instead of the original one
>- The simple proof of concept seams to work
>
> As you can see at the simple demo: http://ask-me.appspot.com/ the code
> seams to work. Hope you manage to complete this question :)
>
> Cheers,
> Albert Attard
>
> Stephen 
> Leacock - 
> "I detest life-insurance agents: they always argue that I shall some day
> die, which is not so."
>
> 2009/8/25 Toby Reyelts 
>
> Hey Albert,
>>
>> That code should actually work ok, but you've managed to tickle a bug in
>> our runtime. I've filed an 
>> issuefor you 
>> here. The fix for this probably won't make the next release, but it
>> should come shortly thereafter.
>>
>>
>> On Tue, Aug 25, 2009 at 6:33 AM, Albert Attard wrote:
>>
>>> Hi  Toby:
>>> Thanks for you feedback.
>>>
>>> I've did a small prototype: http://ask-me.appspot.com/ . It's working
>>> fine locally, but it's throwing the following exception when executed on the
>>> app-engine:
>>>
>>> javax.servlet.ServletContext log: Exception while dispatching incoming
>>> RPC call
>>> com.google.gwt.user.server.rpc.UnexpectedException: Service method
>>> 'public abstract com.albertattard.askme.client.utils.AssessmentTO
>>> com.albertattard.askme.client.AssessorService.assessCode(java.lang.String)'
>>> threw an unexpected exception: java.lang.VerifyError: (class:
>>> org/codehaus/janino/ByteArrayClassLoader, method: findClass signature:
>>> (Ljava/lang/String;)Ljava/lang/Class;) Illegal type in constant pool
>>>  at
>>> com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:360)
>>> at
>>> com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:546)
>>>  at
>>> com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:166)
>>> at
>>> com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)
>>>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
>>>  at
>>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
>>> at
>>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
>>>  at
>>> com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
>>> at
>>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
>>>  at
>>> com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
>>> at
>>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
>>>  at
>>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
>>> at
>>> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
>>>  at
>>> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
>>> at
>>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
>>>  at
>>> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
>>> at
>>> com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:237)
>>>  at
>>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
>>> at org.mortbay.jetty.Server.handle(Server.java:313)
>>>  at
>>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)
>>> at
>>> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:830)
>>>  at
>>> com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
>>> at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
>>>  at
>>> com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:139)
>>> at
>>> com.google.apphosting.runtime.JavaRuntim

[appengine-java] Re: Compile and execute at runtime

2009-08-26 Thread Albert Attard
Hey Toby:
Janino api include classes that are not supported by the app-engine. All I
did is commented out the code that the app-engine didn't like in janino and
repackaged it.

I did the following:

   - Downloaded the source for janino:
   http://www.janino.net/download/janino-2.5.15.zip
   - I've created a new Google Web Project in Eclipse
   - I've copied the source into the Google Web Project
   - Than I've *unsafely* commented out code that was not supported by the
   Google app-engine
   - Repackaged the edited code into a new jar and deployed it with my
   project instead of the original one
   - The simple proof of concept seams to work

As you can see at the simple demo: http://ask-me.appspot.com/ the code seams
to work. Hope you manage to complete this question :)

Cheers,
Albert Attard

Stephen 
Leacock
- "I detest life-insurance agents: they always argue that I shall some
day
die, which is not so."

2009/8/25 Toby Reyelts 

> Hey Albert,
>
> That code should actually work ok, but you've managed to tickle a bug in
> our runtime. I've filed an 
> issuefor you 
> here. The fix for this probably won't make the next release, but it
> should come shortly thereafter.
>
>
> On Tue, Aug 25, 2009 at 6:33 AM, Albert Attard wrote:
>
>> Hi  Toby:
>> Thanks for you feedback.
>>
>> I've did a small prototype: http://ask-me.appspot.com/ . It's working
>> fine locally, but it's throwing the following exception when executed on the
>> app-engine:
>>
>> javax.servlet.ServletContext log: Exception while dispatching incoming RPC
>> call
>> com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public
>> abstract com.albertattard.askme.client.utils.AssessmentTO
>> com.albertattard.askme.client.AssessorService.assessCode(java.lang.String)'
>> threw an unexpected exception: java.lang.VerifyError: (class:
>> org/codehaus/janino/ByteArrayClassLoader, method: findClass signature:
>> (Ljava/lang/String;)Ljava/lang/Class;) Illegal type in constant pool
>>  at
>> com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:360)
>> at
>> com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:546)
>>  at
>> com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:166)
>> at
>> com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)
>>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
>>  at
>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
>> at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
>>  at
>> com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
>> at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
>>  at
>> com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
>> at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
>>  at
>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
>> at
>> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
>>  at
>> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
>> at
>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
>>  at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
>> at
>> com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:237)
>>  at
>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
>> at org.mortbay.jetty.Server.handle(Server.java:313)
>>  at
>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)
>> at
>> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:830)
>>  at
>> com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
>> at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
>>  at
>> com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:139)
>> at
>> com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:235)
>>  at
>> com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:4823)
>> at
>> com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:4821)
>>  at
>> com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:24)
>> at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:359)
>>  at com.google.net.rpc.impl.Server$2.run(Server.java:820)
>> at
>> com.google.tracing.LocalTraceSpanRunnable.run(LocalTraceSpanRunnable.java:56)
>>  at
>> com.google.traci

[appengine-java] Re: Compile and execute at runtime

2009-08-25 Thread Toby Reyelts
Hey Albert,

That code should actually work ok, but you've managed to tickle a bug in our
runtime. I've filed an
issuefor
you here. The fix for this probably won't make the next release, but
it
should come shortly thereafter.

On Tue, Aug 25, 2009 at 6:33 AM, Albert Attard wrote:

> Hi  Toby:
> Thanks for you feedback.
>
> I've did a small prototype: http://ask-me.appspot.com/ . It's working fine
> locally, but it's throwing the following exception when executed on the
> app-engine:
>
> javax.servlet.ServletContext log: Exception while dispatching incoming RPC
> call
> com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public
> abstract com.albertattard.askme.client.utils.AssessmentTO
> com.albertattard.askme.client.AssessorService.assessCode(java.lang.String)'
> threw an unexpected exception: java.lang.VerifyError: (class:
> org/codehaus/janino/ByteArrayClassLoader, method: findClass signature:
> (Ljava/lang/String;)Ljava/lang/Class;) Illegal type in constant pool
>  at
> com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:360)
> at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:546)
>  at
> com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:166)
> at
> com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
>  at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
> at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
>  at
> com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
> at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
>  at
> com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
> at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
>  at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
> at
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
>  at
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
> at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
>  at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
> at
> com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:237)
>  at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
> at org.mortbay.jetty.Server.handle(Server.java:313)
>  at
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)
> at
> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:830)
>  at
> com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
> at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
>  at
> com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:139)
> at
> com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:235)
>  at
> com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:4823)
> at
> com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:4821)
>  at
> com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:24)
> at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:359)
>  at com.google.net.rpc.impl.Server$2.run(Server.java:820)
> at
> com.google.tracing.LocalTraceSpanRunnable.run(LocalTraceSpanRunnable.java:56)
>  at
> com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan(LocalTraceSpanBuilder.java:516)
> at com.google.net.rpc.impl.Server.startRpc(Server.java:775)
>  at com.google.net.rpc.impl.Server.processRequest(Server.java:348)
> at
> com.google.net.rpc.impl.ServerConnection.messageReceived(ServerConnection.java:436)
>  at
> com.google.net.rpc.impl.RpcConnection.parseMessages(RpcConnection.java:319)
> at
> com.google.net.rpc.impl.RpcConnection.dataReceived(RpcConnection.java:290)
>  at com.google.net.async.Connection.handleReadEvent(Connection.java:428)
> at
> com.google.net.async.EventDispatcher.processNetworkEvents(EventDispatcher.java:762)
>  at
> com.google.net.async.EventDispatcher.internalLoop(EventDispatcher.java:207)
> at com.google.net.async.EventDispatcher.loop(EventDispatcher.java:101)
>  at
> com.google.net.rpc.RpcService.runUntilServerShutdown(RpcService.java:251)
> at
> com.google.apphosting.runtime.JavaRuntime$RpcRunnable.run(JavaRuntime.java:374)
>  at java.lang.Thread.run(Unknown Source)
> Caused by: java.lang.VerifyError: (class:
> org/codehaus/janino/ByteArrayClassLoader, method: findClass signature:

[appengine-java] Re: Compile and execute at runtime

2009-08-25 Thread Albert Attard
Managed to go around this by tweaking the janino to not use restricted
classes.
Albert Attard

Mike Ditka   -
"If God had wanted man to play soccer, he wouldn't have given us arms."

2009/8/25 Albert Attard 

> Hi  Toby:
> Thanks for you feedback.
>
> I've did a small prototype: http://ask-me.appspot.com/ . It's working fine
> locally, but it's throwing the following exception when executed on the
> app-engine:
>
> javax.servlet.ServletContext log: Exception while dispatching incoming RPC
> call
> com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public
> abstract com.albertattard.askme.client.utils.AssessmentTO
> com.albertattard.askme.client.AssessorService.assessCode(java.lang.String)'
> threw an unexpected exception: java.lang.VerifyError: (class:
> org/codehaus/janino/ByteArrayClassLoader, method: findClass signature:
> (Ljava/lang/String;)Ljava/lang/Class;) Illegal type in constant pool
>  at
> com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:360)
> at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:546)
>  at
> com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:166)
> at
> com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
>  at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
> at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
>  at
> com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
> at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
>  at
> com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
> at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
>  at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
> at
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
>  at
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
> at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
>  at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
> at
> com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:237)
>  at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
> at org.mortbay.jetty.Server.handle(Server.java:313)
>  at
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)
> at
> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:830)
>  at
> com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
> at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
>  at
> com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:139)
> at
> com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:235)
>  at
> com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:4823)
> at
> com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:4821)
>  at
> com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:24)
> at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:359)
>  at com.google.net.rpc.impl.Server$2.run(Server.java:820)
> at
> com.google.tracing.LocalTraceSpanRunnable.run(LocalTraceSpanRunnable.java:56)
>  at
> com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan(LocalTraceSpanBuilder.java:516)
> at com.google.net.rpc.impl.Server.startRpc(Server.java:775)
>  at com.google.net.rpc.impl.Server.processRequest(Server.java:348)
> at
> com.google.net.rpc.impl.ServerConnection.messageReceived(ServerConnection.java:436)
>  at
> com.google.net.rpc.impl.RpcConnection.parseMessages(RpcConnection.java:319)
> at
> com.google.net.rpc.impl.RpcConnection.dataReceived(RpcConnection.java:290)
>  at com.google.net.async.Connection.handleReadEvent(Connection.java:428)
> at
> com.google.net.async.EventDispatcher.processNetworkEvents(EventDispatcher.java:762)
>  at
> com.google.net.async.EventDispatcher.internalLoop(EventDispatcher.java:207)
> at com.google.net.async.EventDispatcher.loop(EventDispatcher.java:101)
>  at
> com.google.net.rpc.RpcService.runUntilServerShutdown(RpcService.java:251)
> at
> com.google.apphosting.runtime.JavaRuntime$RpcRunnable.run(JavaRuntime.java:374)
>  at java.lang.Thread.run(Unknown Source)
> Caused by: java.lang.VerifyError: (class:
> org/codehaus/janino/ByteArrayClassLoader, method: findClass signature:
> (Ljava/lang/String;)Ljava/lang/Class;) Illegal type in constant pool
>  a

[appengine-java] Re: Compile and execute at runtime

2009-08-25 Thread Albert Attard
Hi  Toby:
Thanks for you feedback.

I've did a small prototype: http://ask-me.appspot.com/ . It's working fine
locally, but it's throwing the following exception when executed on the
app-engine:

javax.servlet.ServletContext log: Exception while dispatching incoming RPC
call
com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public
abstract com.albertattard.askme.client.utils.AssessmentTO
com.albertattard.askme.client.AssessorService.assessCode(java.lang.String)'
threw an unexpected exception: java.lang.VerifyError: (class:
org/codehaus/janino/ByteArrayClassLoader, method: findClass signature:
(Ljava/lang/String;)Ljava/lang/Class;) Illegal type in constant pool
at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:360)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:546)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:166)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
at
com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at
com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at
com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:237)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
at org.mortbay.jetty.Server.handle(Server.java:313)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)
at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:830)
at
com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
at
com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:139)
at
com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:235)
at
com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:4823)
at
com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:4821)
at
com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:24)
at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:359)
at com.google.net.rpc.impl.Server$2.run(Server.java:820)
at
com.google.tracing.LocalTraceSpanRunnable.run(LocalTraceSpanRunnable.java:56)
at
com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan(LocalTraceSpanBuilder.java:516)
at com.google.net.rpc.impl.Server.startRpc(Server.java:775)
at com.google.net.rpc.impl.Server.processRequest(Server.java:348)
at
com.google.net.rpc.impl.ServerConnection.messageReceived(ServerConnection.java:436)
at
com.google.net.rpc.impl.RpcConnection.parseMessages(RpcConnection.java:319)
at
com.google.net.rpc.impl.RpcConnection.dataReceived(RpcConnection.java:290)
at com.google.net.async.Connection.handleReadEvent(Connection.java:428)
at
com.google.net.async.EventDispatcher.processNetworkEvents(EventDispatcher.java:762)
at
com.google.net.async.EventDispatcher.internalLoop(EventDispatcher.java:207)
at com.google.net.async.EventDispatcher.loop(EventDispatcher.java:101)
at com.google.net.rpc.RpcService.runUntilServerShutdown(RpcService.java:251)
at
com.google.apphosting.runtime.JavaRuntime$RpcRunnable.run(JavaRuntime.java:374)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.VerifyError: (class:
org/codehaus/janino/ByteArrayClassLoader, method: findClass signature:
(Ljava/lang/String;)Ljava/lang/Class;) Illegal type in constant pool
at
org.codehaus.janino.SimpleCompiler.compileToClassLoader(SimpleCompiler.java)
at org.codehaus.janino.SimpleCompiler.cook(SimpleCompiler.java)
at org.codehaus.janino.Cookable.cook(Cookable.java)
at org.codehaus.janino.Cookable.cook(Cookable.java)
at org.codehaus.janino.Cookable.cook(Cookable.java)
at
com.albertattard.askme.server.DemoSwapAssessor.assess(DemoSwapAssessor.java:21)
at
com.albertattard.askme.server.AssessorServiceImpl.assessCode(AssessorServiceImpl.java:15)
at su