You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Christian Vest Hansen <ka...@gmail.com> on 2007/07/09 09:57:51 UTC

validation error; missing schema

Hello,

When I try to deploy a CXF application, Spring barfs during its
configuration stage claiming that my beans.xml file isn't valid - in
particular, it dosn't like the CXF/jaxws specific tags.

This is probably because it can't find the schema that defines these
tags, because I found this in the log:

09:38:16,808 WARN  [XmlBeanDefinitionReader] Ignored XML validation warning
org.xml.sax.SAXParseException: schema_reference.4: Failed to read
schema document 'http://cxf.apache.org/schema/jaxws.xsd', because 1)
could not find the document; 2) the document could not be read; 3) the
root element of the document is not <xsd:schema>.
	at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
Source)
	at org.apache.xerces.util.ErrorHandlerWrapper.warning(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.traversers.XSDHandler.reportSchemaWarning(Unknown
Source)
	at org.apache.xerces.impl.xs.traversers.XSDHandler.getSchemaDocument(Unknown
Source)
	at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source)
	at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
	at org.apache.xerces.impl.xs.XMLSchemaValidator.findSchemaGrammar(Unknown
Source)
	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown
Source)
	at org.apache.xerces.impl.xs.XMLSchemaValidator.emptyElement(Unknown Source)
	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
	at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76)
	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:351)
	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)
	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:280)
	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:131)
	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:147)
	at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
	at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)
	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:100)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:313)
	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:241)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3854)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4359)


And indeed, when I go to the http://cxf.apache.org/schema/jaxws.xsd
URL, I get a 404.

This, later on in the log, causes Spring to throw this angry stack
trace in my general direction:

09:38:16,812 ERROR [ContextLoader] Context initialization failed
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
Line 15 in XML document from ServletContext resource
[/WEB-INF/classes/beans.xml] is invalid; nested exception is
org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching
wildcard is strict, but no declaration can be found for element
'jaxws:endpoint'.
Caused by:
org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching
wildcard is strict, but no declaration can be found for element
'jaxws:endpoint'.
	at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
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.reportError(Unknown
Source)
	at org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown
Source)
	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown
Source)
	at org.apache.xerces.impl.xs.XMLSchemaValidator.emptyElement(Unknown Source)
	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
	at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76)


So.... how do I get past this? any ideas?


-- 
Venlig hilsen / Kind regards,
Christian Vest Hansen.

Re: validation error; missing schema

Posted by Freeman Fang <fr...@iona.com>.
Hi Christian,
Would you please append your spring configuration file?
CXF spring schema namespace changed recently
You can get more details about this topic from cxf-dev mailing list 
which title is "Schema namespaces and public URIs"
And build kit from latest trunk to see how latest samples use the spring 
configuration.
Basicly, for jaxws configuration, there should be
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="http://cxf.apache.org/jaxws 
http://cxf.apache.org/schemas/jaxws.xsd"
for beans definition. Is it same as you used in your spring file?
Cheers

Freeman

Christian Vest Hansen wrote:
> Hello,
>
> When I try to deploy a CXF application, Spring barfs during its
> configuration stage claiming that my beans.xml file isn't valid - in
> particular, it dosn't like the CXF/jaxws specific tags.
>
> This is probably because it can't find the schema that defines these
> tags, because I found this in the log:
>
> 09:38:16,808 WARN  [XmlBeanDefinitionReader] Ignored XML validation 
> warning
> org.xml.sax.SAXParseException: schema_reference.4: Failed to read
> schema document 'http://cxf.apache.org/schema/jaxws.xsd', because 1)
> could not find the document; 2) the document could not be read; 3) the
> root element of the document is not <xsd:schema>.
>     at 
> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown 
>
> Source)
>     at org.apache.xerces.util.ErrorHandlerWrapper.warning(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.traversers.XSDHandler.reportSchemaWarning(Unknown 
>
> Source)
>     at 
> org.apache.xerces.impl.xs.traversers.XSDHandler.getSchemaDocument(Unknown
> Source)
>     at 
> org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown 
> Source)
>     at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown 
> Source)
>     at 
> org.apache.xerces.impl.xs.XMLSchemaValidator.findSchemaGrammar(Unknown
> Source)
>     at 
> org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown
> Source)
>     at 
> org.apache.xerces.impl.xs.XMLSchemaValidator.emptyElement(Unknown Source)
>     at 
> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
> Source)
>     at 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown 
>
> Source)
>     at 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown 
>
> Source)
>     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>     at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>     at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
>     at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
>     at 
> org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76) 
>
>     at 
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:351) 
>
>     at 
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303) 
>
>     at 
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:280) 
>
>     at 
> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:131) 
>
>     at 
> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:147) 
>
>     at 
> org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124) 
>
>     at 
> org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92) 
>
>     at 
> org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:100) 
>
>     at 
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:313) 
>
>     at 
> org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:241) 
>
>     at 
> org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184) 
>
>     at 
> org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49) 
>
>     at 
> org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3854) 
>
>     at 
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4359)
>
>
> And indeed, when I go to the http://cxf.apache.org/schema/jaxws.xsd
> URL, I get a 404.
>
> This, later on in the log, causes Spring to throw this angry stack
> trace in my general direction:
>
> 09:38:16,812 ERROR [ContextLoader] Context initialization failed
> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
> Line 15 in XML document from ServletContext resource
> [/WEB-INF/classes/beans.xml] is invalid; nested exception is
> org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching
> wildcard is strict, but no declaration can be found for element
> 'jaxws:endpoint'.
> Caused by:
> org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching
> wildcard is strict, but no declaration can be found for element
> 'jaxws:endpoint'.
>     at 
> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown 
>
> 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.reportError(Unknown 
>
> Source)
>     at 
> org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown
> Source)
>     at 
> org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown
> Source)
>     at 
> org.apache.xerces.impl.xs.XMLSchemaValidator.emptyElement(Unknown Source)
>     at 
> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
> Source)
>     at 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown 
>
> Source)
>     at 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown 
>
> Source)
>     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>     at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>     at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
>     at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
>     at 
> org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76) 
>
>
>
> So.... how do I get past this? any ideas?
>
>

Re: validation error; missing schema

Posted by Christian Vest Hansen <ka...@gmail.com>.
Wow, thanks a ton for responding this quick :)

I'm building with Maven, so when I saw this:

> Yes you can't get the schema form the url,  CXF put the jaxws scheme in
> to cxf-rt-frontend-jaxws-2.0-incubator.jar

The light-bulp above my head blinked, and when I added this dependency:

    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-frontend-jaxws</artifactId>
      <version>2.0-incubator</version>
    </dependency>

my deployment issues were gone.

Thanks a lot for the help. :)


2007/7/9, Willem Jiang <ni...@iona.com>:
> Hi
>
> I think you beans.xml is out of time. There are some changes happened in
> the CXF-2.0-incubator, if you are using the latest release.
>
> Yes you can't get the schema form the url,  CXF put the jaxws scheme in
> to cxf-rt-frontend-jaxws-2.0-incubator.jar
>
> Please take the below configuration as a example.
>
> <beans xmlns="http://www.springframework.org/schema/beans"
>       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>       xmlns:jaxws="http://cxf.apache.org/jaxws"
>       xsi:schemaLocation="
> http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
> http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
>
> ~~~~~ the schemas' url has been changed.
>   <jaxws:endpoint
>     id="greeter1"
>     address="/greeter"
>       implementor="org.apache.hello_world_soap_http.GreeterImpl"
>
> wsdlLocation="/org/apache/cxf/systest/servlet/hello_world.wsdl"      />
>
> Cheers,
>
> Willem.
>
> Christian Vest Hansen wrote:
> > Hello,
> >
> > When I try to deploy a CXF application, Spring barfs during its
> > configuration stage claiming that my beans.xml file isn't valid - in
> > particular, it dosn't like the CXF/jaxws specific tags.
> >
> > This is probably because it can't find the schema that defines these
> > tags, because I found this in the log:
> >
> > 09:38:16,808 WARN  [XmlBeanDefinitionReader] Ignored XML validation
> > warning
> > org.xml.sax.SAXParseException: schema_reference.4: Failed to read
> > schema document 'http://cxf.apache.org/schema/jaxws.xsd', because 1)
> > could not find the document; 2) the document could not be read; 3) the
> > root element of the document is not <xsd:schema>.
> >     at
> > org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
> >
> > Source)
> >     at org.apache.xerces.util.ErrorHandlerWrapper.warning(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.traversers.XSDHandler.reportSchemaWarning(Unknown
> >
> > Source)
> >     at
> > org.apache.xerces.impl.xs.traversers.XSDHandler.getSchemaDocument(Unknown
> > Source)
> >     at
> > org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown
> > Source)
> >     at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown
> > Source)
> >     at
> > org.apache.xerces.impl.xs.XMLSchemaValidator.findSchemaGrammar(Unknown
> > Source)
> >     at
> > org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown
> > Source)
> >     at
> > org.apache.xerces.impl.xs.XMLSchemaValidator.emptyElement(Unknown Source)
> >     at
> > org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
> > Source)
> >     at
> > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
> >
> > Source)
> >     at
> > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> >
> > Source)
> >     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> >     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> >     at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> >     at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
> >     at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
> >     at
> > org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76)
> >
> >     at
> > org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:351)
> >
> >     at
> > org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)
> >
> >     at
> > org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:280)
> >
> >     at
> > org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:131)
> >
> >     at
> > org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:147)
> >
> >     at
> > org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
> >
> >     at
> > org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)
> >
> >     at
> > org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:100)
> >
> >     at
> > org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:313)
> >
> >     at
> > org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:241)
> >
> >     at
> > org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
> >
> >     at
> > org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
> >
> >     at
> > org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3854)
> >
> >     at
> > org.apache.catalina.core.StandardContext.start(StandardContext.java:4359)
> >
> >
> > And indeed, when I go to the http://cxf.apache.org/schema/jaxws.xsd
> > URL, I get a 404.
> >
> > This, later on in the log, causes Spring to throw this angry stack
> > trace in my general direction:
> >
> > 09:38:16,812 ERROR [ContextLoader] Context initialization failed
> > org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
> > Line 15 in XML document from ServletContext resource
> > [/WEB-INF/classes/beans.xml] is invalid; nested exception is
> > org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching
> > wildcard is strict, but no declaration can be found for element
> > 'jaxws:endpoint'.
> > Caused by:
> > org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching
> > wildcard is strict, but no declaration can be found for element
> > 'jaxws:endpoint'.
> >     at
> > org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
> >
> > 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.reportError(Unknown
> >
> > Source)
> >     at
> > org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown
> > Source)
> >     at
> > org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown
> > Source)
> >     at
> > org.apache.xerces.impl.xs.XMLSchemaValidator.emptyElement(Unknown Source)
> >     at
> > org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
> > Source)
> >     at
> > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
> >
> > Source)
> >     at
> > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> >
> > Source)
> >     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> >     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> >     at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> >     at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
> >     at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
> >     at
> > org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76)
> >
> >
> >
> > So.... how do I get past this? any ideas?
> >
> >
>


-- 
Venlig hilsen / Kind regards,
Christian Vest Hansen.

Re: validation error; missing schema

Posted by Willem Jiang <ni...@iona.com>.
Hi

I think you beans.xml is out of time. There are some changes happened in 
the CXF-2.0-incubator, if you are using the latest release.

Yes you can't get the schema form the url,  CXF put the jaxws scheme in 
to cxf-rt-frontend-jaxws-2.0-incubator.jar

Please take the below configuration as a example.

<beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:jaxws="http://cxf.apache.org/jaxws"
      xsi:schemaLocation="
http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
                                                                               
~~~~~ the schemas' url has been changed.
  <jaxws:endpoint
    id="greeter1"
    address="/greeter"
      implementor="org.apache.hello_world_soap_http.GreeterImpl"
      
wsdlLocation="/org/apache/cxf/systest/servlet/hello_world.wsdl"      />

Cheers,

Willem.

Christian Vest Hansen wrote:
> Hello,
>
> When I try to deploy a CXF application, Spring barfs during its
> configuration stage claiming that my beans.xml file isn't valid - in
> particular, it dosn't like the CXF/jaxws specific tags.
>
> This is probably because it can't find the schema that defines these
> tags, because I found this in the log:
>
> 09:38:16,808 WARN  [XmlBeanDefinitionReader] Ignored XML validation 
> warning
> org.xml.sax.SAXParseException: schema_reference.4: Failed to read
> schema document 'http://cxf.apache.org/schema/jaxws.xsd', because 1)
> could not find the document; 2) the document could not be read; 3) the
> root element of the document is not <xsd:schema>.
>     at 
> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown 
>
> Source)
>     at org.apache.xerces.util.ErrorHandlerWrapper.warning(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.traversers.XSDHandler.reportSchemaWarning(Unknown 
>
> Source)
>     at 
> org.apache.xerces.impl.xs.traversers.XSDHandler.getSchemaDocument(Unknown
> Source)
>     at 
> org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown 
> Source)
>     at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown 
> Source)
>     at 
> org.apache.xerces.impl.xs.XMLSchemaValidator.findSchemaGrammar(Unknown
> Source)
>     at 
> org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown
> Source)
>     at 
> org.apache.xerces.impl.xs.XMLSchemaValidator.emptyElement(Unknown Source)
>     at 
> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
> Source)
>     at 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown 
>
> Source)
>     at 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown 
>
> Source)
>     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>     at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>     at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
>     at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
>     at 
> org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76) 
>
>     at 
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:351) 
>
>     at 
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303) 
>
>     at 
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:280) 
>
>     at 
> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:131) 
>
>     at 
> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:147) 
>
>     at 
> org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124) 
>
>     at 
> org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92) 
>
>     at 
> org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:100) 
>
>     at 
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:313) 
>
>     at 
> org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:241) 
>
>     at 
> org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184) 
>
>     at 
> org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49) 
>
>     at 
> org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3854) 
>
>     at 
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4359)
>
>
> And indeed, when I go to the http://cxf.apache.org/schema/jaxws.xsd
> URL, I get a 404.
>
> This, later on in the log, causes Spring to throw this angry stack
> trace in my general direction:
>
> 09:38:16,812 ERROR [ContextLoader] Context initialization failed
> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
> Line 15 in XML document from ServletContext resource
> [/WEB-INF/classes/beans.xml] is invalid; nested exception is
> org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching
> wildcard is strict, but no declaration can be found for element
> 'jaxws:endpoint'.
> Caused by:
> org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching
> wildcard is strict, but no declaration can be found for element
> 'jaxws:endpoint'.
>     at 
> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown 
>
> 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.reportError(Unknown 
>
> Source)
>     at 
> org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown
> Source)
>     at 
> org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown
> Source)
>     at 
> org.apache.xerces.impl.xs.XMLSchemaValidator.emptyElement(Unknown Source)
>     at 
> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
> Source)
>     at 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown 
>
> Source)
>     at 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown 
>
> Source)
>     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>     at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>     at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
>     at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
>     at 
> org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76) 
>
>
>
> So.... how do I get past this? any ideas?
>
>