cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: CXFNonSpringServlet failure in 2.2.7
Date Wed, 07 Apr 2010 01:49:12 GMT
On Tuesday 06 April 2010 9:41:16 pm Willem Jiang wrote:
> Daniel Kulp wrote:
> > No, we cannot do that.   There are a lot of things (like all the WS-
> > SecurityPolicy stuff) that won't work without the Spring stuff.   The
> > non- spring bus works fine for regular JAX-WS stuff, but any of the
> > advanced use cases require the full Spring bus.
> > 
> > Dan
> 
> Oh, I don't want to change the code of BusFactory.newInstance().
> I just want to change the code in CXFNonSpringServlet.loadBusNoConfig()
> 
> private void loadBusNoConfig(ServletConfig servletConfig) throws
> ServletException {
> 
>          if (bus == null) {
>              LOG.info("LOAD_BUS_WITHOUT_APPLICATION_CONTEXT");
> -            bus = BusFactory.newInstance().createBus();
> +            BusFactory bf = new CXFBusFactory();
> +            bus = bf.createBus();
>          }

That's my point though.  If you do that, no sevices that are deployed using 
the NonSpringServlet will be able to use WS-SecurityPolicy.   I don't think 
they'll be able to use the new annotations in 2.3, etc....   I'd definitely 
prefer that those features work by default in all cases.   Currently, if you 
DON'T have spring, they won't work.   But to get them to work, you just add 
the spring jars.   With your change, you would not only need to add the spring 
jars, you would need to flip completely over to the Spring based servlet, 
write the spring config files, etc....

Dan



> ...
> 
> >> Willem
> >> 
> >> Lucas Madar wrote:
> >>> I'm running into a problem with CXF 2.2.7 release when
> >>> CXFNonSpringServlet.loadBus() is called. This was not an issue with
> >>> 2.2.6. As far as I can tell, this issue was reported for several
> >>> previous versions but is marked as fixed. Is anyone else running in to
> >>> this issue?
> >>> 
> >>> Thanks,
> >>> Lucas Madar
> >>> 
> >>> java.lang.RuntimeException:
> >>> org.springframework.beans.factory.BeanDefinitionStoreException:
> >>> Unexpected exception parsing XML document from class path resource
> >>> [META-INF/cxf/cxf.xml]; nested exception is
> >>> javax.xml.stream.XMLStreamException: org.w3c.dom.DOMException:
> >>> NAMESPACE_ERR: An attempt is made to create or change an object in a
> >>> way which is incorrect with regard to namespaces.
> >>> 
> >>>     at
> >>> 
> >>> org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.j
> >>> av a:96)
> >>> 
> >>>     at
> >>> 
> >>> org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.j
> >>> av a:86)
> >>> 
> >>>     at
> >>> 
> >>> org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.j
> >>> av a:64)
> >>> 
> >>>     at
> >>> 
> >>> org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.j
> >>> av a:53)
> >>> 
> >>>     at
> >>> 
> >>> org.apache.cxf.transport.servlet.CXFNonSpringServlet.loadBusNoConfig(CX
> >>> FN onSpringServlet.java:45)
> >>> 
> >>>     at
> >>> 
> >>> org.apache.cxf.transport.servlet.CXFNonSpringServlet.loadBus(CXFNonSpri
> >>> ng Servlet.java:38)
> >>> 
> >>>     at
> >>> 
> >>> com.samsix.http.util.WebServiceServlet.loadBus(WebServiceServlet.java:4
> >>> 1)
> >>> 
> >>>     at
> >>> 
> >>> org.apache.cxf.transport.servlet.AbstractCXFServlet.init(AbstractCXFSer
> >>> vl et.java:78)
> >>> 
> >>>     at
> >>> 
> >>> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.ja
> >>> va
> >>> 
> >>> :1173)
> >>> :
> >>>     at
> >>> 
> >>> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
> >>> 
> >>>     at
> >>> 
> >>> org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.
> >>> ja va:4149)
> >>> 
> >>>     at
> >>> 
> >>> org.apache.catalina.core.StandardContext.start(StandardContext.java:445
> >>> 8)
> >>> 
> >>>     at
> >>> 
> >>> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
> >>> 
> >>>     at
> >>>     org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
> >>>     at
> >>> 
> >>> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
> >>> 
> >>>     at
> >>> 
> >>> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
> >>> 
> >>>     at
> >>> 
> >>> org.apache.catalina.core.StandardService.start(StandardService.java:516
> >>> )
> >>> 
> >>>     at
> >>> 
> >>> org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
> >>> 
> >>>     at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
> >>>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >>>     at
> >>> 
> >>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.ja
> >>> va
> >>> 
> >>> :39)
> >>> :
> >>>     at
> >>> 
> >>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesso
> >>> rI mpl.java:25)
> >>> 
> >>>     at java.lang.reflect.Method.invoke(Method.java:597)
> >>>     at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
> >>>     at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
> >>> 
> >>> Caused by:
> >>> org.springframework.beans.factory.BeanDefinitionStoreException:
> >>> Unexpected exception parsing XML document from class path resource
> >>> [META-INF/cxf/cxf.xml]; nested exception is
> >>> javax.xml.stream.XMLStreamException: org.w3c.dom.DOMException:
> >>> NAMESPACE_ERR: An attempt is made to create or change an object in a
> >>> way which is incorrect with regard to namespaces.
> >>> 
> >>>     at
> >>> 
> >>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBea
> >>> nD efinitions(XmlBeanDefinitionReader.java:375)
> >>> 
> >>>     at
> >>> 
> >>> org.apache.cxf.bus.spring.ControlledValidationXmlBeanDefinitionReader.d
> >>> oL
> >>> oadBeanDefinitions(ControlledValidationXmlBeanDefinitionReader.java:10
> >>> 9)
> >>> 
> >>>     at
> >>> 
> >>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanD
> >>> ef initions(XmlBeanDefinitionReader.java:303)
> >>> 
> >>>     at
> >>> 
> >>> org.apache.cxf.bus.spring.ControlledValidationXmlBeanDefinitionReader.l
> >>> oa
> >>> dBeanDefinitions(ControlledValidationXmlBeanDefinitionReader.java:131)
> >>> 
> >>>     at
> >>> 
> >>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanD
> >>> ef initions(XmlBeanDefinitionReader.java:280)
> >>> 
> >>>     at
> >>> 
> >>> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.
> >>> lo adBeanDefinitions(AbstractBeanDefinitionReader.java:142)
> >>> 
> >>>     at
> >>> 
> >>> org.springframework.context.support.AbstractXmlApplicationContext.loadB
> >>> ea nDefinitions(AbstractXmlApplicationContext.java:108)
> >>> 
> >>>     at
> >>> 
> >>> org.apache.cxf.bus.spring.BusApplicationContext.loadBeanDefinitions(Bus
> >>> Ap plicationContext.java:262)
> >>> 
> >>>     at
> >>> 
> >>> org.springframework.context.support.AbstractRefreshableApplicationConte
> >>> xt .refreshBeanFactory(AbstractRefreshableApplicationContext.java:101)
> >>> 
> >>>     at
> >>> 
> >>> org.springframework.context.support.AbstractApplicationContext.obtainFr
> >>> es hBeanFactory(AbstractApplicationContext.java:389)
> >>> 
> >>>     at
> >>> 
> >>> org.springframework.context.support.AbstractApplicationContext.refresh(
> >>> Ab stractApplicationContext.java:324)
> >>> 
> >>>     at
> >>> 
> >>> org.apache.cxf.bus.spring.BusApplicationContext.<init>(BusApplicationCo
> >>> nt ext.java:91)
> >>> 
> >>>     at
> >>> 
> >>> org.apache.cxf.bus.spring.SpringBusFactory.createApplicationContext(Spr
> >>> in gBusFactory.java:102)
> >>> 
> >>>     at
> >>> 
> >>> org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.j
> >>> av a:93)
> >>> 
> >>>     ... 24 more
> >>> 
> >>> Caused by: javax.xml.stream.XMLStreamException:
> >>> org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create
> >>> or change an object in a way which is incorrect with regard to
> >>> namespaces.
> >>> 
> >>>     at org.apache.cxf.staxutils.StaxUtils.copy(StaxUtils.java:370)
> >>>     at
> >>> 
> >>> org.apache.cxf.bus.spring.TunedDocumentLoader.loadDocument(TunedDocumen
> >>> tL oader.java:113)
> >>> 
> >>>     at
> >>> 
> >>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBea
> >>> nD efinitions(XmlBeanDefinitionReader.java:351)
> >>> 
> >>>     ... 37 more
> >>> 
> >>> Caused by: org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made
> >>> to create or change an object in a way which is incorrect with regard
> >>> to namespaces.
> >>> 
> >>>     at
> >>> 
> >>> com.sun.org.apache.xerces.internal.dom.AttrNSImpl.setName(AttrNSImpl.ja
> >>> va
> >>> 
> >>> :105)
> >>> :
> >>>     at
> >>> 
> >>> com.sun.org.apache.xerces.internal.dom.AttrNSImpl.<init>(AttrNSImpl.jav
> >>> a: 74)
> >>> 
> >>>     at
> >>> 
> >>> com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.createAttribute
> >>> NS (CoreDocumentImpl.java:2127)
> >>> 
> >>>     at
> >>> 
> >>> org.apache.cxf.staxutils.W3CDOMStreamWriter.writeAttribute(W3CDOMStream
> >>> Wr iter.java:176)
> >>> 
> >>>     at
> >>> 
> >>> org.apache.cxf.staxutils.StreamWriterContentHandler.startElement(Stream
> >>> Wr iterContentHandler.java:217)
> >>> 
> >>>     at
> >>> 
> >>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startEleme
> >>> nt (AbstractSAXParser.java:501)
> >>> 
> >>>     at
> >>> 
> >>> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanSt
> >>> ar tElement(XMLNSDocumentScannerImpl.java:400)
> >>> 
> >>>     at
> >>> 
> >>> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSCont
> >>> en tDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:626)
> >>> 
> >>>     at
> >>> 
> >>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$
> >>> Fr agmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3095)
> >>> 
> >>>     at
> >>> 
> >>> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDr
> >>> iv er.next(XMLDocumentScannerImpl.java:922)
> >>> 
> >>>     at
> >>> 
> >>> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XML
> >>> Do cumentScannerImpl.java:648)
> >>> 
> >>>     at
> >>> 
> >>> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(X
> >>> ML NSDocumentScannerImpl.java:140)
> >>> 
> >>>     at
> >>> 
> >>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.
> >>> sc anDocument(XMLDocumentFragmentScannerImpl.java:510)
> >>> 
> >>>     at
> >>> 
> >>> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML
> >>> 11 Configuration.java:807)
> >>> 
> >>>     at
> >>> 
> >>> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML
> >>> 11 Configuration.java:737)
> >>> 
> >>>     at
> >>> 
> >>> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.ja
> >>> va
> >>> 
> >>> :107)
> >>> :
> >>>     at
> >>> 
> >>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Abst
> >>> ra ctSAXParser.java:1205)
> >>> 
> >>>     at
> >>> 
> >>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.par
> >>> se (SAXParserImpl.java:522)
> >>> 
> >>>     at org.apache.cxf.staxutils.StaxUtils.copy(StaxUtils.java:367)
> >>>     ... 39 more

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog

Mime
View raw message