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<http://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html> - "I'm willing to admit that I may not always be right, but I am never wrong." 2009/8/26 Toby Reyelts <to...@google.com> > > 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 <albertatt...@gmail.com>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<http://www.brainyquote.com/quotes/authors/s/stephen_leacock.html> - >> "I detest life-insurance agents: they always argue that I shall some day >> die, which is not so." >> >> 2009/8/25 Toby Reyelts <to...@google.com> >> >> Hey Albert, >>> >>> That code should actually work ok, but you've managed to tickle a bug in >>> our runtime. I've filed an >>> issue<http://code.google.com/p/googleappengine/issues/detail?id=2028>for >>> 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(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 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) >>>> ... 43 more >>>> >>>> >>>> The janino ByteArrayClassLoader is not working well (not accepted) on >>>> the app-engine :( >>>> >>>> Any other options? >>>> >>>> Cheers, >>>> Albert Attard >>>> >>>> Marie von >>>> Ebner-Eschenbach<http://www.brainyquote.com/quotes/authors/m/marie_von_ebnereschenbac.html> >>>> - "Even a stopped clock is right twice a day." >>>> >>>> 2009/8/14 Toby Reyelts <to...@google.com> >>>> >>>> >>>>> We don't have any near term plans to whitelist javax.tools. Do you >>>>> think something like janino <http://www.janino.net/> might work for >>>>> you? >>>>> >>>>> >>>>> On Fri, Aug 14, 2009 at 2:50 AM, Albert Attard <albertatt...@gmail.com >>>>> > wrote: >>>>> >>>>>> Hi everyone: >>>>>> >>>>>> Background about the problem: >>>>>> I'm a Java lecturer and would like to create an automated question >>>>>> web application similar to a multiple choice questions and answers but >>>>>> where >>>>>> the students can practice coding instead of simply selecting an answer. >>>>>> >>>>>> Multiple choice questions are very popular in web exams as these >>>>>> are fully automated. You do the test and the system corrects it for you >>>>>> and >>>>>> gives you the results there and then. I would like to go one step further >>>>>> and have the student to supply a code fragment or even a class(es) and >>>>>> have >>>>>> the system automatically correcting it in a similar fashion to the >>>>>> multiple >>>>>> choice questions. >>>>>> >>>>>> Example (in a nutshell): >>>>>> The student is asked to write a method: that given an array of int >>>>>> and two indices of type int (between 0 and the size of the array - 1), >>>>>> this >>>>>> method will swap the elements at the given indices. The student >>>>>> will write the method in the provided text area and submit it. Then >>>>>> the system will include this method into a class, compile it and by >>>>>> using reflection executes it with an array of values (similar to JUnit) >>>>>> to >>>>>> ensure that it is working as expected. During this process the system >>>>>> will >>>>>> be awarding the student marks and will display the final result together >>>>>> with comments as required. >>>>>> >>>>>> Google Appengine >>>>>> I have a prototype and it works great on Tomcat. Yes I know that it >>>>>> is subject to Java code injection but that's not an issue at this >>>>>> stage. This issue can be fixed at a later stage. Unfortunately I cannot >>>>>> implement it on the Google Appengine as most of the >>>>>> required functionality, such as writing to a file or JavaCompiler is >>>>>> disabled . I've managed to compile the classes to database (without >>>>>> writing >>>>>> to the file system) and load classes from database (without reading from >>>>>> the >>>>>> file system), which can integrate well with the provided datastore. >>>>>> Is there a way (or a procedure) of implementing such a system on >>>>>> the Google Appengine? This application will be a free education tool >>>>>> for everyone who would like to use it. >>>>>> >>>>>> Thanks in advance, >>>>>> Albert Attard >>>>>> >>>>>> Ted Turner<http://www.brainyquote.com/quotes/authors/t/ted_turner.html> >>>>>> - "Sports is like a war without the killing." >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>>> >>>> >>>> >>>> >>> >>> >>> >> >> >> > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~----------~----~----~----~------~----~------~--~---