Hi Christ
javax.servlet.ServletException: javax.xml.transform.TransformerException: org.xml.sax.SAXException: The resource path [file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%208.0/] is not valid java.lang.IllegalArgumentException: The resource path [file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%208.0/] is not valid org.apache.fop.servlet.FopServlet.doGet(FopServlet.java:162) javax.servlet.http.HttpServlet.service(HttpServlet.java:618) javax.servlet.http.HttpServlet.service(HttpServlet.java:725) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) rootUrl is the site domain or IP. for example http://192.xxx.128.xx here is the doGet(), just in case you want to see public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException { try { //Get parameters String foParam = request.getParameter(FO_REQUEST_PARAM); String xmlParam = request.getParameter(XML_REQUEST_PARAM); String xsltParam = request.getParameter(XSLT_REQUEST_PARAM); String rootParam = request.getParameter(ROOT_REQUEST_PARAM); //Analyze parameters and decide with method to use if (foParam != null) { renderFO(foParam, response); } else if ((xmlParam != null) && (xsltParam != null)) { renderXML(xmlParam,xsltParam,rootParam,response); } else { response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.println("<html><head><title>Error</title></head>\n" + "<body><h1>FopServlet Error</h1><h3>No 'fo' " + "request param given.</body></html>"); } } catch (Exception ex) { throw new ServletException(ex); } } -----Original Message----- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Friday, October 02, 2015 11:05 AM To: Tomcat Users List <users@tomcat.apache.org> Subject: Re: The resource path [...] is not valid -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Chen, On 10/2/15 10:42 AM, Chen Yang wrote: > I'm transforming xml into pdf files, but getting this strange error in > my log. (tomcat 8.0.26) > > The resource path > [file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%208.0/ ] > is not valid > > Here is my code > > //Setup sources StreamSource xmlSrc = new StreamSource(new URL(rootUrl > + "/output/xml/" + xml).openStream()); StreamSource xsltSrc = new > StreamSource(new URL(rootUrl + "/output/xslt/" + xslt).openStream()); What's the value of "rootUrl"? > //Setup the XSL transformation Transformer transformer = > this.transFactory.newTransformer(xsltSrc); //error out > transformer.setURIResolver(this.uriResolver); > > XML & XSLT file are not stored locally, so I don't understand why it's > looking at the tomcat folder? What's the stack trace? - -chris -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iQIcBAEBCAAGBQJWDp0yAAoJEBzwKT+lPKRYwosQAJEk7lm9azal0bUXbP4ffZiN Ff+b+CfqM8ZgIaKOjSnS2cLObgaPAYhtuy+1q98cZ3B5VjvYWRADxrZNPvmqYXYp ZZqJSYpkvoHU6L81E5gU3WtBYakm1M7MWCdkGoPz6ygngsOLA0MeWj20ef22Dnj2 2ygGTBDdokwK7a4fYi2yYq80ZLjvvRvrxAqP+SFhpdydWcrnWMIdxMxgCFc1JoJx waMp++c1DYBA2UwanTsjlo4+BFE1EhcTGd9p27hLJq0HciNSAB3fYve9cFUExHO/ 7b4zoSaWhZ4gsI8MjMUibtV53hOE2hL8z8KQOzONxm/auRAH4j9x6AcpF5AyIo/t lFXYESzYh85N0VI4U3tDbl5YIgFkgx3ua+TfTV0j/LWJPK5CcNc86PFuip3JRZLN VblWWmBa5+/KNDgl3DktURjVlrvLJ0wmN6dastBAuEhvU6Y7YKfV898SgDNQQBYH /TYTZidNi+xIM+62UYfFZOLRXiAO8XP1J6NrbmKRJCFy8z9ro23erXIDJHSgMROH eoJ1qQ3ureqysdWxLAzTAAlP+kRtldUM5Ii2fIV2uc6tLpazESr0kgxT3K1XhHjc ZLu2gARzg4Akn/dl2dlm0TgSc+5+f2s+ykbZ7crwrEabYppnBCJCn3T7ucrO4kgC ksiIdogyhYE+uInftDEa =+K3y -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org