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">

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 <[email protected]> wrote:
> On Tuesday, December 06, 2011 1:55:02 PM rouble wrote:
>> After some debugging in CXF, it looks like in the method:
>>
>> org.apache.cxf.databinding.AbstractDataBinding.addSchemaDocument(), on line
>> 98, d.getDocumentElement().getNamespaceURI() returns a null pointer.
>
> That's really strange.   Can you debug into the document element to see what
> the element name is and the element's prefix and such?    I'll add a better
> error message at this line to have it include the full qname that it found
> with the error message.   Very strange though.
>
> Dan
>
>
>
>> Does anyone know why that might be? No other logs shed any light on
>> why the servlet is going down.
>
>
>
>>
>> tia,
>> rouble
>>
>> On Sat, Dec 3, 2011 at 3:24 PM, rouble <[email protected]> wrote:
>> > CXF Gurus,
>> >
>> > I am running into an intermittent issue with a CXF web service. The
>> > web service impl bean gets created and its @PostConstruct get called.
>> > Everything seems to run fine, and then with no CXF logs, everything
>> > starts to get torn down. The first log I see says, "Destroying
>> > singletons" and then the @Predestroys get called. And then I see,
>> > "Invalid schema document passed to
>> > AbstractDataBinding.addSchemaDocument, not in W3C schema namespace".
>> > This doesn't make sense because the service successfully started
>> > previously on the same box in the same web container (Tomcat 6.0.29).
>> >
>> > The logs are as follows:
>> > <No logs before this seem to suggest why the service is being taken
>> > down>
>> >
>> > 2011-12-03 14:44:32,822 INFO
>> > [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Destroying
>> > singletons in
>> > org.springframework.beans.factory.support.DefaultListableBeanFactory@17
>> > 3a03d: defining beans
>> > [template,cxf,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcess
>> > or,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.
>> > spring.BusExtensionPostProcessor,org.apache.cxf.binding.soap.SoapBinding
>> > Factory,org.apache.cxf.binding.soap.SoapTransportFactory,org.apache.cxf.
>> > binding.soap.customEditorConfigurer,myWebServiceImpl_v2,myWebService_v2]
>> > ;
>> >
>> > 2011-12-03 14:44:32,868 WARN
>> > [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Invocation of
>> > destroy method 'shutdown' failed on bean with name 'cxf':
>> > org.springframework.beans.factory.BeanCreationNotAllowedException:
>> > Error creating bean with name 'template': Singleton bean creation not
>> > allowed while the singletons of this factory are in destruction (Do
>> > not request a bean from a BeanFactory in a destroy method
>> > implementation!)
>> >
>> > 2011-12-03 14:44:32,868 ERROR
>> > [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Context
>> > initialization failed
>> > org.springframework.beans.factory.BeanCreationException: Error
>> > creating bean with name 'myWebService_v2': Invocation of init method
>> > failed; nested exception is javax.xml.ws.WebServiceException:
>> > java.lang.RuntimeException: Invalid schema document passed to
>> > AbstractDataBinding.addSchemaDocument, not in W3C schema namespace
>> >        at
>> > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFa
>> > ctory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420) at
>> > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFa
>> > ctory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at
>> > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFa
>> > ctory.createBean(AbstractAutowireCapableBeanFactory.java:456) at
>> > org.springframework.beans.factory.support.AbstractBeanFactory$1.getObje
>> > ct(AbstractBeanFactory.java:291) at
>> > org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.
>> > getSingleton(DefaultSingletonBeanRegistry.java:222) at
>> > org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean
>> > (AbstractBeanFactory.java:288) at
>> > org.springframework.beans.factory.support.AbstractBeanFactory.getBean(A
>> > bstractBeanFactory.java:190) Caused by:
>> > javax.xml.ws.WebServiceException:
>> > java.lang.RuntimeException: Invalid schema document passed to
>> > AbstractDataBinding.addSchemaDocument, not in W3C schema namespace
>> >        at
>> > org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:350) at
>> > org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:239) at
>> > org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:509) at
>> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
>> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.ja
>> > va:39) at
>> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesso
>> > rImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597)
>> >        at
>> > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFa
>> > ctory$7.run(AbstractAutowireCapableBeanFactory.java:1531) at
>> > java.security.AccessController.doPrivileged(Native Method) at
>> > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFa
>> > ctory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:152
>> > 9) at
>> > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFa
>> > ctory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1485) at
>> > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFa
>> > ctory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
>> > Caused by: java.lang.RuntimeException: Invalid schema document passed
>> > to AbstractDataBinding.addSchemaDocument, not in W3C schema namespace
>> > at
>> > org.apache.cxf.databinding.AbstractDataBinding.addSchemaDocument(Abstra
>> > ctDataBinding.java:98) at
>> > org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:344
>> > ) at
>> > org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDat
>> > aBindings(AbstractServiceFactoryBean.java:86) at
>> > org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServic
>> > eFromClass(ReflectionServiceFactoryBean.java:438) at
>> > org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.buildServiceFromCl
>> > ass(JaxWsServiceFactoryBean.java:682) at
>> > org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeS
>> > erviceModel(ReflectionServiceFactoryBean.java:501) at
>> > org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Refl
>> > ectionServiceFactoryBean.java:241) at
>> > org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServic
>> > eFactoryBean.java:202) at
>> > org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint
>> > (AbstractWSDLBasedEndpointFactory.java:101) at
>> > org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java
>> > :157) at
>> > org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBe
>> > an.java:202) at
>> > org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:433) at
>> > org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:322)
>> >
>> > The issue is intermittent, so sometimes restarting tomcat fixes the
>> > issue. But now we have one box where the issue happens every time.
>> >
>> > tia,
>> > rouble
> --
> Daniel Kulp
> [email protected] - http://dankulp.com/blog
> Talend Community Coder - http://coders.talend.com

Reply via email to