J. Aparicio wrote: > > Hello. I have a wsdl which imports another wsdl, which I can not change. > That second wsdl imports some xsd schema, which in turn import another xsd > schema. Again, I can't change those xsd schemas (they are standard). > > The problem is the CXFServlet (through a Tomcat server) serves the first > wsdl, the second wsdl and the first xsd OK, but fails to serve the second > xsd. > The first xsd schema imports the second one via a line like this: > > <xsd:import namespace="http://www.w3.org/2005/08/addressing" > schemaLocation="../types/ws-addressing-0805.xsd"/> > > The ../types/... reference is resolved OK on the filesystem, cxf's > wsdl2java has no problem with it. But it is inaccessible via the > CXFServlet. That means I can not give the CXFServlet url to implementors > of clients, because they can not get the second xsd schema. > > I've tried the command line wsdl2java and the maven plugin as well, with > no success on either. > > I don't know if it may have an impact, but I'm generating the code > including the "-noAddressBinding" option to wsdl2java. This is because I > have to extend the WS-Addressing classes, which otherwise come out as > final. > > I've tried CXF 2.2.5 and 2.2.7, Java5 and Java6, Tomcat5.5 and Tomcat6 > combinations, but all of them fail at the same point. > > What else could I try? > > Thank you :-) > Got additional info. First of all, I said it failed, but didn't explain how. It returns the following stacktrace: ------8<------8<------8<------8<------8<------8<------ HTTP Status 500 -
type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: Exception occurred while trying to process http://localhost:8580/CCO/services/PullStream?xsd=../types/ws-addressing-0805.xsd org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:168) org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:142) org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179) org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:108) javax.servlet.http.HttpServlet.service(HttpServlet.java:627) org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159) root cause org.apache.cxf.transport.http.WSDLQueryException: Exception occurred while trying to process http://localhost:8580/CCO/services/PullStream?xsd=../types/ws-addressing-0805.xsd org.apache.cxf.transport.http.WSDLQueryHandler.writeResponse(WSDLQueryHandler.java:228) org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:162) org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:142) org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179) org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:108) javax.servlet.http.HttpServlet.service(HttpServlet.java:627) org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159) root cause java.lang.IllegalStateException: Found type: org.apache.xerces.dom.DeferredDocumentTypeImpl org.apache.cxf.staxutils.StaxUtils.writeNode(StaxUtils.java:749) org.apache.cxf.staxutils.StaxUtils.writeDocument(StaxUtils.java:575) org.apache.cxf.staxutils.StaxUtils.writeDocument(StaxUtils.java:563) org.apache.cxf.staxutils.StaxUtils.writeNode(StaxUtils.java:737) org.apache.cxf.transport.http.WSDLQueryHandler.writeResponse(WSDLQueryHandler.java:223) org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:162) org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:142) org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179) org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:108) javax.servlet.http.HttpServlet.service(HttpServlet.java:627) org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159) note The full stack trace of the root cause is available in the Apache Tomcat/5.5.28 logs. Apache Tomcat/5.5.28 ------8<------8<------8<------8<------8<------8<------ I've tried debugging Tomcat from Eclipse. The error happens when org.apache.cxf.staxutils.StaxUtils.writeNode realizes the node given (corresponding to the xsd document) is none of the allowed types (it's an org.apache.xerces.dom.DeferredDocumentTypeImpl, none of the org.w3c.dom.Node class public fields) At some point between the initial request is received by the servlet and the exception is thrown the xsd is actually found, and identified/pointed to by "jndi:/localhost/CCO/WEB-INF/wsdl/types/ws-addressing-0805.xsd". I don't know where "jndi:/localhost/CCO" points to, but I assume it points to the filesystem directory where the webapp is deployed. The rest of the path is OK (the xsd file exists and is readable). Why does the document end up being parsed and represented by a DeferredDocumentTypeImpl? Why does StaxUtils choke on that type of node? Removing xercesImpl from the web application only resulted in the node type being changed from "org.apache.xerces.dom.DeferredDocumentTypeImpl" to "com.sun.org.apache.xerces.internal.dom.DeferredDocumentTypeImpl", which exists in the JDK (both Java5 and Java6) Why doesn't this happen for other xsds/wsdls in the same application? And, most important of all, what can I do to avoid this, apart from tweaking cxf's source code? Thanks a lot -- View this message in context: http://old.nabble.com/Relative-paths-in-xsd%3Aimport-tp28018462p28027543.html Sent from the cxf-user mailing list archive at Nabble.com.
