You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "FOUGERE Julien (Prestataire)" <Ju...@cpexterne.org> on 2008/05/19 09:49:00 UTC
Problem with schema validation (JAX-WS & JAXB)
Hi, I am currently experiencing problem to set up server side schema validation. I have a JAX-WS frontend webservice and JAXB databinding.
When I turn schema validation on, I get a stack overflow error. It really looks like that xerces is running on an infinite loop....
Here is my cxf-servlet.xml file :
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:soap="http://cxf.apache.org/bindings/soap"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://cxf.apache.org/bindings/soap
http://cxf.apache.org/schemas/configuration/soap.xsd
http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd">
<jaxws:endpoint
id="BrmService"
implementor="fr.service.pivot.BrmServiceImpl"
wsdlLocation="WEB-INF/wsdl/BrmAsyncServices.wsdl"
address="/BrmService">
<!--Below is optional; logs SOAP requests/responses to servlet container
output log (for Tomcat: logs/catalina.out)-->
<jaxws:features>
<bean class="org.apache.cxf.feature.LoggingFeature"/>
</jaxws:features>
<jaxws:properties>
<entry key="schema-validation-enabled" value="true" />
</jaxws:properties>
</jaxws:endpoint>
</beans>
Here is the stack trace :
GRAVE: "Servlet.service()" pour la servlet WebServicePort a généré une exception
java.lang.StackOverflowError
at java.util.zip.ZipFile.getEntry(Unknown Source)
at java.util.jar.JarFile.getEntry(Unknown Source)
at java.util.jar.JarFile.getJarEntry(Unknown Source)
at sun.misc.URLClassPath$JarLoader.getResource(Unknown Source)
at sun.misc.URLClassPath$JarLoader.findResource(Unknown Source)
at sun.misc.URLClassPath.findResource(Unknown Source)
at java.net.URLClassLoader$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findResource(Unknown Source)
at java.lang.ClassLoader.getResource(Unknown Source)
at java.lang.ClassLoader.getResource(Unknown Source)
at java.lang.ClassLoader.getResource(Unknown Source)
at java.lang.ClassLoader.getResourceAsStream(Unknown Source)
at org.apache.catalina.loader.WebappClassLoader.getResourceAsStream(WebappClassLoader.java:1176)
at com.sun.org.apache.xalan.internal.xsltc.dom.SecuritySupport12$6.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.org.apache.xalan.internal.xsltc.dom.SecuritySupport12.getResourceAsStream(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.dom.ObjectFactory.findJarServiceProviderName(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.dom.ObjectFactory.lookUpFactoryClassName(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.dom.ObjectFactory.lookUpFactoryClass(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTMManagerClass(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.<init>(Unknown Source)
at sun.reflect.GeneratedConstructorAccessor45.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at javax.xml.transform.FactoryFinder.newInstance(Unknown Source)
at javax.xml.transform.FactoryFinder.find(Unknown Source)
at javax.xml.transform.TransformerFactory.newInstance(Unknown Source)
at org.apache.cxf.wsdl.EndpointReferenceUtils$SchemaLSResourceResolver.getSchemaAsStream(EndpointReferenceUtils.java:110)
at org.apache.cxf.wsdl.EndpointReferenceUtils$SchemaLSResourceResolver.resolveResource(EndpointReferenceUtils.java:125)
at com.sun.org.apache.xerces.internal.util.DOMEntityResolverWrapper.resolveEntity(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.resolveEntity(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.resolveDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.resolveSchema(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
When schema validation is turned off, everything works well. I can also get the schema validation working with external tools like (xmlSpy) or this kind of code :
//Validation
in = new FileInputStream(requestFile);
SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
Schema schema = schemaFactory.newSchema(new StreamSource(new File("xsd/EAI.xsd")));
Validator validator = schema.newValidator();
validator.validate(new StreamSource(in));
So it seems that my XSD file is valid.
May be I'm not using the right way to activate server side schema validation. Thanks to everyone who can help me.
Julien
Re: Problem with schema validation (JAX-WS & JAXB)
Posted by Daniel Kulp <dk...@apache.org>.
On Jun 6, 2008, at 2:38 AM, jfougere wrote:
>
> Hi Dan,
>
> I tested my full project with your workaround in 2.1.1-SNAPSHOT and
> everything works correctly.
Cool. Thanks for the verification.
>
>
> Thanks a lot.
>
> I assume this correction will be in official 2.1.1 release ? release
> date in
> june, am i correct ?
>
Yep.
Dan
> Bye
>
> Julien
>
>
> dkulp wrote:
>>
>>
>> I have both of the sample projects now validating fine.
>>
>> I also fixed the SEVERE log messages that your test produced:
>>
>> SEVERE: Schema element {http://www.kba.de/
>> elemente}DatumEingangVeraeusserungsanzeige references undefined type
>> {http://www.w3.org/2001/XMLSchema
>> }anySimpleType for service {http://
>> service.jaxws.cxf.apache.org/}CxfExternTestZfzrPortTypeImplService.
>>
>> That popped up. It's a bug in XmlSchema:
>> http://issues.apache.org/jira/browse/WSCOMMONS-355
>> but I worked around it in our code for now.
>>
>> In anycase, I'll get it committed and new snapshots up later today.
>> I'm waiting for a couple other fixes from gnodet first as he needs
>> some fixes for the ServiceMix 4 osgi bundle stuff.
>>
>>
>> Dan
>>
>>
>>
>> On Jun 5, 2008, at 1:25 PM, sistar wrote:
>>
>>>
>>> Hi Dan,
>>>
>>>
>>> i encounter the same problem with a different schema.
>>>
>>> I prepared a minimum maven project suitable for debugging.
>>>
>>> The problem only occurs in Client-Side Validation setup.
>>>
>>> The Server parses the wsdl normally and does sucessfully perform
>>> schema-validation.
>>>
>>> As soon as i add client validation with:
>>> ((BindingProvider) client).getRequestContext().put(
>>> "schema-validation-enabled",
>>> Boolean.TRUE);
>>>
>>> I encounter the problem.
>>>
>>> Here is the maven-project:
>>> http://www.nabble.com/file/p17675429/cxf.schema.validation.min.zip
>>> cxf.schema.validation.min.zip
>>>
>>> Would be great to solve this problem. We are stuck with cxf 2.0-
>>> incubator
>>> for this reason. Let me know if I can help in any way.
>>>
>>> Ralf
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Problem-with-schema-validation-%28JAX-WS---JAXB%29-tp17319174p17675429.html
>>> Sent from the cxf-user mailing list archive at Nabble.com.
>>>
>>
>> ---
>> Daniel Kulp
>> dkulp@apache.org
>> http://www.dankulp.com/blog
>>
>>
>>
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Problem-with-schema-validation-%28JAX-WS---JAXB%29-tp17319174p17685575.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
---
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog
Re: Problem with schema validation (JAX-WS & JAXB)
Posted by jfougere <Ju...@cpexterne.org>.
Hi Dan,
I tested my full project with your workaround in 2.1.1-SNAPSHOT and
everything works correctly.
Thanks a lot.
I assume this correction will be in official 2.1.1 release ? release date in
june, am i correct ?
Bye
Julien
dkulp wrote:
>
>
> I have both of the sample projects now validating fine.
>
> I also fixed the SEVERE log messages that your test produced:
>
> SEVERE: Schema element {http://www.kba.de/
> elemente}DatumEingangVeraeusserungsanzeige references undefined type
> {http://www.w3.org/2001/XMLSchema
> }anySimpleType for service {http://
> service.jaxws.cxf.apache.org/}CxfExternTestZfzrPortTypeImplService.
>
> That popped up. It's a bug in XmlSchema:
> http://issues.apache.org/jira/browse/WSCOMMONS-355
> but I worked around it in our code for now.
>
> In anycase, I'll get it committed and new snapshots up later today.
> I'm waiting for a couple other fixes from gnodet first as he needs
> some fixes for the ServiceMix 4 osgi bundle stuff.
>
>
> Dan
>
>
>
> On Jun 5, 2008, at 1:25 PM, sistar wrote:
>
>>
>> Hi Dan,
>>
>>
>> i encounter the same problem with a different schema.
>>
>> I prepared a minimum maven project suitable for debugging.
>>
>> The problem only occurs in Client-Side Validation setup.
>>
>> The Server parses the wsdl normally and does sucessfully perform
>> schema-validation.
>>
>> As soon as i add client validation with:
>> ((BindingProvider) client).getRequestContext().put(
>> "schema-validation-enabled",
>> Boolean.TRUE);
>>
>> I encounter the problem.
>>
>> Here is the maven-project:
>> http://www.nabble.com/file/p17675429/cxf.schema.validation.min.zip
>> cxf.schema.validation.min.zip
>>
>> Would be great to solve this problem. We are stuck with cxf 2.0-
>> incubator
>> for this reason. Let me know if I can help in any way.
>>
>> Ralf
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Problem-with-schema-validation-%28JAX-WS---JAXB%29-tp17319174p17675429.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>>
>
> ---
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
>
>
>
>
>
>
--
View this message in context: http://www.nabble.com/Problem-with-schema-validation-%28JAX-WS---JAXB%29-tp17319174p17685575.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Problem with schema validation (JAX-WS & JAXB)
Posted by Daniel Kulp <dk...@apache.org>.
I have both of the sample projects now validating fine.
I also fixed the SEVERE log messages that your test produced:
SEVERE: Schema element {http://www.kba.de/
elemente}DatumEingangVeraeusserungsanzeige references undefined type {http://www.w3.org/2001/XMLSchema
}anySimpleType for service {http://
service.jaxws.cxf.apache.org/}CxfExternTestZfzrPortTypeImplService.
That popped up. It's a bug in XmlSchema:
http://issues.apache.org/jira/browse/WSCOMMONS-355
but I worked around it in our code for now.
In anycase, I'll get it committed and new snapshots up later today.
I'm waiting for a couple other fixes from gnodet first as he needs
some fixes for the ServiceMix 4 osgi bundle stuff.
Dan
On Jun 5, 2008, at 1:25 PM, sistar wrote:
>
> Hi Dan,
>
>
> i encounter the same problem with a different schema.
>
> I prepared a minimum maven project suitable for debugging.
>
> The problem only occurs in Client-Side Validation setup.
>
> The Server parses the wsdl normally and does sucessfully perform
> schema-validation.
>
> As soon as i add client validation with:
> ((BindingProvider) client).getRequestContext().put(
> "schema-validation-enabled",
> Boolean.TRUE);
>
> I encounter the problem.
>
> Here is the maven-project:
> http://www.nabble.com/file/p17675429/cxf.schema.validation.min.zip
> cxf.schema.validation.min.zip
>
> Would be great to solve this problem. We are stuck with cxf 2.0-
> incubator
> for this reason. Let me know if I can help in any way.
>
> Ralf
>
> --
> View this message in context: http://www.nabble.com/Problem-with-schema-validation-%28JAX-WS---JAXB%29-tp17319174p17675429.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
---
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog
Re: Problem with schema validation (JAX-WS & JAXB)
Posted by sistar <ra...@gmail.com>.
Hi Dan,
i encounter the same problem with a different schema.
I prepared a minimum maven project suitable for debugging.
The problem only occurs in Client-Side Validation setup.
The Server parses the wsdl normally and does sucessfully perform
schema-validation.
As soon as i add client validation with:
((BindingProvider) client).getRequestContext().put(
"schema-validation-enabled",
Boolean.TRUE);
I encounter the problem.
Here is the maven-project:
http://www.nabble.com/file/p17675429/cxf.schema.validation.min.zip
cxf.schema.validation.min.zip
Would be great to solve this problem. We are stuck with cxf 2.0-incubator
for this reason. Let me know if I can help in any way.
Ralf
--
View this message in context: http://www.nabble.com/Problem-with-schema-validation-%28JAX-WS---JAXB%29-tp17319174p17675429.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Problem with schema validation (JAX-WS & JAXB)
Posted by jfougere <Ju...@cpexterne.org>.
Hi Dan,
I saw that changes was made last week in another related post, and I already
tried in 2.1-SNAPSHOT and
2.1.1-SNAPSHOT and the problem still occured.
Julien
dkulp wrote:
>
>
> It's probably a CXF issue. I made some changes to the validation
> schema loading late last week to hopefully fix this. Can you try the
> latest 2.1 snapshot to make sure it's fixed for 2.1.1?
>
> Thanks!
> Dan
>
>
> On Jun 4, 2008, at 5:00 PM, jfougere wrote:
>
>>
>> Here is attached a small project who produce the same stackOverFlow
>> error
>> when server side schema validation is enabled.
>>
>> Can you have a look and tell me if my use of CXF is wrong or if this
>> is a
>> CXF issue ?
>>
>> Thanks
>>
>> Julien
>>
>> http://www.nabble.com/file/p17656531/ValidationTest.zip
>> ValidationTest.zip
>> --
>> View this message in context:
>> http://www.nabble.com/Problem-with-schema-validation-%28JAX-WS---JAXB%29-tp17319174p17656531.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>>
>
> ---
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
>
>
>
>
>
>
--
View this message in context: http://www.nabble.com/Problem-with-schema-validation-%28JAX-WS---JAXB%29-tp17319174p17662703.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Problem with schema validation (JAX-WS & JAXB)
Posted by Daniel Kulp <dk...@apache.org>.
It's probably a CXF issue. I made some changes to the validation
schema loading late last week to hopefully fix this. Can you try the
latest 2.1 snapshot to make sure it's fixed for 2.1.1?
Thanks!
Dan
On Jun 4, 2008, at 5:00 PM, jfougere wrote:
>
> Here is attached a small project who produce the same stackOverFlow
> error
> when server side schema validation is enabled.
>
> Can you have a look and tell me if my use of CXF is wrong or if this
> is a
> CXF issue ?
>
> Thanks
>
> Julien
>
> http://www.nabble.com/file/p17656531/ValidationTest.zip
> ValidationTest.zip
> --
> View this message in context: http://www.nabble.com/Problem-with-schema-validation-%28JAX-WS---JAXB%29-tp17319174p17656531.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
---
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog
Re: Problem with schema validation (JAX-WS & JAXB)
Posted by jfougere <Ju...@cpexterne.org>.
Here is attached a small project who produce the same stackOverFlow error
when server side schema validation is enabled.
Can you have a look and tell me if my use of CXF is wrong or if this is a
CXF issue ?
Thanks
Julien
http://www.nabble.com/file/p17656531/ValidationTest.zip ValidationTest.zip
--
View this message in context: http://www.nabble.com/Problem-with-schema-validation-%28JAX-WS---JAXB%29-tp17319174p17656531.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Problem with schema validation (JAX-WS & JAXB)
Posted by jfougere <Ju...@cpexterne.org>.
The problem is that i can't send the XSD file (company information inside).
The problem here seems to be inside xerces (who seems to be used by CXF to
do validation).
xerces call recursively the constructTrees method. I think this method is
normally call for each schema.
In my case I have a first XSD file who import a second one. Finally the
second one include a third one.
Is this kind of multiple XSD files can be the origin of the problem ?
I will try to build a small project with the same configuration of XSDs. If
the same problem happens, I will send it to you.
Thanks
Julien
dkulp wrote:
>
>
> On May 27, 2008, at 2:42 AM, jfougere wrote:
>
>>
>> I would like to know what exactly is done when schema validation is
>> activated
>> in CXF
>> (ie : <entry key="schema-validation-enabled" value="true" /> ) ?
>>
>> I am still having problem to turn on activation on server side but
>> validation by other means like external tools (xmlSpy) or Java5
>> Validator
>> API works fine.
>>
>> Do you have any idea of the problem here ?
>
>
> Any chance you can file a JIRA and attach a test case that
> demonstrates the problem? If I can get a full test case, it's a LOT
> easier to debug.
>
> Dan
>
>
>>
>>
>> Thanks
>>
>> Julien
>>
>>
>> jfougere wrote:
>>>
>>> Hi Aaron, thanks for your answer.
>>>
>>> I have several XSD's but there is no cyclic reference. In fact the
>>> first
>>> one import the second one who itself incude the third one. (The
>>> third one
>>> does not include nether import another xsd).
>>>
>>> Do you have another idea for the cause of this issue ? When I am
>>> doing
>>> validation by code it works without problem...
>>>
>>> Thanks
>>>
>>> Julien
>>>
>>>
>>> Aaron Pieper wrote:
>>>>
>>>> It looks to me like Xerces is recursing trying to follow your XSD
>>>> imports. Do you have any XSDs that refer to eachother in a cycle?
>>>>
>>>> - Aaron
>>>>
>>>> -----Original Message-----
>>>> From: FOUGERE Julien (Prestataire) [mailto:Julien.FOUGERE@cpexterne.org
>>>> ]
>>>> Sent: Monday, May 19, 2008 3:49 AM
>>>> To: cxf-user@incubator.apache.org
>>>> Subject: Problem with schema validation (JAX-WS & JAXB)
>>>>
>>>> Hi, I am currently experiencing problem to set up server side schema
>>>> validation. I have a JAX-WS frontend webservice and JAXB
>>>> databinding.
>>>>
>>>> When I turn schema validation on, I get a stack overflow error. It
>>>> really
>>>> looks like that xerces is running on an infinite loop....
>>>>
>>>>
>>>>
>>>> Here is my cxf-servlet.xml file :
>>>>
>>>>
>>>>
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>
>>>> <beans xmlns="http://www.springframework.org/schema/beans"
>>>>
>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>
>>>> xmlns:jaxws="http://cxf.apache.org/jaxws"
>>>>
>>>> xmlns:soap="http://cxf.apache.org/bindings/soap"
>>>>
>>>> xsi:schemaLocation="
>>>>
>>>> http://www.springframework.org/schema/beans
>>>>
>>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>>>>
>>>> http://cxf.apache.org/bindings/soap
>>>>
>>>> http://cxf.apache.org/schemas/configuration/soap.xsd
>>>>
>>>> http://cxf.apache.org/jaxws
>>>>
>>>> http://cxf.apache.org/schemas/jaxws.xsd">
>>>>
>>>>
>>>>
>>>> <jaxws:endpoint
>>>>
>>>> id="BrmService"
>>>>
>>>> implementor="fr.service.pivot.BrmServiceImpl"
>>>>
>>>> wsdlLocation="WEB-INF/wsdl/BrmAsyncServices.wsdl"
>>>>
>>>> address="/BrmService">
>>>>
>>>> <!--Below is optional; logs SOAP requests/responses to
>>>> servlet
>>>> container
>>>>
>>>> output log (for Tomcat: logs/catalina.out)-->
>>>>
>>>> <jaxws:features>
>>>>
>>>> <bean class="org.apache.cxf.feature.LoggingFeature"/>
>>>>
>>>> </jaxws:features>
>>>>
>>>> <jaxws:properties>
>>>>
>>>> <entry key="schema-validation-enabled" value="true" />
>>>>
>>>> </jaxws:properties>
>>>>
>>>> </jaxws:endpoint>
>>>>
>>>> </beans>
>>>>
>>>>
>>>>
>>>> Here is the stack trace :
>>>>
>>>>
>>>>
>>>> GRAVE: "Servlet.service()" pour la servlet WebServicePort a généré
>>>> une
>>>> exception
>>>>
>>>> java.lang.StackOverflowError
>>>>
>>>> at java.util.zip.ZipFile.getEntry(Unknown Source)
>>>>
>>>> at java.util.jar.JarFile.getEntry(Unknown Source)
>>>>
>>>> at java.util.jar.JarFile.getJarEntry(Unknown Source)
>>>>
>>>> at sun.misc.URLClassPath$JarLoader.getResource(Unknown
>>>> Source)
>>>>
>>>> at sun.misc.URLClassPath$JarLoader.findResource(Unknown
>>>> Source)
>>>>
>>>> at sun.misc.URLClassPath.findResource(Unknown Source)
>>>>
>>>> at java.net.URLClassLoader$2.run(Unknown Source)
>>>>
>>>> at java.security.AccessController.doPrivileged(Native
>>>> Method)
>>>>
>>>> at java.net.URLClassLoader.findResource(Unknown Source)
>>>>
>>>> at java.lang.ClassLoader.getResource(Unknown Source)
>>>>
>>>> at java.lang.ClassLoader.getResource(Unknown Source)
>>>>
>>>> at java.lang.ClassLoader.getResource(Unknown Source)
>>>>
>>>> at java.lang.ClassLoader.getResourceAsStream(Unknown
>>>> Source)
>>>>
>>>> at
>>>> org
>>>> .apache
>>>> .catalina
>>>> .loader
>>>> .WebappClassLoader.getResourceAsStream(WebappClassLoader.java:1176)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org.apache.xalan.internal.xsltc.dom.SecuritySupport12$6.run(Unknown
>>>> Source)
>>>>
>>>> at java.security.AccessController.doPrivileged(Native
>>>> Method)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xalan
>>>> .internal.xsltc.dom.SecuritySupport12.getResourceAsStream(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xalan
>>>> .internal.xsltc.dom.ObjectFactory.findJarServiceProviderName(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xalan
>>>> .internal.xsltc.dom.ObjectFactory.lookUpFactoryClassName(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xalan.internal.xsltc.dom.ObjectFactory.lookUpFactoryClass(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xalan.internal.xsltc.dom.XSLTCDTMManager.getDTMManagerClass(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xalan.internal.xsltc.trax.TransformerFactoryImpl.<init>(Unknown
>>>> Source)
>>>>
>>>> at
>>>> sun.reflect.GeneratedConstructorAccessor45.newInstance(Unknown
>>>> Source)
>>>>
>>>> at
>>>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
>>>> Source)
>>>>
>>>> at java.lang.reflect.Constructor.newInstance(Unknown
>>>> Source)
>>>>
>>>> at java.lang.Class.newInstance0(Unknown Source)
>>>>
>>>> at java.lang.Class.newInstance(Unknown Source)
>>>>
>>>> at javax.xml.transform.FactoryFinder.newInstance(Unknown
>>>> Source)
>>>>
>>>> at javax.xml.transform.FactoryFinder.find(Unknown Source)
>>>>
>>>> at
>>>> javax.xml.transform.TransformerFactory.newInstance(Unknown
>>>> Source)
>>>>
>>>> at
>>>> org.apache.cxf.wsdl.EndpointReferenceUtils
>>>> $
>>>> SchemaLSResourceResolver
>>>> .getSchemaAsStream(EndpointReferenceUtils.java:110)
>>>>
>>>> at
>>>> org.apache.cxf.wsdl.EndpointReferenceUtils
>>>> $
>>>> SchemaLSResourceResolver
>>>> .resolveResource(EndpointReferenceUtils.java:125)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces.internal.util.DOMEntityResolverWrapper.resolveEntity(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache.xerces.internal.impl.XMLEntityManager.resolveEntity(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces.internal.impl.xs.XMLSchemaLoader.resolveDocument(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces.internal.impl.xs.traversers.XSDHandler.resolveSchema(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>> at
>>>> com
>>>> .sun
>>>> .org
>>>> .apache
>>>> .xerces
>>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>>> Source)
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> When schema validation is turned off, everything works well. I can
>>>> also
>>>> get the schema validation working with external tools like
>>>> (xmlSpy) or
>>>> this kind of code :
>>>>
>>>>
>>>>
>>>> //Validation
>>>>
>>>> in = new FileInputStream(requestFile);
>>>>
>>>> SchemaFactory schemaFactory =
>>>> SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
>>>>
>>>> Schema schema = schemaFactory.newSchema(new
>>>> StreamSource(new File("xsd/EAI.xsd")));
>>>>
>>>> Validator validator = schema.newValidator();
>>>>
>>>> validator.validate(new StreamSource(in));
>>>>
>>>>
>>>>
>>>> So it seems that my XSD file is valid.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> May be I'm not using the right way to activate server side schema
>>>> validation. Thanks to everyone who can help me.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Julien
>>>>
>>>>
>>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Problem-with-schema-validation-%28JAX-WS---JAXB%29-tp17319174p17484086.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>>
>
> ---
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
>
>
>
>
>
>
--
View this message in context: http://www.nabble.com/Problem-with-schema-validation-%28JAX-WS---JAXB%29-tp17319174p17505989.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Problem with schema validation (JAX-WS & JAXB)
Posted by Daniel Kulp <dk...@apache.org>.
On May 27, 2008, at 2:42 AM, jfougere wrote:
>
> I would like to know what exactly is done when schema validation is
> activated
> in CXF
> (ie : <entry key="schema-validation-enabled" value="true" /> ) ?
>
> I am still having problem to turn on activation on server side but
> validation by other means like external tools (xmlSpy) or Java5
> Validator
> API works fine.
>
> Do you have any idea of the problem here ?
Any chance you can file a JIRA and attach a test case that
demonstrates the problem? If I can get a full test case, it's a LOT
easier to debug.
Dan
>
>
> Thanks
>
> Julien
>
>
> jfougere wrote:
>>
>> Hi Aaron, thanks for your answer.
>>
>> I have several XSD's but there is no cyclic reference. In fact the
>> first
>> one import the second one who itself incude the third one. (The
>> third one
>> does not include nether import another xsd).
>>
>> Do you have another idea for the cause of this issue ? When I am
>> doing
>> validation by code it works without problem...
>>
>> Thanks
>>
>> Julien
>>
>>
>> Aaron Pieper wrote:
>>>
>>> It looks to me like Xerces is recursing trying to follow your XSD
>>> imports. Do you have any XSDs that refer to eachother in a cycle?
>>>
>>> - Aaron
>>>
>>> -----Original Message-----
>>> From: FOUGERE Julien (Prestataire) [mailto:Julien.FOUGERE@cpexterne.org
>>> ]
>>> Sent: Monday, May 19, 2008 3:49 AM
>>> To: cxf-user@incubator.apache.org
>>> Subject: Problem with schema validation (JAX-WS & JAXB)
>>>
>>> Hi, I am currently experiencing problem to set up server side schema
>>> validation. I have a JAX-WS frontend webservice and JAXB
>>> databinding.
>>>
>>> When I turn schema validation on, I get a stack overflow error. It
>>> really
>>> looks like that xerces is running on an infinite loop....
>>>
>>>
>>>
>>> Here is my cxf-servlet.xml file :
>>>
>>>
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>>
>>> <beans xmlns="http://www.springframework.org/schema/beans"
>>>
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>
>>> xmlns:jaxws="http://cxf.apache.org/jaxws"
>>>
>>> xmlns:soap="http://cxf.apache.org/bindings/soap"
>>>
>>> xsi:schemaLocation="
>>>
>>> http://www.springframework.org/schema/beans
>>>
>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>>>
>>> http://cxf.apache.org/bindings/soap
>>>
>>> http://cxf.apache.org/schemas/configuration/soap.xsd
>>>
>>> http://cxf.apache.org/jaxws
>>>
>>> http://cxf.apache.org/schemas/jaxws.xsd">
>>>
>>>
>>>
>>> <jaxws:endpoint
>>>
>>> id="BrmService"
>>>
>>> implementor="fr.service.pivot.BrmServiceImpl"
>>>
>>> wsdlLocation="WEB-INF/wsdl/BrmAsyncServices.wsdl"
>>>
>>> address="/BrmService">
>>>
>>> <!--Below is optional; logs SOAP requests/responses to
>>> servlet
>>> container
>>>
>>> output log (for Tomcat: logs/catalina.out)-->
>>>
>>> <jaxws:features>
>>>
>>> <bean class="org.apache.cxf.feature.LoggingFeature"/>
>>>
>>> </jaxws:features>
>>>
>>> <jaxws:properties>
>>>
>>> <entry key="schema-validation-enabled" value="true" />
>>>
>>> </jaxws:properties>
>>>
>>> </jaxws:endpoint>
>>>
>>> </beans>
>>>
>>>
>>>
>>> Here is the stack trace :
>>>
>>>
>>>
>>> GRAVE: "Servlet.service()" pour la servlet WebServicePort a généré
>>> une
>>> exception
>>>
>>> java.lang.StackOverflowError
>>>
>>> at java.util.zip.ZipFile.getEntry(Unknown Source)
>>>
>>> at java.util.jar.JarFile.getEntry(Unknown Source)
>>>
>>> at java.util.jar.JarFile.getJarEntry(Unknown Source)
>>>
>>> at sun.misc.URLClassPath$JarLoader.getResource(Unknown
>>> Source)
>>>
>>> at sun.misc.URLClassPath$JarLoader.findResource(Unknown
>>> Source)
>>>
>>> at sun.misc.URLClassPath.findResource(Unknown Source)
>>>
>>> at java.net.URLClassLoader$2.run(Unknown Source)
>>>
>>> at java.security.AccessController.doPrivileged(Native
>>> Method)
>>>
>>> at java.net.URLClassLoader.findResource(Unknown Source)
>>>
>>> at java.lang.ClassLoader.getResource(Unknown Source)
>>>
>>> at java.lang.ClassLoader.getResource(Unknown Source)
>>>
>>> at java.lang.ClassLoader.getResource(Unknown Source)
>>>
>>> at java.lang.ClassLoader.getResourceAsStream(Unknown
>>> Source)
>>>
>>> at
>>> org
>>> .apache
>>> .catalina
>>> .loader
>>> .WebappClassLoader.getResourceAsStream(WebappClassLoader.java:1176)
>>>
>>> at
>>> com
>>> .sun
>>> .org.apache.xalan.internal.xsltc.dom.SecuritySupport12$6.run(Unknown
>>> Source)
>>>
>>> at java.security.AccessController.doPrivileged(Native
>>> Method)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xalan
>>> .internal.xsltc.dom.SecuritySupport12.getResourceAsStream(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xalan
>>> .internal.xsltc.dom.ObjectFactory.findJarServiceProviderName(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xalan
>>> .internal.xsltc.dom.ObjectFactory.lookUpFactoryClassName(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xalan.internal.xsltc.dom.ObjectFactory.lookUpFactoryClass(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xalan.internal.xsltc.dom.XSLTCDTMManager.getDTMManagerClass(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xalan.internal.xsltc.trax.TransformerFactoryImpl.<init>(Unknown
>>> Source)
>>>
>>> at
>>> sun.reflect.GeneratedConstructorAccessor45.newInstance(Unknown
>>> Source)
>>>
>>> at
>>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
>>> Source)
>>>
>>> at java.lang.reflect.Constructor.newInstance(Unknown
>>> Source)
>>>
>>> at java.lang.Class.newInstance0(Unknown Source)
>>>
>>> at java.lang.Class.newInstance(Unknown Source)
>>>
>>> at javax.xml.transform.FactoryFinder.newInstance(Unknown
>>> Source)
>>>
>>> at javax.xml.transform.FactoryFinder.find(Unknown Source)
>>>
>>> at
>>> javax.xml.transform.TransformerFactory.newInstance(Unknown
>>> Source)
>>>
>>> at
>>> org.apache.cxf.wsdl.EndpointReferenceUtils
>>> $
>>> SchemaLSResourceResolver
>>> .getSchemaAsStream(EndpointReferenceUtils.java:110)
>>>
>>> at
>>> org.apache.cxf.wsdl.EndpointReferenceUtils
>>> $
>>> SchemaLSResourceResolver
>>> .resolveResource(EndpointReferenceUtils.java:125)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces.internal.util.DOMEntityResolverWrapper.resolveEntity(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache.xerces.internal.impl.XMLEntityManager.resolveEntity(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces.internal.impl.xs.XMLSchemaLoader.resolveDocument(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces.internal.impl.xs.traversers.XSDHandler.resolveSchema(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>> at
>>> com
>>> .sun
>>> .org
>>> .apache
>>> .xerces
>>> .internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>>> Source)
>>>
>>>
>>>
>>>
>>>
>>> When schema validation is turned off, everything works well. I can
>>> also
>>> get the schema validation working with external tools like
>>> (xmlSpy) or
>>> this kind of code :
>>>
>>>
>>>
>>> //Validation
>>>
>>> in = new FileInputStream(requestFile);
>>>
>>> SchemaFactory schemaFactory =
>>> SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
>>>
>>> Schema schema = schemaFactory.newSchema(new
>>> StreamSource(new File("xsd/EAI.xsd")));
>>>
>>> Validator validator = schema.newValidator();
>>>
>>> validator.validate(new StreamSource(in));
>>>
>>>
>>>
>>> So it seems that my XSD file is valid.
>>>
>>>
>>>
>>>
>>>
>>> May be I'm not using the right way to activate server side schema
>>> validation. Thanks to everyone who can help me.
>>>
>>>
>>>
>>>
>>>
>>> Julien
>>>
>>>
>>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Problem-with-schema-validation-%28JAX-WS---JAXB%29-tp17319174p17484086.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
---
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog
Antwort: RE: Problem with schema validation (JAX-WS & JAXB) [Virus checked]
Posted by ja...@external.t-mobile.at.
Hello,
in my humble opinion it's done on the fly ...
it means, as objects are serialized to XML, XML library is set up to do
validation too.
couldn't you try to debug why is it in loop or at least where is it in
loop?
or at least if you can send simple sample project or testcase which shows
this problem
best regards
jano
jfougere <Ju...@cpexterne.org>
05/27/2008 08:42
Bitte antworten an
users@cxf.apache.org
An
users@cxf.apache.org
Kopie
Thema
RE: Problem with schema validation (JAX-WS & JAXB) [Virus checked]
I would like to know what exactly is done when schema validation is
activated
in CXF
(ie : <entry key="schema-validation-enabled" value="true" /> ) ?
I am still having problem to turn on activation on server side but
validation by other means like external tools (xmlSpy) or Java5 Validator
API works fine.
Do you have any idea of the problem here ?
Thanks
Julien
jfougere wrote:
>
> Hi Aaron, thanks for your answer.
>
> I have several XSD's but there is no cyclic reference. In fact the first
> one import the second one who itself incude the third one. (The third
one
> does not include nether import another xsd).
>
> Do you have another idea for the cause of this issue ? When I am doing
> validation by code it works without problem...
>
> Thanks
>
> Julien
>
>
> Aaron Pieper wrote:
>>
>> It looks to me like Xerces is recursing trying to follow your XSD
>> imports. Do you have any XSDs that refer to eachother in a cycle?
>>
>> - Aaron
>>
>> -----Original Message-----
>> From: FOUGERE Julien (Prestataire)
[mailto:Julien.FOUGERE@cpexterne.org]
>> Sent: Monday, May 19, 2008 3:49 AM
>> To: cxf-user@incubator.apache.org
>> Subject: Problem with schema validation (JAX-WS & JAXB)
>>
>> Hi, I am currently experiencing problem to set up server side schema
>> validation. I have a JAX-WS frontend webservice and JAXB databinding.
>>
>> When I turn schema validation on, I get a stack overflow error. It
really
>> looks like that xerces is running on an infinite loop....
>>
>>
>>
>> Here is my cxf-servlet.xml file :
>>
>>
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>>
>> <beans xmlns="http://www.springframework.org/schema/beans"
>>
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>
>> xmlns:jaxws="http://cxf.apache.org/jaxws"
>>
>> xmlns:soap="http://cxf.apache.org/bindings/soap"
>>
>> xsi:schemaLocation="
>>
>> http://www.springframework.org/schema/beans
>>
>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>>
>> http://cxf.apache.org/bindings/soap
>>
>> http://cxf.apache.org/schemas/configuration/soap.xsd
>>
>> http://cxf.apache.org/jaxws
>>
>> http://cxf.apache.org/schemas/jaxws.xsd">
>>
>>
>>
>> <jaxws:endpoint
>>
>> id="BrmService"
>>
>> implementor="fr.service.pivot.BrmServiceImpl"
>>
>> wsdlLocation="WEB-INF/wsdl/BrmAsyncServices.wsdl"
>>
>> address="/BrmService">
>>
>> <!--Below is optional; logs SOAP requests/responses to servlet
>> container
>>
>> output log (for Tomcat: logs/catalina.out)-->
>>
>> <jaxws:features>
>>
>> <bean class="org.apache.cxf.feature.LoggingFeature"/>
>>
>> </jaxws:features>
>>
>> <jaxws:properties>
>>
>> <entry key="schema-validation-enabled" value="true" />
>>
>> </jaxws:properties>
>>
>> </jaxws:endpoint>
>>
>> </beans>
>>
>>
>>
>> Here is the stack trace :
>>
>>
>>
>> GRAVE: "Servlet.service()" pour la servlet WebServicePort a généré une
>> exception
>>
>> java.lang.StackOverflowError
>>
>> at java.util.zip.ZipFile.getEntry(Unknown Source)
>>
>> at java.util.jar.JarFile.getEntry(Unknown Source)
>>
>> at java.util.jar.JarFile.getJarEntry(Unknown Source)
>>
>> at sun.misc.URLClassPath$JarLoader.getResource(Unknown
>> Source)
>>
>> at sun.misc.URLClassPath$JarLoader.findResource(Unknown
>> Source)
>>
>> at sun.misc.URLClassPath.findResource(Unknown Source)
>>
>> at java.net.URLClassLoader$2.run(Unknown Source)
>>
>> at java.security.AccessController.doPrivileged(Native
Method)
>>
>> at java.net.URLClassLoader.findResource(Unknown Source)
>>
>> at java.lang.ClassLoader.getResource(Unknown Source)
>>
>> at java.lang.ClassLoader.getResource(Unknown Source)
>>
>> at java.lang.ClassLoader.getResource(Unknown Source)
>>
>> at java.lang.ClassLoader.getResourceAsStream(Unknown
Source)
>>
>> at
>>
org.apache.catalina.loader.WebappClassLoader.getResourceAsStream(WebappClassLoader.java:1176)
>>
>> at
>>
com.sun.org.apache.xalan.internal.xsltc.dom.SecuritySupport12$6.run(Unknown
>> Source)
>>
>> at java.security.AccessController.doPrivileged(Native
Method)
>>
>> at
>>
com.sun.org.apache.xalan.internal.xsltc.dom.SecuritySupport12.getResourceAsStream(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xalan.internal.xsltc.dom.ObjectFactory.findJarServiceProviderName(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xalan.internal.xsltc.dom.ObjectFactory.lookUpFactoryClassName(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xalan.internal.xsltc.dom.ObjectFactory.lookUpFactoryClass(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTMManagerClass(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.<init>(Unknown
>> Source)
>>
>> at
>> sun.reflect.GeneratedConstructorAccessor45.newInstance(Unknown Source)
>>
>> at
>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
>>
>> at java.lang.reflect.Constructor.newInstance(Unknown
Source)
>>
>> at java.lang.Class.newInstance0(Unknown Source)
>>
>> at java.lang.Class.newInstance(Unknown Source)
>>
>> at javax.xml.transform.FactoryFinder.newInstance(Unknown
>> Source)
>>
>> at javax.xml.transform.FactoryFinder.find(Unknown Source)
>>
>> at
javax.xml.transform.TransformerFactory.newInstance(Unknown
>> Source)
>>
>> at
>>
org.apache.cxf.wsdl.EndpointReferenceUtils$SchemaLSResourceResolver.getSchemaAsStream(EndpointReferenceUtils.java:110)
>>
>> at
>>
org.apache.cxf.wsdl.EndpointReferenceUtils$SchemaLSResourceResolver.resolveResource(EndpointReferenceUtils.java:125)
>>
>> at
>>
com.sun.org.apache.xerces.internal.util.DOMEntityResolverWrapper.resolveEntity(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.resolveEntity(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.resolveDocument(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.resolveSchema(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>>
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>>
>>
>>
>>
>> When schema validation is turned off, everything works well. I can also
>> get the schema validation working with external tools like (xmlSpy) or
>> this kind of code :
>>
>>
>>
>> //Validation
>>
>> in = new FileInputStream(requestFile);
>>
>> SchemaFactory schemaFactory =
>> SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
>>
>> Schema schema = schemaFactory.newSchema(new
>> StreamSource(new File("xsd/EAI.xsd")));
>>
>> Validator validator = schema.newValidator();
>>
>> validator.validate(new StreamSource(in));
>>
>>
>>
>> So it seems that my XSD file is valid.
>>
>>
>>
>>
>>
>> May be I'm not using the right way to activate server side schema
>> validation. Thanks to everyone who can help me.
>>
>>
>>
>>
>>
>> Julien
>>
>>
>>
>
>
--
View this message in context:
http://www.nabble.com/Problem-with-schema-validation-%28JAX-WS---JAXB%29-tp17319174p17484086.html
Sent from the cxf-user mailing list archive at Nabble.com.
RE: Problem with schema validation (JAX-WS & JAXB)
Posted by jfougere <Ju...@cpexterne.org>.
I would like to know what exactly is done when schema validation is activated
in CXF
(ie : <entry key="schema-validation-enabled" value="true" /> ) ?
I am still having problem to turn on activation on server side but
validation by other means like external tools (xmlSpy) or Java5 Validator
API works fine.
Do you have any idea of the problem here ?
Thanks
Julien
jfougere wrote:
>
> Hi Aaron, thanks for your answer.
>
> I have several XSD's but there is no cyclic reference. In fact the first
> one import the second one who itself incude the third one. (The third one
> does not include nether import another xsd).
>
> Do you have another idea for the cause of this issue ? When I am doing
> validation by code it works without problem...
>
> Thanks
>
> Julien
>
>
> Aaron Pieper wrote:
>>
>> It looks to me like Xerces is recursing trying to follow your XSD
>> imports. Do you have any XSDs that refer to eachother in a cycle?
>>
>> - Aaron
>>
>> -----Original Message-----
>> From: FOUGERE Julien (Prestataire) [mailto:Julien.FOUGERE@cpexterne.org]
>> Sent: Monday, May 19, 2008 3:49 AM
>> To: cxf-user@incubator.apache.org
>> Subject: Problem with schema validation (JAX-WS & JAXB)
>>
>> Hi, I am currently experiencing problem to set up server side schema
>> validation. I have a JAX-WS frontend webservice and JAXB databinding.
>>
>> When I turn schema validation on, I get a stack overflow error. It really
>> looks like that xerces is running on an infinite loop....
>>
>>
>>
>> Here is my cxf-servlet.xml file :
>>
>>
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>>
>> <beans xmlns="http://www.springframework.org/schema/beans"
>>
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>
>> xmlns:jaxws="http://cxf.apache.org/jaxws"
>>
>> xmlns:soap="http://cxf.apache.org/bindings/soap"
>>
>> xsi:schemaLocation="
>>
>> http://www.springframework.org/schema/beans
>>
>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>>
>> http://cxf.apache.org/bindings/soap
>>
>> http://cxf.apache.org/schemas/configuration/soap.xsd
>>
>> http://cxf.apache.org/jaxws
>>
>> http://cxf.apache.org/schemas/jaxws.xsd">
>>
>>
>>
>> <jaxws:endpoint
>>
>> id="BrmService"
>>
>> implementor="fr.service.pivot.BrmServiceImpl"
>>
>> wsdlLocation="WEB-INF/wsdl/BrmAsyncServices.wsdl"
>>
>> address="/BrmService">
>>
>> <!--Below is optional; logs SOAP requests/responses to servlet
>> container
>>
>> output log (for Tomcat: logs/catalina.out)-->
>>
>> <jaxws:features>
>>
>> <bean class="org.apache.cxf.feature.LoggingFeature"/>
>>
>> </jaxws:features>
>>
>> <jaxws:properties>
>>
>> <entry key="schema-validation-enabled" value="true" />
>>
>> </jaxws:properties>
>>
>> </jaxws:endpoint>
>>
>> </beans>
>>
>>
>>
>> Here is the stack trace :
>>
>>
>>
>> GRAVE: "Servlet.service()" pour la servlet WebServicePort a généré une
>> exception
>>
>> java.lang.StackOverflowError
>>
>> at java.util.zip.ZipFile.getEntry(Unknown Source)
>>
>> at java.util.jar.JarFile.getEntry(Unknown Source)
>>
>> at java.util.jar.JarFile.getJarEntry(Unknown Source)
>>
>> at sun.misc.URLClassPath$JarLoader.getResource(Unknown
>> Source)
>>
>> at sun.misc.URLClassPath$JarLoader.findResource(Unknown
>> Source)
>>
>> at sun.misc.URLClassPath.findResource(Unknown Source)
>>
>> at java.net.URLClassLoader$2.run(Unknown Source)
>>
>> at java.security.AccessController.doPrivileged(Native Method)
>>
>> at java.net.URLClassLoader.findResource(Unknown Source)
>>
>> at java.lang.ClassLoader.getResource(Unknown Source)
>>
>> at java.lang.ClassLoader.getResource(Unknown Source)
>>
>> at java.lang.ClassLoader.getResource(Unknown Source)
>>
>> at java.lang.ClassLoader.getResourceAsStream(Unknown Source)
>>
>> at
>> org.apache.catalina.loader.WebappClassLoader.getResourceAsStream(WebappClassLoader.java:1176)
>>
>> at
>> com.sun.org.apache.xalan.internal.xsltc.dom.SecuritySupport12$6.run(Unknown
>> Source)
>>
>> at java.security.AccessController.doPrivileged(Native Method)
>>
>> at
>> com.sun.org.apache.xalan.internal.xsltc.dom.SecuritySupport12.getResourceAsStream(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xalan.internal.xsltc.dom.ObjectFactory.findJarServiceProviderName(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xalan.internal.xsltc.dom.ObjectFactory.lookUpFactoryClassName(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xalan.internal.xsltc.dom.ObjectFactory.lookUpFactoryClass(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTMManagerClass(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.<init>(Unknown
>> Source)
>>
>> at
>> sun.reflect.GeneratedConstructorAccessor45.newInstance(Unknown Source)
>>
>> at
>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
>>
>> at java.lang.reflect.Constructor.newInstance(Unknown Source)
>>
>> at java.lang.Class.newInstance0(Unknown Source)
>>
>> at java.lang.Class.newInstance(Unknown Source)
>>
>> at javax.xml.transform.FactoryFinder.newInstance(Unknown
>> Source)
>>
>> at javax.xml.transform.FactoryFinder.find(Unknown Source)
>>
>> at javax.xml.transform.TransformerFactory.newInstance(Unknown
>> Source)
>>
>> at
>> org.apache.cxf.wsdl.EndpointReferenceUtils$SchemaLSResourceResolver.getSchemaAsStream(EndpointReferenceUtils.java:110)
>>
>> at
>> org.apache.cxf.wsdl.EndpointReferenceUtils$SchemaLSResourceResolver.resolveResource(EndpointReferenceUtils.java:125)
>>
>> at
>> com.sun.org.apache.xerces.internal.util.DOMEntityResolverWrapper.resolveEntity(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.XMLEntityManager.resolveEntity(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.resolveDocument(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.resolveSchema(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>> at
>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
>> Source)
>>
>>
>>
>>
>>
>> When schema validation is turned off, everything works well. I can also
>> get the schema validation working with external tools like (xmlSpy) or
>> this kind of code :
>>
>>
>>
>> //Validation
>>
>> in = new FileInputStream(requestFile);
>>
>> SchemaFactory schemaFactory =
>> SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
>>
>> Schema schema = schemaFactory.newSchema(new
>> StreamSource(new File("xsd/EAI.xsd")));
>>
>> Validator validator = schema.newValidator();
>>
>> validator.validate(new StreamSource(in));
>>
>>
>>
>> So it seems that my XSD file is valid.
>>
>>
>>
>>
>>
>> May be I'm not using the right way to activate server side schema
>> validation. Thanks to everyone who can help me.
>>
>>
>>
>>
>>
>> Julien
>>
>>
>>
>
>
--
View this message in context: http://www.nabble.com/Problem-with-schema-validation-%28JAX-WS---JAXB%29-tp17319174p17484086.html
Sent from the cxf-user mailing list archive at Nabble.com.
RE: Problem with schema validation (JAX-WS & JAXB)
Posted by jfougere <Ju...@cpexterne.org>.
Hi Aaron, thanks for your answer.
I have several XSD's but there is no cyclic reference. In fact the first one
import the second one who itself incude the third one. (The third one does
not include nether import another xsd).
Do you have another idea for the cause of this issue ? When I am doing
validation by code it works without problem...
Thanks
Julien
Aaron Pieper wrote:
>
> It looks to me like Xerces is recursing trying to follow your XSD imports.
> Do you have any XSDs that refer to eachother in a cycle?
>
> - Aaron
>
> -----Original Message-----
> From: FOUGERE Julien (Prestataire) [mailto:Julien.FOUGERE@cpexterne.org]
> Sent: Monday, May 19, 2008 3:49 AM
> To: cxf-user@incubator.apache.org
> Subject: Problem with schema validation (JAX-WS & JAXB)
>
> Hi, I am currently experiencing problem to set up server side schema
> validation. I have a JAX-WS frontend webservice and JAXB databinding.
>
> When I turn schema validation on, I get a stack overflow error. It really
> looks like that xerces is running on an infinite loop....
>
>
>
> Here is my cxf-servlet.xml file :
>
>
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <beans xmlns="http://www.springframework.org/schema/beans"
>
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
> xmlns:jaxws="http://cxf.apache.org/jaxws"
>
> xmlns:soap="http://cxf.apache.org/bindings/soap"
>
> xsi:schemaLocation="
>
> http://www.springframework.org/schema/beans
>
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>
> http://cxf.apache.org/bindings/soap
>
> http://cxf.apache.org/schemas/configuration/soap.xsd
>
> http://cxf.apache.org/jaxws
>
> http://cxf.apache.org/schemas/jaxws.xsd">
>
>
>
> <jaxws:endpoint
>
> id="BrmService"
>
> implementor="fr.service.pivot.BrmServiceImpl"
>
> wsdlLocation="WEB-INF/wsdl/BrmAsyncServices.wsdl"
>
> address="/BrmService">
>
> <!--Below is optional; logs SOAP requests/responses to servlet
> container
>
> output log (for Tomcat: logs/catalina.out)-->
>
> <jaxws:features>
>
> <bean class="org.apache.cxf.feature.LoggingFeature"/>
>
> </jaxws:features>
>
> <jaxws:properties>
>
> <entry key="schema-validation-enabled" value="true" />
>
> </jaxws:properties>
>
> </jaxws:endpoint>
>
> </beans>
>
>
>
> Here is the stack trace :
>
>
>
> GRAVE: "Servlet.service()" pour la servlet WebServicePort a généré une
> exception
>
> java.lang.StackOverflowError
>
> at java.util.zip.ZipFile.getEntry(Unknown Source)
>
> at java.util.jar.JarFile.getEntry(Unknown Source)
>
> at java.util.jar.JarFile.getJarEntry(Unknown Source)
>
> at sun.misc.URLClassPath$JarLoader.getResource(Unknown Source)
>
> at sun.misc.URLClassPath$JarLoader.findResource(Unknown
> Source)
>
> at sun.misc.URLClassPath.findResource(Unknown Source)
>
> at java.net.URLClassLoader$2.run(Unknown Source)
>
> at java.security.AccessController.doPrivileged(Native Method)
>
> at java.net.URLClassLoader.findResource(Unknown Source)
>
> at java.lang.ClassLoader.getResource(Unknown Source)
>
> at java.lang.ClassLoader.getResource(Unknown Source)
>
> at java.lang.ClassLoader.getResource(Unknown Source)
>
> at java.lang.ClassLoader.getResourceAsStream(Unknown Source)
>
> at
> org.apache.catalina.loader.WebappClassLoader.getResourceAsStream(WebappClassLoader.java:1176)
>
> at
> com.sun.org.apache.xalan.internal.xsltc.dom.SecuritySupport12$6.run(Unknown
> Source)
>
> at java.security.AccessController.doPrivileged(Native Method)
>
> at
> com.sun.org.apache.xalan.internal.xsltc.dom.SecuritySupport12.getResourceAsStream(Unknown
> Source)
>
> at
> com.sun.org.apache.xalan.internal.xsltc.dom.ObjectFactory.findJarServiceProviderName(Unknown
> Source)
>
> at
> com.sun.org.apache.xalan.internal.xsltc.dom.ObjectFactory.lookUpFactoryClassName(Unknown
> Source)
>
> at
> com.sun.org.apache.xalan.internal.xsltc.dom.ObjectFactory.lookUpFactoryClass(Unknown
> Source)
>
> at
> com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTMManagerClass(Unknown
> Source)
>
> at
> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.<init>(Unknown
> Source)
>
> at
> sun.reflect.GeneratedConstructorAccessor45.newInstance(Unknown Source)
>
> at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
>
> at java.lang.reflect.Constructor.newInstance(Unknown Source)
>
> at java.lang.Class.newInstance0(Unknown Source)
>
> at java.lang.Class.newInstance(Unknown Source)
>
> at javax.xml.transform.FactoryFinder.newInstance(Unknown
> Source)
>
> at javax.xml.transform.FactoryFinder.find(Unknown Source)
>
> at javax.xml.transform.TransformerFactory.newInstance(Unknown
> Source)
>
> at
> org.apache.cxf.wsdl.EndpointReferenceUtils$SchemaLSResourceResolver.getSchemaAsStream(EndpointReferenceUtils.java:110)
>
> at
> org.apache.cxf.wsdl.EndpointReferenceUtils$SchemaLSResourceResolver.resolveResource(EndpointReferenceUtils.java:125)
>
> at
> com.sun.org.apache.xerces.internal.util.DOMEntityResolverWrapper.resolveEntity(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.XMLEntityManager.resolveEntity(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.resolveDocument(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.resolveSchema(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
> at
> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown
> Source)
>
>
>
>
>
> When schema validation is turned off, everything works well. I can also
> get the schema validation working with external tools like (xmlSpy) or
> this kind of code :
>
>
>
> //Validation
>
> in = new FileInputStream(requestFile);
>
> SchemaFactory schemaFactory =
> SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
>
> Schema schema = schemaFactory.newSchema(new StreamSource(new
> File("xsd/EAI.xsd")));
>
> Validator validator = schema.newValidator();
>
> validator.validate(new StreamSource(in));
>
>
>
> So it seems that my XSD file is valid.
>
>
>
>
>
> May be I'm not using the right way to activate server side schema
> validation. Thanks to everyone who can help me.
>
>
>
>
>
> Julien
>
>
>
--
View this message in context: http://www.nabble.com/Problem-with-schema-validation-%28JAX-WS---JAXB%29-tp17319174p17359818.html
Sent from the cxf-user mailing list archive at Nabble.com.
RE: Problem with schema validation (JAX-WS & JAXB)
Posted by "Pieper, Aaron (SAIC)" <Pi...@Pragmatics.com>.
It looks to me like Xerces is recursing trying to follow your XSD imports. Do you have any XSDs that refer to eachother in a cycle?
- Aaron
-----Original Message-----
From: FOUGERE Julien (Prestataire) [mailto:Julien.FOUGERE@cpexterne.org]
Sent: Monday, May 19, 2008 3:49 AM
To: cxf-user@incubator.apache.org
Subject: Problem with schema validation (JAX-WS & JAXB)
Hi, I am currently experiencing problem to set up server side schema validation. I have a JAX-WS frontend webservice and JAXB databinding.
When I turn schema validation on, I get a stack overflow error. It really looks like that xerces is running on an infinite loop....
Here is my cxf-servlet.xml file :
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:soap="http://cxf.apache.org/bindings/soap"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://cxf.apache.org/bindings/soap
http://cxf.apache.org/schemas/configuration/soap.xsd
http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd">
<jaxws:endpoint
id="BrmService"
implementor="fr.service.pivot.BrmServiceImpl"
wsdlLocation="WEB-INF/wsdl/BrmAsyncServices.wsdl"
address="/BrmService">
<!--Below is optional; logs SOAP requests/responses to servlet container
output log (for Tomcat: logs/catalina.out)-->
<jaxws:features>
<bean class="org.apache.cxf.feature.LoggingFeature"/>
</jaxws:features>
<jaxws:properties>
<entry key="schema-validation-enabled" value="true" />
</jaxws:properties>
</jaxws:endpoint>
</beans>
Here is the stack trace :
GRAVE: "Servlet.service()" pour la servlet WebServicePort a généré une exception
java.lang.StackOverflowError
at java.util.zip.ZipFile.getEntry(Unknown Source)
at java.util.jar.JarFile.getEntry(Unknown Source)
at java.util.jar.JarFile.getJarEntry(Unknown Source)
at sun.misc.URLClassPath$JarLoader.getResource(Unknown Source)
at sun.misc.URLClassPath$JarLoader.findResource(Unknown Source)
at sun.misc.URLClassPath.findResource(Unknown Source)
at java.net.URLClassLoader$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findResource(Unknown Source)
at java.lang.ClassLoader.getResource(Unknown Source)
at java.lang.ClassLoader.getResource(Unknown Source)
at java.lang.ClassLoader.getResource(Unknown Source)
at java.lang.ClassLoader.getResourceAsStream(Unknown Source)
at org.apache.catalina.loader.WebappClassLoader.getResourceAsStream(WebappClassLoader.java:1176)
at com.sun.org.apache.xalan.internal.xsltc.dom.SecuritySupport12$6.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.org.apache.xalan.internal.xsltc.dom.SecuritySupport12.getResourceAsStream(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.dom.ObjectFactory.findJarServiceProviderName(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.dom.ObjectFactory.lookUpFactoryClassName(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.dom.ObjectFactory.lookUpFactoryClass(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTMManagerClass(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.<init>(Unknown Source)
at sun.reflect.GeneratedConstructorAccessor45.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at javax.xml.transform.FactoryFinder.newInstance(Unknown Source)
at javax.xml.transform.FactoryFinder.find(Unknown Source)
at javax.xml.transform.TransformerFactory.newInstance(Unknown Source)
at org.apache.cxf.wsdl.EndpointReferenceUtils$SchemaLSResourceResolver.getSchemaAsStream(EndpointReferenceUtils.java:110)
at org.apache.cxf.wsdl.EndpointReferenceUtils$SchemaLSResourceResolver.resolveResource(EndpointReferenceUtils.java:125)
at com.sun.org.apache.xerces.internal.util.DOMEntityResolverWrapper.resolveEntity(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.resolveEntity(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.resolveDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.resolveSchema(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
When schema validation is turned off, everything works well. I can also get the schema validation working with external tools like (xmlSpy) or this kind of code :
//Validation
in = new FileInputStream(requestFile);
SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
Schema schema = schemaFactory.newSchema(new StreamSource(new File("xsd/EAI.xsd")));
Validator validator = schema.newValidator();
validator.validate(new StreamSource(in));
So it seems that my XSD file is valid.
May be I'm not using the right way to activate server side schema validation. Thanks to everyone who can help me.
Julien