-
1. Re: XML Parsing Error: duplicate attribute in wsdl definitions with jboss versions of xerces and xalan
romanj Feb 5, 2013 8:39 PM (in response to michael-s)Could you please paste full WSDL file content? Or at least full namespace definition?
Part which you mentioned seems to be all right.
I am affraid that replacing xerces version you will need custom build of jboss.
-
2. Re: XML Parsing Error: duplicate attribute in wsdl definitions with jboss versions of xerces and xalan
michael-s Feb 6, 2013 10:27 AM (in response to romanj)This is the full namespace definition:
<wsdl:definitions
xmlns:bsf="http://xmlns.test.com/abc/bsf/types" xmlns:d0="http://xmlns.test.com/abc/foundation/types"
xmlns:fndUtil="http://xmlns.test.com/abc/foundation/util/types" xmlns:securityComponent="http://xmlns.test.com/abc/security/types"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:specificTypes="http://xmlns.test.com/abc/security/types/specific"
xmlns:tns="http://xmlns.test.com/abc/security/loginservice" xmlns:util="http://xmlns.test.com/abc/util/types"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://xmlns.test.com/abc/security/loginservice">
The wsdl validates in eclipse without errors.
-
3. Re: XML Parsing Error: duplicate attribute in wsdl definitions with jboss versions of xerces and xalan
romanj Feb 7, 2013 7:59 AM (in response to michael-s)Hello Michael,
Thanks for the reply. I am trying to reproduce your problem and help. So please provide as much information on this problem as possible.
Steps I followed to reproduce:
- Create hello world web service using spring-ws 1.5.9
- Modify static WSDL in way that namespace definitions match with those in your post.
- Package this as WAR
- Package this as EAR
- Deploy using console to JBoss AS 7.1.1.Final
- Access wsdl using Chrome 24.0.1312.57, IE 9.0
- No errors observed. WSDL served to the browser is the same as one in package.
Could you please answer following questions:
- Is output WSDL (accessed by browser) different than oryginal one in EAR archive?
- Is this problem occuring when deploing as WAR?
- Is this problem occuring when deploing as exploded WAR?
- How are you bulding EAR?
- What is EAR version?
- In Spring-ws are you using static or dynamic wsdl?
- What version/kind of browser are you using to get the error?
- What is error - you placed error msg wchich indicates error in column 671 however your code sample has only 121 chars. (AFAIU error msg deasn't correspond to second sample).
- Is every namespace used at least once in body of XML (it is requirement of standard)?
- What JRE are you using?
Regards
JR
-
4. Re: XML Parsing Error: duplicate attribute in wsdl definitions with jboss versions of xerces and xalan
michael-s Feb 7, 2013 10:51 AM (in response to romanj)Hello Jan
Here are my answers to your questions:
1. Yes the output wsdl contains duplicates of the custom namespaces after the original namespaces:
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:bsf="http://xmlns.test.com/abc/bsf/types" xmlns:d0="http://xmlns.test.com/abc/foundation/types" xmlns:fndUtil="http://xmlns.test.com/abc/foundation/util/types" xmlns:securityComponent="http://xmlns.test.com/abc/security/types" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:specificTypes="http://xmlns.test.com/abc/security/types/specific" xmlns:tns="http://xmlns.test.com/abc/security/loginservice" xmlns:util="http://xmlns.test.com/abc/util/types" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://xmlns.test.com/abc/security/loginservice" xmlns:bsf="http://xmlns.test.com/abc/bsf/types" xmlns:d0="http://xmlns.test.com/abc/foundation/types" xmlns:fndUtil="http://xmlns.test.com/abc/foundation/util/types" xmlns:securityComponent="http://xmlns.test.com/abc/security/types" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:specificTypes="http://xmlns.test.com/abc/security/types/specific" xmlns:tns="http://xmlns.test.com/abc/security/loginservice" xmlns:util="http://xmlns.test.com/abc/util/types" xmlns:xs="http://www.w3.org/2001/XMLSchema">
2. Yes this problem occurs also when deploing as WAR.
3. Yes this problem occurs also when deploing as exploded WAR.
4. The ear is built with maven-assembly-plugin 2.3
5. We use javaee/application_6.xsd for JBoss7
6. Spring-ws is used with static wsdl like this:
<bean class="org.springframework.ws.wsdl.wsdl11.SimpleWsdl11Definition" id="loginServiceWS">
<property name="wsdl" value="classpath:config/servicecomponent/webservice/loginServiceWS.wsdl"/>
</bean>
7. I tested with IE9 and FF10ESR. The error message is from FF and the ie message is similar.
8. The namespaces are all returned in one line! 671 is the position of the first duplicate namespace (xmlns:bsf). Here the number is a little different because I modified the URLs.
Is every namespace used at least once in body of XML (it is requirement of standard)?
9. Do you mean the body of the wsdl file? The wsdl contains several imported xsd files. Not all of the namespaces are used in each wsdl file but the problem remains even if I remove the unused namespaces manually.
10. We are using jdk1.7.0_09
-
5. Re: XML Parsing Error: duplicate attribute in wsdl definitions with jboss versions of xerces and xalan
romanj Feb 7, 2013 1:33 PM (in response to michael-s)In fact this is really strange behaviour ...
But I would blame interceptors if you use any. Please find my WAR file in which wsdl should be available: http://:localhost:8080/annotated-action-endpoint-1.0/helloWorldService.wsdl after deployment. This is one of publicly available (http://code.google.com/p/spring-webservices-samples) examples with changes in static WSDL file.
The service itself should not work ;-) But wsdl should be served.
-
6. Re: XML Parsing Error: duplicate attribute in wsdl definitions with jboss versions of xerces and xalan
michael-s Feb 8, 2013 5:52 AM (in response to romanj)I tested your war example and I could load the wsdl correctly.
Yes we use interceptors like these:
<bean class="org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping">
<property name="interceptors">
<list>
<bean class="org.springframework.ws.server.endpoint.interceptor.PayloadLoggingInterceptor"/>
<bean class="org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor">
-
7. Re: XML Parsing Error: duplicate attribute in wsdl definitions with jboss versions of xerces and xalan
romanj Feb 8, 2013 6:33 AM (in response to michael-s)Thanks Michael ... today I have no time to investigate that but I will continue next week.
-
8. Re: XML Parsing Error: duplicate attribute in wsdl definitions with jboss versions of xerces and xalan
romanj Feb 12, 2013 8:36 AM (in response to romanj)Hello,
I have been trying to get this working and reproduce yours problem, but I failed :/
Only thing I can be sure is that WSDL with basic Spring-WS 1.5.9 set up is served properly under Jboss 7.1.1 Final. IMHO xerces and xalan presumably are not affected by this issue.
So the problem is somewhere else, it is impossible to track it down without WAR package which reproducing this behaviour.
If possible please provide as generic example of this bug or steps to reproduce as possible.
I updated issue in JIRA as well.
Regards
-
9. Re: XML Parsing Error: duplicate attribute in wsdl definitions with jboss versions of xerces and xalan
michael-s Feb 13, 2013 5:20 AM (in response to romanj)Hello Jan
when I change the transformWsdlLocations parameter in your example application I can reproduce the error:
<param-name>transformWsdlLocations</param-name> <param-value>false</param-value> When I set the value to true in my application it works correctly too.
-
10. Re: XML Parsing Error: duplicate attribute in wsdl definitions with jboss versions of xerces and xalan
romanj Feb 14, 2013 8:45 AM (in response to michael-s)Hello Michael,
It seems you tracked it down. Now I can reproduce that on Jboss 7.1.1.Final as well as current development head 8.0.0.Alpha1
I can not enable my example on JBoss AS 6 ;/ so I can not confirm that it is working on that server.
I checked Xerces and Xalan versions and they seems to be the same for JBoss AS 6 and current version.
-
11. Re: XML Parsing Error: duplicate attribute in wsdl definitions with jboss versions of xerces and xalan
michael-s Feb 14, 2013 8:49 AM (in response to romanj)Hello Jan,
I tested it on jboss-eap-6.0.0 and not on jboss-as-6.
-
12. Re: XML Parsing Error: duplicate attribute in wsdl definitions with jboss versions of xerces and xalan
romanj Feb 14, 2013 5:32 PM (in response to michael-s)Hello,
I am not able to test it on EAP however I think it is the same - LATEST - Xlan version -> 2.7.1.
Today I tried to debug a bit more and I have some updates:
1. When XML Source is read directly from file ... (absolute path from HDD) Xlan transform is working as it suppose to
2. When XML Source is read from JNDI it contains duplicated XSD definitions.
This code in Spring-WS when executed (transformWsdlLocations = true) prevent double XSD from occuring
if (transformLocations) {
DOMResult domResult = new DOMResult();
transformer.transform(definitionSource, domResult);
Document definitionDocument = (Document) domResult.getNode();
transformLocations(definitionDocument, request);
definitionSource = new DOMSource(definitionDocument);
}
-
13. Re: XML Parsing Error: duplicate attribute in wsdl definitions with jboss versions of xerces and xalan
romanj Feb 18, 2013 10:07 AM (in response to michael-s)Hello Michael, I figured out what happened. You were right it is related to XALAN version which is used in Jboss. Fortunatelly it is possible to modify behaviour of server just by modyfying one jar file.
It is not very clear to me is it Jboss or Spring fault but the problem is that TransformerFactory class is loaded from "org.apache.xalan.xsltc.trax.TransformerFactoryImpl" package instead of "com.sun.org.apache.xalan.internal.xsltc.trax".
Starting from JAXP 1.3 all xalan classes suppose to use com.sun.org.apache.xalan.internal package.
So to work around that problem:
- go to: JBOSS_HOME/modules/org/apache/xalan/main
- In xalan-2.7.1.jbossorg-1.jar remove following compiled classes:
- xalan-2.7.1.jbossorg-1.jar\org\apache\xalan\xsltc\trax\TransformerFactoryImpl.class
- xalan-2.7.1.jbossorg-1.jar\org\apache\xalan\xsltc\trax\TransformerFactoryImpl$PIParamWrapper.class
- xalan-2.7.1.jbossorg-1.jar\org\apache\xalan\xsltc\trax\TransformerFactoryImpl$1.class
- FactoryFinder which loads these classes have defined fallback class of: "com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl"
Maybe this is not the nicest way of doing that But it works ;-) and should be safe.
-
14. Re: XML Parsing Error: duplicate attribute in wsdl definitions with jboss versions of xerces and xalan
michael-s Feb 18, 2013 10:35 AM (in response to romanj)Hi Jan
I assume that it is a problem of JBoss because these classes are present in xalan-2.7.1-redhat-1.jar too and the error does not occur in the EAP version.
Which FactoryFinder is used in JBoss?
Will this problem be fixed in JBoss 7.2 or 8?