Return-Path: Delivered-To: apmail-cxf-users-archive@www.apache.org Received: (qmail 74155 invoked from network); 14 Jul 2009 19:52:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Jul 2009 19:52:20 -0000 Received: (qmail 64571 invoked by uid 500); 14 Jul 2009 19:52:02 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 63965 invoked by uid 500); 14 Jul 2009 19:51:43 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 63860 invoked by uid 99); 14 Jul 2009 19:51:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Jul 2009 19:51:22 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Jul 2009 19:51:11 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1MQo1a-0002gm-6p for users@cxf.apache.org; Tue, 14 Jul 2009 12:50:50 -0700 Message-ID: <24486562.post@talk.nabble.com> Date: Tue, 14 Jul 2009 12:50:50 -0700 (PDT) From: jp4 To: users@cxf.apache.org Subject: Re: Antwort: Re: Unmarshalling Error: UndeclaredPrefix: Cannot resolve 'ns0:Xxx' as a QName: the prefix 'ns0' is not declared [Virus checked] In-Reply-To: <200907131129.45048.dkulp@apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: john.pfeifer@hnpsolutions.com References: <0E36CF63779A934D876C5E7FD29E74EBF93F36@XMBIL123.northgrum.com> <0AD8923C-C67E-44D0-96C0-3E1B4D5BEA68@apache.org> <24410641.post@talk.nabble.com> <200907101544.38512.dkulp@apache.org> <24462568.post@talk.nabble.com> <200907131129.45048.dkulp@apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Dan, I opened https://issues.apache.org/jira/browse/CXF-2340 and attached a test case. Thanks again for your help with this matter! Thanks, John dkulp wrote: > > On Mon July 13 2009 10:16:13 am jp4 wrote: >> Dan, >> >> I upgraded to CXF 2.2.2 and tried once again with Java 6. I am still >> seeing the same error. The type is properly declared, and I can validate >> the same XML with a servlet that uses the same XSDs. Should I open a bug >> for this? Any other ideas? > > Yes, please do open a bug, but we'll probably need a testcase that shows > the > error as I'm not sure how to reproduce it without a test case. > > Thanks! > Dan > >> >> Thanks, >> >> John >> >> dkulp wrote: >> > On Thu July 9 2009 10:34:38 am jp4 wrote: >> >> I am seeing a similar behavior where the xsi:type causes the >> >> UndeclaredPrefix error. Initially I was running CXF 2.2 with JDK 1.5 >> on >> > >> > Well, definitely try with CXF 2.2.2. That may help. >> > >> > If that doesn't help, use something like wireshark or similar to >> capture >> > the >> > raw message off the wire and see if ns3 is actually properly declared >> on >> > the >> > wire. If not, that would probably be a bug. >> > >> > Dan >> > >> >> Jboss 4.2.3.GA. I have since upgraded to Java 6. I send a sample >> >> request >> >> through SOAPUI and I still see the same error below... If I attempt >> to >> >> validate the same file from within the container using a servlet and >> the >> >> code below, it validates just fine. Any idea what could be causing >> the >> >> discrepancy? >> >> >> >> Source source = new >> >> StreamSource(getClass().getResourceAsStream("/request.xml")); >> >> // If you comment the following line, it works >> >> source = toDOMSource(source); >> >> validator.validate(source); >> >> >> >> >> >> <07/09/09 >> >> >> 10:23:37:779|http-8443-2|INFO|apache.cxf.phase.PhaseInterceptorChain|Int >> >>erc eptor has thrown exception, unwinding now| >> >> org.apache.cxf.interceptor.Fault: Unmarshalling Error: >> UndeclaredPrefix: >> >> Cannot resolve 'ns3:FundingSourceType' as a QName: the prefix 'ns3' is >> >> not >> >> declared. >> >> at >> >> >> org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.jav >> >>a:6 22) at >> >> >> org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.jav >> >>a:5 27) at >> >> org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:108) at >> >> >> org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLite >> >>ral InInterceptor.java:183) at >> >> >> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorC >> >>hai n.java:236) at >> >> >> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiati >> >>onO bserver.java:89) at >> >> >> org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestin >> >>ati on.java:99) at >> >> >> org.apache.cxf.transport.servlet.ServletController.invokeDestination(Ser >> >>vle tController.java:337) at >> >> >> org.apache.cxf.transport.servlet.ServletController.invoke(ServletControl >> >>ler .java:182) at >> >> >> org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFSe >> >>rvl et.java:163) at >> >> >> org.apache.cxf.transport.servlet.AbstractCXFServlet.doPost(AbstractCXFSe >> >>rvl et.java:141) at >> >> javax.servlet.http.HttpServlet.service(HttpServlet.java:710) >> >> >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) >> >> at >> >> >> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica >> >>tio nFilterChain.java:290) at >> >> >> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt >> >>erC hain.java:206) at >> >> >> com.billmelater.enterpriseservices.servlet.util.RequestTimerServletFilte >> >>r.d oFilter(RequestTimerServletFilter.java:55) at >> >> >> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica >> >>tio nFilterChain.java:235) at >> >> >> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt >> >>erC hain.java:206) at >> >> >> org.springframework.security.util.FilterChainProxy$VirtualFilterChain.do >> >>Fil ter(FilterChainProxy.java:378) at >> >> >> org.springframework.security.intercept.web.FilterSecurityInterceptor.inv >> >>oke (FilterSecurityInterceptor.java:109) >> >> >> >> dkulp wrote: >> >> > Did some snooping... The RI seems to have the same problem: >> >> > http://forums.java.net/jive//message.jspa?messageID=268876 >> >> > >> >> > And they mention its a bug in the JDK: >> >> > https://jaxp.dev.java.net/issues/show_bug.cgi?id=46 >> >> > >> >> > The workaround seems to be to use the latest 1.6 JDK or get the >> latest >> >> > sun jaxp parser >> >> > (http://download.java.net/maven/1/com.sun.xml.parsers/jars/ >> >> > ) and throw it in your endorsed dir. >> >> > >> >> > Dan >> >> > >> >> > On Jun 18, 2008, at 2:16 PM, jan.minaroviech@external.t-mobile.at >> >> >> >> wrote: >> >> >> Hi, >> >> >> >> >> >> looks like the same problem i have. But my response is invalid also >> >> >> according to soapUI validation. >> >> >> >> >> >> I'm not using any additional interceptors, only default cxfServlet, >> >> >> default bus config etc, without security, attachments etc. and I'm >> >> >> using >> >> >> jaxWS+jaxB >> >> >> >> >> >> This is response, which is problem in my case (cxf is client in >> this >> >> >> case) >> >> >> >> >> >> > >> >> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >> >> >> xmlns:xsd="http://www.w3.org/2001/XMLSchema" >> >> >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> >> >> >> >> >> >> > >> >> xmlns="http://www.deltavista.at/schema/locationsearch"> >> >> >> >> >> >> Stephansplatz >> >> >> 1 >> >> >> Wien >> >> >> 1010 >> >> >> AUT >> >> >> 4 >> >> >> 92 >> >> >> 98 >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> i have a problem with xsd:string inside reply. >> >> >> >> >> >> pieces of xsd: >> >> >> > >> >> type="locationsearch:Zip" minOccurs="1"/> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> when i turn off validation, everything works >> >> >> >> >> >> best regards >> >> >> jano >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> Daniel Kulp >> >> >> 06/18/2008 20:05 >> >> >> Bitte antworten an >> >> >> users@cxf.apache.org >> >> >> >> >> >> >> >> >> An >> >> >> users@cxf.apache.org >> >> >> Kopie >> >> >> >> >> >> Thema >> >> >> Re: Unmarshalling Error: UndeclaredPrefix: Cannot resolve 'ns0:Xxx' >> >> >> as a >> >> >> QName: the prefix 'ns0' is not declared [Virus checked] >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> Very strange. The message is definitely valid. >> >> >> >> >> >> Could questions: >> >> >> 1) Do you have any SAAJ type handlers/interceptors on the chain >> >> >> (jaxws SOAPHandler, ws-security things, etc...)? >> >> >> >> >> >> 2) I noticed you have a xerces jar... can you try removing that >> and >> >> >> seeing if the JDK built-in parser will work? Also, check if you >> have >> >> >> a xalan jar installed and remove that as well. >> >> >> >> >> >> 3) Can you turn off validation. It looks like it's the validator >> >> >> having an issue, not the unmarshaller. If it unmarshalls OK that >> >> >> way, we at least know the parser is giving it the correct data. >> If >> >> >> that still fails, we'll need to dig in more. >> >> >> >> >> >> Dan >> >> >> >> >> >> On Jun 17, 2008, at 12:33 PM, Urciolo, Kevin wrote: >> >> >>> I am running in to an issue when a Java 5 client using JWSDP is >> >> >>> sending >> >> >>> a request to my CXF (2.1.1 SNAPSHOT) service. I get an exception, >> >> >>> Unmarshalling Error: UndeclaredPrefix: Cannot resolve 'ns0:Xxx' as >> a >> >> >>> QName: the prefix 'ns0' is not declared, as shown below. The type >> >> >>> is an >> >> >>> extension from a base type. I am assuming this is why "xsi:type" >> is >> >> >>> generated by the client since it is not used in other places. >> >> >>> >> >> >>> Is there a reason why CXF is having trouble with this? >> >> >>> >> >> >>> Type From Schema: >> >> >>> >> >> >>> >> >> >>> >> >> >>> > base="tns:Base"> >> >> >>> >> >> >>> > >> >>> minOccurs="1" >> >> >>> >> >> >>> name="a" >> >> >>> nillable="false" type="xs:boolean" /> >> >> >>> > >> >>> minOccurs="1" >> >> >>> >> >> >>> name="b" >> >> >>> nillable="false" type="xs:boolean" /> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >> >> >> ----------------------------------------------------------------------- >> >> >> >> >>>- >> >> >> >> >> ----------------------------------------------------------------------- >> >> >> >> >>>- ----- >> >> >>> >> >> >>> XML Generated: >> >> >>> >> >> >>> >> >> >>> > xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" >> >> >>> xmlns:xsd="http://www.w3.org/2001/XMLSchema" >> >> >>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >> >> >>> xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/" >> >> >>> xmlns:ns0="http://mdc.com"> >> >> >>> >> >> >>> >> >> >>> >> >> >>> xxx >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >> >> >> ----------------------------------------------------------------------- >> >> >> >> >>>- >> >> >> >> >> ----------------------------------------------------------------------- >> >> >> >> >>>- ----- >> >> >>> >> >> >>> Exception In Log: >> >> >>> >> >> >>> INFO: Interceptor has thrown exception, unwinding now >> >> >>> org.apache.cxf.interceptor.Fault: Unmarshalling Error: >> >> >>> UndeclaredPrefix: >> >> >>> Cannot resolve 'ns0:Xxx' as a QName: the prefix 'ns0' is not >> >> >>> declared. >> >> >>> at >> >> >>> org >> >> >>> >> .apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.ja >> >> >>>v a:643) >> >> >>> at >> >> >>> org >> >> >>> >> .apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.ja >> >> >>>v a:555) >> >> >>> at >> >> >>> org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:64) >> >> >>> at >> >> >>> org >> >> >>> >> .apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLit >> >> >>>e ralInInterceptor.java:183) >> >> >>> at >> >> >>> org >> >> >>> >> .apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptor >> >> >>>C hain.java:221) >> >> >>> at >> >> >>> org >> >> >>> >> .apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiat >> >> >>>i onObserver.java:78) >> >> >>> at >> >> >>> org >> >> >>> >> .apache.cxf.transport.servlet.ServletDestination.invoke(ServletDesti >> >> >>>n ation.java:92) >> >> >>> at >> >> >>> org >> >> >>> >> .apache.cxf.transport.servlet.ServletController.invokeDestination(Se >> >> >>>r vletController.java:279) >> >> >>> at >> >> >>> org >> >> >>> >> .apache.cxf.transport.servlet.ServletController.invoke(ServletContro >> >> >>>l ler.java:161) >> >> >>> at >> >> >>> org >> >> >>> >> .apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFS >> >> >>>e rvlet.java:174) >> >> >>> at >> >> >>> org >> >> >>> >> .apache.cxf.transport.servlet.AbstractCXFServlet.doPost(AbstractCXFS >> >> >>>e rvlet.java:152) >> >> >>> at >> >> >>> javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at >> >> >>> javax.servlet.http.HttpServlet.service(HttpServlet.java:810) at >> >> >>> org >> >> >>> >> .apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic >> >> >>>a tionFilterChain.java:252) >> >> >>> at >> >> >>> org >> >> >>> >> .apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil >> >> >>>t erChain.java:173) >> >> >>> at >> >> >>> org >> >> >>> >> .jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilt >> >> >>>e r.java:96) >> >> >>> at >> >> >>> org >> >> >>> >> .apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic >> >> >>>a tionFilterChain.java:202) >> >> >>> at >> >> >>> org >> >> >>> >> .apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil >> >> >>>t erChain.java:173) >> >> >>> at >> >> >>> org >> >> >>> >> .apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVal >> >> >>>v e.java:213) >> >> >>> at >> >> >>> org >> >> >>> >> .apache.catalina.core.StandardContextValve.invoke(StandardContextVal >> >> >>>v e.java:178) >> >> >>> at >> >> >>> org >> >> >>> >> .jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityA >> >> >>>s sociationValve.java:175) >> >> >>> at >> >> >>> org >> >> >>> >> .jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve. >> >> >>>j ava:74) >> >> >>> at >> >> >>> org >> >> >>> >> .apache.catalina.core.StandardHostValve.invoke(StandardHostValve.jav >> >> >>>a >> >> >>> >> >> >>> :126) >> >> >>> >> >> >>> at >> >> >>> org >> >> >>> >> .apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.jav >> >> >>>a >> >> >>> >> >> >>> :105) >> >> >>> >> >> >>> at >> >> >>> org >> >> >>> >> .jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnect >> >> >>>i onValve.java:156) >> >> >>> at >> >> >>> org >> >> >>> >> .apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve >> >> >>>. java:107) >> >> >>> at >> >> >>> org >> >> >>> >> .apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java: >> >> >>>1 48) >> >> >>> at >> >> >>> org >> >> >>> >> .apache.coyote.http11.Http11Processor.process(Http11Processor.java:8 >> >> >>>6 9) >> >> >>> at >> >> >>> org.apache.coyote.http11.Http11BaseProtocol >> >> >>> $Http11ConnectionHandler.proc >> >> >>> essConnection(Http11BaseProtocol.java:664) >> >> >>> at >> >> >>> org >> >> >>> >> .apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoin >> >> >>>t .java:527) >> >> >>> at >> >> >>> org >> >> >>> >> .apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorke >> >> >>>r Thread.java:112) >> >> >>> at java.lang.Thread.run(Thread.java:619) >> >> >>> Caused by: javax.xml.bind.UnmarshalException >> >> >>> - with linked exception: >> >> >>> [org.xml.sax.SAXParseException: UndeclaredPrefix: Cannot resolve >> >> >>> 'ns0:Xxx' as a QName: the prefix 'ns0' is not declared.] >> >> >>> at >> >> >>> com >> >> >>> >> .sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamE >> >> >>>x ception(UnmarshallerImpl.java:396) >> >> >>> at >> >> >>> com >> >> >>> >> .sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(Un >> >> >>>m arshallerImpl.java:335) >> >> >>> at >> >> >>> com >> >> >>> >> .sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(Unm >> >> >>>a rshallerImpl.java:312) >> >> >>> at >> >> >>> org >> >> >>> >> .apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.ja >> >> >>>v a:628) >> >> >>> ... 31 more >> >> >>> Caused by: org.xml.sax.SAXParseException: UndeclaredPrefix: Cannot >> >> >>> resolve 'ns0:Xxx' as a QName: the prefix 'ns0' is not declared. >> >> >>> at >> >> >>> org >> >> >>> >> .apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unkn >> >> >>>o wn Source) >> >> >>> at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown >> >> >>> Source) >> >> >>> at >> org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown >> >> >>> Source) >> >> >>> at >> org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown >> >> >>> Source) >> >> >>> at >> >> >>> org.apache.xerces.impl.xs.XMLSchemaValidator >> >> >>> $XSIErrorReporter.reportErro >> >> >>> r(Unknown Source) >> >> >>> at >> >> >>> org >> >> >>> >> .apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown >> >> >>> Source) >> >> >>> at >> >> >>> org >> >> >>> >> .apache.xerces.impl.xs.XMLSchemaValidator.getAndCheckXsiType(Unknown >> >> >>> Source) >> >> >>> at >> >> >>> org >> >> >>> >> .apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown >> >> >>> Source) >> >> >>> at >> >> >>> org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown >> >> >>> Source) >> >> >>> at >> >> >>> org >> >> >>> >> .apache.xerces.jaxp.validation.ValidatorHandlerImpl.startElement(Unk >> >> >>>n own Source) >> >> >>> at >> >> >>> com >> >> >>> >> .sun.xml.bind.v2.runtime.unmarshaller.ValidatingUnmarshaller.startEl >> >> >>>e ment(ValidatingUnmarshaller.java:73) >> >> >>> at >> >> >>> com >> >> >>> >> .sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleStar >> >> >>>t Element(StAXStreamConnector.java:238) >> >> >>> at >> >> >>> com >> >> >>> >> .sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StA >> >> >>>X StreamConnector.java:172) >> >> >>> at >> >> >>> com >> >> >>> >> .sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(Un >> >> >>>m arshallerImpl.java:333) >> >> >>> ... 33 more >> >> >> >> >> >> --- >> >> >> Daniel Kulp >> >> >> dkulp@apache.org >> >> >> http://www.dankulp.com/blog >> >> > >> >> > --- >> >> > Daniel Kulp >> >> > dkulp@apache.org >> >> > http://www.dankulp.com/blog >> > >> > -- >> > Daniel Kulp >> > dkulp@apache.org >> > http://www.dankulp.com/blog > > -- > Daniel Kulp > dkulp@apache.org > http://www.dankulp.com/blog > > -- View this message in context: http://www.nabble.com/Unmarshalling-Error%3A-UndeclaredPrefix%3A-Cannot-resolve-%27ns0%3AXxx%27-as-a-QName%3A-the-prefix-%27ns0%27-is-not-declared-tp17918441p24486562.html Sent from the cxf-user mailing list archive at Nabble.com.