You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Jim <su...@hrsg.ca> on 2015/09/22 21:58:16 UTC

javax.xml.transform.TransformerException: java.lang.NullPointerException

Stack trace

javax.servlet.ServletException: 
javax.xml.transform.TransformerException: java.lang.NullPointerException
        org.apache.fop.servlet.FopServlet.doGet(FopServlet.java:158)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
        
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)


line 158 is  throw new ServletException(ex);


public void doGet(HttpServletRequest request,
                      HttpServletResponse response) throws 
ServletException {
        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);
        }
    }



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: javax.xml.transform.TransformerException: java.lang.NullPointerException

Posted by Pascal Sancho <ps...@gmail.com>.
Hi,

you should give further info to permit the audience to reproduce what you get:
 - FOP version
 - description of FOP inputs and environment
 - etc.


2015-09-22 21:58 GMT+02:00 Jim <su...@hrsg.ca>:
> Stack trace
>
> javax.servlet.ServletException:
> javax.xml.transform.TransformerException: java.lang.NullPointerException
>         org.apache.fop.servlet.FopServlet.doGet(FopServlet.java:158)
>         javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
>         javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
>
> org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
>
>
> line 158 is  throw new ServletException(ex);
>
>
> public void doGet(HttpServletRequest request,
>                       HttpServletResponse response) throws
> ServletException {
>         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);
>         }
>     }
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>



-- 
pascal

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org