DO NOT REPLY [Bug 48116] New: Cannot use JAXP 1.4 XML APIs from JDK 1.6 without use of 'endorsed'

View: New views
7 Messages — Rating Filter:   Alert me  

DO NOT REPLY [Bug 48116] New: Cannot use JAXP 1.4 XML APIs from JDK 1.6 without use of 'endorsed'

by Bugzilla from bugzilla@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

https://issues.apache.org/bugzilla/show_bug.cgi?id=48116

           Summary: Cannot use JAXP 1.4 XML APIs from JDK 1.6 without use
                    of 'endorsed'
           Product: Tomcat 6
           Version: 6.0.20
          Platform: PC
        OS/Version: Mac OS X 10.4
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: dev@...
        ReportedBy: bimargulies@...


Created an attachment (id=24469)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24469)
maven project to build the testcase.

In the about-to-be-attached test case, the code uses the new JAXP 1.4 APIs that
are intended to avoid the need for the 'endorsed' mechanism. One can call
(e.g.)
XPathFactory.newInstance("the name of a class", aClassloader) to as for a
specific implementation.

All this works fine standalone, and (as it happens) in Jety.

In tomcat 6.0.20, this leads to the following stacktrace. Note in the
stacktrace that one piece of Apache Xpath code is looking for a nonexistent
function of another piece and not finding it.

root cause

java.lang.NoSuchMethodError: org.apache.xpath.XPathContext.<init>(Z)V
    org.apache.xpath.jaxp.XPathImpl.eval(XPathImpl.java:207)
    org.apache.xpath.jaxp.XPathImpl.evaluate(XPathImpl.java:281)
    org.apache.mtomcatbug.Serviette.doGet(Serviette.java:58)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


DO NOT REPLY [Bug 48116] Cannot use JAXP 1.4 XML APIs from JDK 1.6 without use of 'endorsed'

by Bugzilla from bugzilla@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

https://issues.apache.org/bugzilla/show_bug.cgi?id=48116

--- Comment #1 from bmargulies <bimargulies@...> 2009-11-03 17:03:26 UTC ---
Note that this test case and entire bug depends on running with JDK 1.6.

--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


DO NOT REPLY [Bug 48116] Cannot use JAXP 1.4 XML APIs from JDK 1.6 without use of 'endorsed'

by Bugzilla from bugzilla@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

https://issues.apache.org/bugzilla/show_bug.cgi?id=48116

--- Comment #2 from Rainer Jung <rainer.jung@...> 2009-11-06 00:15:03 UTC ---
Hate to say this: it works for me. When I could not reproduce an error, I
hot-eployed a second copy of the war and tried to other context. It works
always:

06.11.2009 09:07:10 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
06.11.2009 09:07:10 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 982 ms
06.11.2009 09:07:10 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
06.11.2009 09:07:10 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.20
06.11.2009 09:07:11 org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive classpath-disaster.war
06.11.2009 09:07:11 org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive classpath-disaster2.war
06.11.2009 09:07:12 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
06.11.2009 09:07:12 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
06.11.2009 09:07:12 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/32  config=null
06.11.2009 09:07:12 org.apache.catalina.startup.Catalina start
INFO: Server startup in 1751 ms

06.11.2009 09:07:44 org.apache.catalina.core.ApplicationContext log
INFO: *GET /a/b/c
06.11.2009 09:07:45 org.apache.catalina.core.ApplicationContext log
INFO: *Success
06.11.2009 09:07:53 org.apache.catalina.core.ApplicationContext log
INFO: *GET /a/b/c
06.11.2009 09:07:53 org.apache.catalina.core.ApplicationContext log
INFO: *Success

Java was 1.6.0_16. Commandline:

C:\Programme\Java\jdk1.6.0_16\bin\java
-Djava.util.logging.config.file=C:\Programme\apache-tomcat-6.0.20\conf\logging.properties
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.endorsed.dirs="C:\Programme\apache-tomcat-6.0.20\endorsed"
-classpath
"C:\Programme\Java\jdk1.6.0_16\lib\tools.jar;C:\Programme\apache-tomcat-6.0.20bin\bootstrap.jar"
-Dcatalina.base="C:\Programme\apache-tomcat-6.0.20"
-Dcatalina.home="C:\Programme\apache-tomcat-6.0.20"
-Djava.io.tmpdir="C:\Programme\apache-tomcat-6.0.20\temp"
org.apache.catalina.startup.Bootstrap  start

You can add -Djaxp.debug=1 and will get more info:

I got the following output for startup and two requests (using two different
contexts):

JAXP: find factoryId =javax.xml.parsers.SAXParserFactory
JAXP: loaded from fallback value:
com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
JAXP: created new instance of class
com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl using ClassLoader:
null
JAXP: find factoryId =javax.xml.parsers.SAXParserFactory
JAXP: loaded from fallback value:
com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
JAXP: created new instance of class
com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl using ClassLoader:
null
JAXP: find factoryId =javax.xml.parsers.SAXParserFactory
JAXP: loaded from fallback value:
com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
JAXP: created new instance of class
com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl using ClassLoader:
null
JAXP: find factoryId =javax.xml.parsers.SAXParserFactory
JAXP: loaded from fallback value:
com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
JAXP: created new instance of class
com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl using ClassLoader:
null
JAXP: find factoryId =javax.xml.parsers.SAXParserFactory
JAXP: loaded from fallback value:
com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
JAXP: created new instance of class
com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl using ClassLoader:
null
JAXP: find factoryId =javax.xml.parsers.SAXParserFactory
JAXP: loaded from fallback value:
com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
JAXP: created new instance of class
com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl using ClassLoader:
null
JAXP: find factoryId =javax.xml.parsers.SAXParserFactory
JAXP: loaded from fallback value:
com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
JAXP: created new instance of class
com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl using ClassLoader:
null
JAXP: using thread context class loader (WebappClassLoader
  delegate: false
  repositories:
    /WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@18385e3
) for search
JAXP: createInstance(org.apache.xerces.jaxp.validation.XMLSchemaFactory)
JAXP: loaded org.apache.xerces.jaxp.validation.XMLSchemaFactory from null
JAXP: created new instance of class
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl using ClassLoader:
WebappClassLoader
  delegate: false
  repositories:
    /WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@18385e3

JAXP: using thread context class loader (WebappClassLoader
  delegate: false
  repositories:
    /WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@18385e3
) for search
JAXP: createInstance(org.apache.xpath.jaxp.XPathFactoryImpl)
JAXP: loaded org.apache.xpath.jaxp.XPathFactoryImpl from null
JAXP: created new instance of class
org.apache.xalan.processor.TransformerFactoryImpl using ClassLoader:
WebappClassLoader
  delegate: false
  repositories:
    /WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@18385e3

06.11.2009 09:11:07 org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive classpath-disaster2.war
JAXP: using thread context class loader (WebappClassLoader
  delegate: false
  repositories:
    /WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@18385e3
) for search
JAXP: createInstance(org.apache.xerces.jaxp.validation.XMLSchemaFactory)
JAXP: loaded org.apache.xerces.jaxp.validation.XMLSchemaFactory from null
JAXP: created new instance of class
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl using ClassLoader:
WebappClassLoader
  delegate: false
  repositories:
    /WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@18385e3

JAXP: using thread context class loader (WebappClassLoader
  delegate: false
  repositories:
    /WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@18385e3
) for search
JAXP: createInstance(org.apache.xpath.jaxp.XPathFactoryImpl)
JAXP: loaded org.apache.xpath.jaxp.XPathFactoryImpl from null
JAXP: created new instance of class
org.apache.xalan.processor.TransformerFactoryImpl using ClassLoader:
WebappClassLoader
  delegate: false
  repositories:
    /WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@18385e3

JAXP: created new instance of class
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl using ClassLoader:
WebappClassLoader
  delegate: false
  repositories:
    /WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@18385e3

JAXP: created new instance of class
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl using ClassLoader:
WebappClassLoader
  delegate: false
  repositories:
    /WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@18385e3

--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


DO NOT REPLY [Bug 48116] Cannot use JAXP 1.4 XML APIs from JDK 1.6 without use of 'endorsed'

by Bugzilla from bugzilla@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

https://issues.apache.org/bugzilla/show_bug.cgi?id=48116

--- Comment #3 from bmargulies <bimargulies@...> 2009-11-06 03:21:29 UTC ---
I wonder if this is a gift from Apple somehow. Let me try it on a Linux VM.
That would explain why I am the apparent first to run into it.

--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


DO NOT REPLY [Bug 48116] Cannot use JAXP 1.4 XML APIs from JDK 1.6 without use of 'endorsed'

by Bugzilla from bugzilla@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

https://issues.apache.org/bugzilla/show_bug.cgi?id=48116

--- Comment #4 from Rainer Jung <rainer.jung@...> 2009-11-06 10:56:37 UTC ---
... and have a look, whether -Djaxp.debug=1 helps to understand ...

--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


DO NOT REPLY [Bug 48116] Cannot use JAXP 1.4 XML APIs from JDK 1.6 without use of 'endorsed'

by Bugzilla from bugzilla@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

https://issues.apache.org/bugzilla/show_bug.cgi?id=48116

--- Comment #5 from bmargulies <bimargulies@...> 2009-11-06 13:56:31 UTC ---
What does the 'from null' mean in the following fragment from the longer trace
below?

JAXP: using thread context class loader (WebappClassLoader
  delegate: false
  repositories:
    /WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@211d0a4f
) for search
JAXP: createInstance(org.apache.xpath.jaxp.XPathFactoryImpl)
[Deprecated] Xalan: org.apache.xpath.jaxp.XPathFactoryImpl
JAXP: loaded org.apache.xpath.jaxp.XPathFactoryImpl from null







Nov 6, 2009 4:53:55 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 856 ms
JAXP: find factoryId =javax.xml.parsers.SAXParserFactory
JAXP: loaded from fallback value:
com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
JAXP: created new instance of class
com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl using ClassLoader:
null
Nov 6, 2009 4:53:55 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Nov 6, 2009 4:53:55 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.20
JAXP: find factoryId =javax.xml.parsers.SAXParserFactory
JAXP: loaded from fallback value:
com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
JAXP: created new instance of class
com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl using ClassLoader:
null
JAXP: find factoryId =javax.xml.parsers.SAXParserFactory
JAXP: loaded from fallback value:
com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
JAXP: created new instance of class
com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl using ClassLoader:
null
JAXP: find factoryId =javax.xml.parsers.SAXParserFactory
JAXP: loaded from fallback value:
com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
JAXP: created new instance of class
com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl using ClassLoader:
null
JAXP: find factoryId =javax.xml.parsers.SAXParserFactory
JAXP: loaded from fallback value:
com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
JAXP: created new instance of class
com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl using ClassLoader:
null
Nov 6, 2009 4:53:55 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive classpath-disaster.war
JAXP: using thread context class loader (WebappClassLoader
  delegate: false
  repositories:
    /WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@211d0a4f
) for search
JAXP: createInstance(org.apache.xerces.jaxp.validation.XMLSchemaFactory)
JAXP: loaded org.apache.xerces.jaxp.validation.XMLSchemaFactory from null
JAXP: created new instance of class
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl using ClassLoader:
WebappClassLoader
  delegate: false
  repositories:
    /WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@211d0a4f

JAXP: using thread context class loader (WebappClassLoader
  delegate: false
  repositories:
    /WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@211d0a4f
) for search
JAXP: createInstance(org.apache.xpath.jaxp.XPathFactoryImpl)
[Deprecated] Xalan: org.apache.xpath.jaxp.XPathFactoryImpl
JAXP: loaded org.apache.xpath.jaxp.XPathFactoryImpl from null
JAXP: created new instance of class
org.apache.xalan.processor.TransformerFactoryImpl using ClassLoader:
WebappClassLoader
  delegate: false
  repositories:
    /WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@211d0a4f

Nov 6, 2009 4:53:57 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Nov 6, 2009 4:53:57 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Nov 6, 2009 4:53:57 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/37  config=null
Nov 6, 2009 4:53:57 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2166 ms
JAXP: created new instance of class
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl using ClassLoader:
WebappClassLoader
  delegate: false
  repositories:
    /WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@211d0a4f

--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


DO NOT REPLY [Bug 48116] Cannot use JAXP 1.4 XML APIs from JDK 1.6 without use of 'endorsed'

by Bugzilla from bugzilla@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

https://issues.apache.org/bugzilla/show_bug.cgi?id=48116

--- Comment #6 from bmargulies <bimargulies@...> 2009-11-06 13:59:27 UTC ---
I've got it from -verbose:class.

[Loaded org.apache.xpath.XPathContext from
file:/System/Library/Frameworks/JavaVM.framework/Versions/A/Resources/.compatibility/14compatibility.jar]

Thanks, Apple.

--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...