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 <to...@google.com> 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 <albertatt...@gmail.com>wrote: > > > Hey Toby: > > > Hope you had a nice weekend. > > > Just did: issue > > 2042<http://code.google.com/p/googleappengine/issues/detail?id=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 <http://code.google.com/p/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<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/29 Toby Reyelts <to...@google.com> > > > 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 > >> <albertatt...@gmail.com>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.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) > > >>> Cheers, > >>> Albert Attard > > >>> Ogden Nash <http://www.brainyquote.com/quotes/authors/o/ogden_nash.html> > >>> - "The trouble with a kitten is that when it grows up, it's always a cat." > > >>> 2009/8/27 Toby Reyelts <to...@google.com> > > >>> 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 > >>>> <albertatt...@gmail.com>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 > > ... > > read more » --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---