Hello,

I run FOP from a JSP page, at Tomcat webserver.
It works fine, til there is only one user at a time. But if 2 users want to use the fop converter at the same time, it fails, and says:


type Exception report

message Internal Server Error

description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: duplicate class definition: org/apache/xalan/processor/TransformerFactoryImpl
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:457)


at org.apache.jsp.dmConvertXML2PDF$jsp._jspService(dmConvertXML2PDF$jsp.java:174)

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202)


at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)


at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)


at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)

at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)


at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)

at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)

at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)


at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)


at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011)


at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)

   at java.lang.Thread.run(Thread.java:484)


root cause

java.lang.LinkageError: duplicate class definition: org/apache/xalan/processor/TransformerFactoryImpl
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at org.apache.catalina.loader.StandardClassLoader.findClass(StandardClassLoader.java:671)


at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:1090)

at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:989)

at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:1073)

at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:989)

at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1293)

at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1156)

at javax.xml.transform.FactoryFinder.newInstance(Unknown Source)
at javax.xml.transform.FactoryFinder.find(Unknown Source)
at javax.xml.transform.TransformerFactory.newInstance(Unknown Source)
at com.tracetracker.xslt.TTXSLTProcessor.execWFop(TTXSLTProcessor.java:124)
at com.tracetracker.jsp.TTDMJSPHandler.convertXML2PDF(TTDMJSPHandler.java:2996)


at org.apache.jsp.dmConvertXML2PDF$jsp._jspService(dmConvertXML2PDF$jsp.java:120)

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202)


at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)


at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)


at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)

at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)


at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)

at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)

at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)


at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)


at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011)


at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)

   at java.lang.Thread.run(Thread.java:484)


So,
i think, that if i could start FOP in a new JVM, it would be fine.
But i donw know how to do it.
now i exec fop like this:
try {
javax.xml.transform.stream.StreamSource xmlSource =
new javax.xml.transform.stream.StreamSource(new java.io.File(xmlFile));
javax.xml.transform.stream.StreamSource xslSource =
new javax.xml.transform.stream.StreamSource(new java.io.File(xslFile));
javax.xml.transform.Transformer transformer =
javax.xml.transform.TransformerFactory.newInstance().newTransformer(xslSource);


// transformer.setURIResolver(new TTURIResolver());
org.apache.fop.apps.Driver driver = new org.apache.fop.apps.Driver();
java.io.FileOutputStream outputStream = new java.io.FileOutputStream(outputFile);


driver.setOutputStream(outputStream);
driver.setRenderer(org.apache.fop.apps.Driver.RENDER_PDF);
transformer.transform(xmlSource, new javax.xml.transform.sax.SAXResult(driver.getContentHandler()));
outputStream.close();



} catch (Exception e) { e.printStackTrace(); }


Thanks, for help,

BR,
Fishy





Reply via email to