tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Vikström (JIRA) <j...@apache.org>
Subject [jira] [Created] (TOMEE-1071) NoClassDefFoundError - SVGDocument
Date Thu, 07 Nov 2013 09:55:19 GMT
Erik Vikström created TOMEE-1071:
------------------------------------

             Summary: NoClassDefFoundError - SVGDocument
                 Key: TOMEE-1071
                 URL: https://issues.apache.org/jira/browse/TOMEE-1071
             Project: TomEE
          Issue Type: Bug
    Affects Versions: (trunk/tomee)
            Reporter: Erik Vikström


We have a web-application using Apache FOP. When we generate PDF files containing SVG graphics,
we get an exception:

{noformat}
java.lang.ClassNotFoundException: org.w3c.dom.svg.SVGDocument
	org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1702)
	org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547)
	org.apache.tomee.catalina.LazyStopWebappClassLoader.loadClass(LazyStopWebappClassLoader.java:109)
	java.lang.ClassLoader.defineClass1(Native Method)
	java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
	java.lang.ClassLoader.defineClass(ClassLoader.java:615)
	java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
	org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2918)
	org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1174)
	org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1669)
	org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547)
	org.apache.tomee.catalina.LazyStopWebappClassLoader.loadClass(LazyStopWebappClassLoader.java:109)
	org.apache.batik.dom.svg.SVGDOMImplementation.createDocument(Unknown Source)
	org.apache.fop.fo.extensions.svg.SVGDOMContentHandlerFactory$Handler.startElement(SVGDOMContentHandlerFactory.java:128)
	org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:306)
	org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:175)
	org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1073)
	org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
	org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
	org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
	org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:485)
	org.apache.fop.servlet.FopServlet.render(FopServlet.java:244)
	org.apache.fop.servlet.FopServlet.renderFO(FopServlet.java:183)
	org.apache.fop.servlet.FopServlet.doGet(FopServlet.java:120)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
{noformat}

We have traced the problem down to a class called "org.apache.openejb.util.classloader.URLClassLoaderFirst".
In the method "public static boolean shouldSkip(final String name)" you simply check if the
classname starts with "org.w3c.dom", and if so - you delegate the loading of the class to
the parent classloader. Since the "org.w3c.dom.svg" classes is not part of Tomee, this will
of course result in the exception above.

The workaround for us in this case was to apply the system-property:

openejb.classloader.forced-load=org.w3c.dom.svg,org.w3c.dom.smil,org.w3c.css,org.w3c.dom.events

It would be desired if these kind of classes would be loaded from the Web-app without having
to apply this property. Alternatively you need to include all sub-API's for packages that
you force being loaded by the parent class loader.

This seems to be a behavior change compared to 1.5.x.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message