cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: web service goes down (for no apparent reason)
Date Thu, 08 Dec 2011 15:54:55 GMT
On Wednesday, December 07, 2011 4:24:20 PM rouble wrote:
> This is a java first service, so CXF is generating the faulty schema.
> 
> We have two (almost identical) boxes, with tomcat. 

I love the "almost identical"....  :-)

> On one this issue
> is reproducible, on the other it is not. The war file is the same.
> 
> Any tips on how to debug this further? It seems to be related to how
> CXF generates the context, because the schemas are generated from the
> context.

If you can do so, can you breakpoint in JAXBUtils.generateJaxbSchemas and, 
prior to the return, kind of dig into the list of DOMSource objects and see if 
the root elements are properly qualified or not.

The main "cause" of something like this MAY be an older version of Xerces or 
other XML parser that  could possibly be picked up.   Maybe from the tomcat 
shared/lib dir of jre/lib/endorsed or similar.    It could be the DOM 
implementation is bad.   Another issue COULD be different versions of JAXB 
being picked up.   Check that as well.

Dan




> 
> tia,
> rouble
> 
> On Wed, Dec 7, 2011 at 2:50 PM, Daniel Kulp <dkulp@apache.org> wrote:
> > On Wednesday, December 07, 2011 2:43:11 PM rouble wrote:
> >> After some more CXF debuggging:
> >> 
> >> This is what the top of the document looks like in the working case,
> >> when getNamespaceURI() does not return null:
> >>     <?xml version="1.0" encoding="UTF-8"?>
> >>     <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> >> xmlns:tns="example.com" targetNamespace="example.com" version="1.0">
> >> 
> >> and this is what the top of the document looks like in the non-working
> >> case, when getNamespaceURI() returns null:
> >>     <?xml version="1.0" encoding="UTF-8"?>
> >>     <schema xmlns:tns="example.com"
> >> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> >> targetNamespace="example.com" version="1.0">
> > 
> > Actually, they aren't the same at all.   In the second case, the schema
> > is NOT in a namespace.   It would need the xs: prefix or it would need
> > an xmlns="http://www.w3.org/2001/XMLSchema".   In this case, the schema
> > really is invalid.
> > 
> > Now, the next question is: where/how is that schema generated?   Is CXF
> > generating that invalid schema?
> > 
> > Dan
> > 
> >> Notice that the schema is in the W3C namespace, it is just ordered
> >> differently. And for some reason,
> >> d.getDocumentElement().getNamespaceURI() is set to null.
> >> 
> >> Also, if I take out the code that throws the exception in
> >> AbstractDataBinding.addSchemaDocument, "Invalid schema document passed
> >> to AbstractDataBinding.addSchemaDocument, not in W3C schema
> >> namespace", I start to see a bunch of:
> >> factory.ReflectionServiceFactoryBean - Schema element
> >> {http://example.com/}foo references undefined type
> >> {http://example.com/}foo for service {http://example.com/}FooService.
> >> 
> >> Any ideas how I can debug why d.getDocumentElement().getNamespaceURI()
> >> is being set to null in some cases?
> >> 
> >> tia,
> >> rouble
> > 
> >> On Tue, Dec 6, 2011 at 3:19 PM, Daniel Kulp <dkulp@apache.org> wrote:
> > --
> > Daniel Kulp
> > dkulp@apache.org - http://dankulp.com/blog
> > Talend Community Coder - http://coders.talend.com
-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Mime
View raw message