spring-projects / spring-ws

Spring Web Services
https://spring.io/projects/spring-ws
Apache License 2.0
317 stars 309 forks source link

XsdBasedSoap11Wsdl4jDefinitionBuilder throws BeanCreationException while generating wsdl [SWS-601] #717

Open gregturn opened 14 years ago

gregturn commented 14 years ago

Prasad opened SWS-601 and commented

While I was trying to generate it is throwing an exception. I am pasting the exception below

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'echo' defined in ServletContext resource [/WEB-INF/spring-ws-servlet.xml]: Cannot create inner bean 'org.springframework.ws.wsdl.wsdl11.builder.XsdBasedSoap11Wsdl4jDefinitionBuilder#1498436' of type [org.springframework.ws.wsdl.wsdl11.builder.XsdBasedSoap11Wsdl4jDefinitionBuilder] while setting bean property 'builder'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.ws.wsdl.wsdl11.builder.XsdBasedSoap11Wsdl4jDefinitionBuilder#1498436' defined in ServletContext resource [/WEB-INF/spring-ws-servlet.xml]: Invocation of init method failed; nested exception is org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.

The bean definition in my servlet is as below \
\
\<bean
class="org.springframework.ws.wsdl.wsdl11.builder.XsdBasedSoap11Wsdl4jDefinitionBuilder"> //Error at this line
\
\
\
\

\
\


Affects: 1.5.8

gregturn commented 14 years ago

Aleksander Adamowski commented

Are you using unmodified WEB-INF/echo.xsd from the samples? Or did you change something in it?

Is it possible that there are any characters before the XML prolog (the "\<?xml version="1.0" encoding="UTF-8"?>")?

E.g. some UTF-8 editors insert a BOM character at the beginning of the file - use a hex editor to see the actual byte content, the file should start with bytes: 3c 3f 78 6d 6c, which correspond to "<?xml".