as already states by cause "Caused by:
java.security.AccessControlException: access denied "
you are not allowed to access the filesystem neither for read nor for
write - I remember there was a workaround for this issue, like putting
the resource into classpath or such, then you can get the stream via
getResourceAsStream("foo.xslt") from the classloader.this should be stated in appengine faq good luck, On 21 Jul., 20:23, lineman78 <[email protected]> wrote: > From what I can tell it is failing while compiling the stylesheet. I > would suggest taking app engine out of the loop altogether first and > just so it in a static main to make sure it is compiling. If it works > as a static main than it is probably the file IO. To test this I > recommend to try just reading the file to the log to make sure that > you actually have a hold of the file. I have found that the most > reliable way to read in a file is not to use the File constructor, but > assuming the name of your class is XsltService: > > XsltService.class.getResourceAsStream("test.xsl"); // Assuming > test.xsl is in the same folder as the class file, set to "/test.xsl" > if it is in the root. > > On Jul 21, 6:42 am, Jan <[email protected]> wrote: > > > > > Hi, > > > I would like to use an xsl transformation inside an HttpServlet. The > > code is essentially the following: > > > File xslfile = new File("test.xsl"); > > TransformerFactory factory = TransformerFactory.newInstance(); > > factory.setAttribute( "debug", true ); > > Transformer transformer = factory.newTransformer(new > > StreamSource( xslfile ) ); > > > I already made sure that the xsl file is valid and I defined it as > > resource-file inside appengine-web.xml > > > If I now call the servlet the first time, the following error occurs: > > > java.lang.ExceptionInInitializerError > > at > > com.sun.org.apache.bcel.internal.classfile.JavaClass.<init>(JavaClass.java: > > 109) > > at > > com.sun.org.apache.bcel.internal.classfile.JavaClass.<init>(JavaClass.java: > > 228) > > at > > com.sun.org.apache.bcel.internal.generic.ClassGen.getJavaClass(ClassGen.jav > > a: > > 174) > > at > > com.sun.org.apache.xalan.internal.xsltc.compiler.Stylesheet.translate(Style > > sheet.java: > > 735) > > at > > com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC.compile(XSLTC.java: > > 354) > > at > > com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC.compile(XSLTC.java: > > 429) > > at > > com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemp > > lates(TransformerFactoryImpl.java: > > 795) > > at > > com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTran > > sformer(TransformerFactoryImpl.java: > > 617) > > at com.axag.invoiceedit.server.<MY SERVLET>.doGet(<MY SERVLET>:240) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:693) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:806) > > at > > org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java: > > 511) > > at org.mortbay.jetty.servlet.ServletHandler > > $CachedChain.doFilter(ServletHandler.java:1166) > > at > > com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFi > > lter.java: > > 51) > > at org.mortbay.jetty.servlet.ServletHandler > > $CachedChain.doFilter(ServletHandler.java:1157) > > at > > com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(Trans > > actionCleanupFilter.java: > > 43) > > at org.mortbay.jetty.servlet.ServletHandler > > $CachedChain.doFilter(ServletHandler.java:1157) > > at > > com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFile > > Filter.java: > > 122) > > at org.mortbay.jetty.servlet.ServletHandler > > $CachedChain.doFilter(ServletHandler.java:1157) > > at > > org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java: > > 388) > > at > > org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java: > > 216) > > at > > org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java: > > 182) > > at > > org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java: > > 765) > > at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java: > > 418) > > at > > com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEn > > gineWebAppContext.java: > > 70) > > at > > org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java: > > 152) > > at com.google.appengine.tools.development.JettyContainerService > > $ApiProxyHandler.handle(JettyContainerService.java:349) > > at > > org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java: > > 152) > > at org.mortbay.jetty.Server.handle(Server.java:326) > > at > > org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java: > > 542) > > at org.mortbay.jetty.HttpConnection > > $RequestHandler.headerComplete(HttpConnection.java:923) > > at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547) > > at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) > > at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) > > at > > org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java: > > 409) > > at org.mortbay.thread.QueuedThreadPool > > $PoolThread.run(QueuedThreadPool.java:582) > > Caused by: java.security.AccessControlException: access denied > > (java.io.FilePermission <PATH TO MY PROJECT'S SRC DIRECTORY> read) > > at > > java.security.AccessControlContext.checkPermission(AccessControlContext.jav > > a: > > 323) > > at > > java.security.AccessController.checkPermission(AccessController.java: > > 546) > > at java.lang.SecurityManager.checkPermission(SecurityManager.java: > > 532) > > at com.google.appengine.tools.development.DevAppServerFactory > > $CustomSecurityManager.checkPermission(DevAppServerFactory.java:166) > > at java.lang.SecurityManager.checkRead(SecurityManager.java:871) > > at java.io.File.exists(File.java:731) > > at > > com.sun.org.apache.bcel.internal.util.ClassPath.getPathComponents(ClassPath > > .java: > > 143) > > at > > com.sun.org.apache.bcel.internal.util.ClassPath.getClassPath(ClassPath.java > > : > > 169) > > at > > com.sun.org.apache.bcel.internal.util.SyntheticRepository.<clinit>(Syntheti > > cRepository.java: > > 86) > > ... 36 more > > FEHLER: 'null' > > SCHWER WIEGENDER FEHLER: 'Die Formatvorlage konnte nicht kompiliert > > werden.' > > javax.xml.transform.TransformerConfigurationException: Die > > Formatvorlage konnte nicht kompiliert werden. > > at > > com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemp > > lates(TransformerFactoryImpl.java: > > 828) > > at > > com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTran > > sformer(TransformerFactoryImpl.java: > > 617) > > at com.axag.invoiceedit.server.<MY SERVLET>.doGet(<MY SERVLET>:240) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:693) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:806) > > at > > org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java: > > 511) > > at org.mortbay.jetty.servlet.ServletHandler > > $CachedChain.doFilter(ServletHandler.java:1166) > > at > > com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFi > > lter.java: > > 51) > > at org.mortbay.jetty.servlet.ServletHandler > > $CachedChain.doFilter(ServletHandler.java:1157) > > at > > com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(Trans > > actionCleanupFilter.java: > > 43) > > at org.mortbay.jetty.servlet.ServletHandler > > $CachedChain.doFilter(ServletHandler.java:1157) > > at > > com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFile > > Filter.java: > > 122) > > at org.mortbay.jetty.servlet.ServletHandler > > $CachedChain.doFilter(ServletHandler.java:1157) > > at > > org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java: > > 388) > > at > > org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java: > > 216) > > at > > org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java: > > 182) > > at > > org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java: > > 765) > > at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java: > > 418) > > at > > com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEn > > gineWebAppContext.java: > > 70) > > at > > org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java: > > 152) > > at com.google.appengine.tools.development.JettyContainerService > > $ApiProxyHandler.handle(JettyContainerService.java:349) > > at > > org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java: > > 152) > > at org.mortbay.jetty.Server.handle(Server.java:326) > > at > > org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java: > > 542) > > at org.mortbay.jetty.HttpConnection > > $RequestHandler.headerComplete(HttpConnection.java:923) > > at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547) > > at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) > > at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) > > at > > org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java: > > 409) > > at org.mortbay.thread.QueuedThreadPool > > $PoolThread.run(QueuedThreadPool.java:582) > > (Please excuse the german error messages) > > > If I now refresh the browser the error message changes to: > > > java.lang.NoClassDefFoundError: Could not initialize class > > com.sun.org.apache.bcel.internal.util.SyntheticRepository > > at > > com.sun.org.apache.bcel.internal.classfile.JavaClass.<init>(JavaClass.java: > > 109) > > at > > com.sun.org.apache.bcel.internal.classfile.JavaClass.<init>(JavaClass.java: > > 228) > > at > > com.sun.org.apache.bcel.internal.generic.ClassGen.getJavaClass(ClassGen.jav > > a: > > 174) > > ... > > Erfahren Sie mehr » -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
