-
Aug 8th, 2008, 02:21 PM
#1
WSDL Generation Error (XSD based approach...)
Hi,
I'm trying to create a WSDL using Spring WS. I've followed instructions to the letter and I keep getting errors.
The config is:
<bean id="publish" class="org.springframework.ws.wsdl.wsdl11.DefaultW sdl11Definition">
<property name="schema" ref="schema"/>
<property name="portTypeName" value="publish"/>
<property name="targetNamespace" value="xyz"/>
<property name="locationUri" value="/publish.wsdl"/>
</bean>
<bean id="schema" class="org.springframework.xml.xsd.SimpleXsdSchema ">
<property name="xsd" value="/eal.xsd"/>
</bean>
I'm getting the following error. It is very frustrating. I have Xalan & all the dependent
jars in place. What is going on? I have spent 2 days and nothing has changed.
************************************************** *************
Context initialization failed
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean wit
h name 'publish' defined in ServletContext resource [/WEB-INF/applicationcontext
.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMet
hodError: javax.xml.transform.dom.DOMResult.getNextSibling() Lorg/w3c/dom/Node;
at org.springframework.beans.factory.support.Abstract AutowireCapableBean
Factory.initializeBean(AbstractAutowireCapableBean Factory.java:1337)
at org.springframework.beans.factory.support.Abstract AutowireCapableBean
Factory.doCreateBean(AbstractAutowireCapableBeanFa ctory.java:473)
at org.springframework.beans.factory.support.Abstract AutowireCapableBean
Factory$1.run(AbstractAutowireCapableBeanFactory.j ava:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.Abstract AutowireCapableBean
Factory.createBean(AbstractAutowireCapableBeanFact ory.java:380)
at org.springframework.beans.factory.support.Abstract BeanFactory$1.getOb
ject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistr
y.getSingleton(DefaultSingletonBeanRegistry.java:2 21)
at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBe
an(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean
(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean
(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultL istableBeanFactory.
preInstantiateSingletons(DefaultListableBeanFactor y.java:429)
at org.springframework.context.support.AbstractApplic ationContext.finish
BeanFactoryInitialization(AbstractApplicationConte xt.java:729)
at org.springframework.context.support.AbstractApplic ationContext.refres
h(AbstractApplicationContext.java:381)
at org.springframework.web.context.ContextLoader.crea teWebApplicationCon
text(ContextLoader.java:255)
at org.springframework.web.context.ContextLoader.init WebApplicationConte
xt(ContextLoader.java:199)
at org.springframework.web.context.ContextLoaderListe ner.contextInitiali
zed(ContextLoaderListener.java:45)
at org.apache.catalina.core.StandardContext.listenerS tart(StandardContex
t.java:3827)
at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4
343)
at org.apache.catalina.core.ContainerBase.addChildInt ernal(ContainerBase
.java:823)
at org.apache.catalina.core.ContainerBase.addChild(Co ntainerBase.java:80
7)
at org.apache.catalina.core.StandardHost.addChild(Sta ndardHost.java:595)
at org.apache.catalina.core.StandardHostDeployer.inst all(StandardHostDep
loyer.java:277)
at org.apache.catalina.core.StandardHost.install(Stan dardHost.java:832)
at org.apache.catalina.startup.HostConfig.deployWARs( HostConfig.java:625
)
at org.apache.catalina.startup.HostConfig.deployApps( HostConfig.java:431
)
at org.apache.catalina.startup.HostConfig.start(HostC onfig.java:983)
at org.apache.catalina.startup.HostConfig.lifecycleEv ent(HostConfig.java
:349)
at org.apache.catalina.util.LifecycleSupport.fireLife cycleEvent(Lifecycl
eSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1091)
at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:789)
at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1083)
at org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:478
)
at org.apache.catalina.core.StandardService.start(Sta ndardService.java:4
80)
at org.apache.catalina.core.StandardServer.start(Stan dardServer.java:231
3)
at org.apache.catalina.startup.Catalina.start(Catalin a.java:556)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootst rap.java:287)
at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:425)
Caused by: java.lang.NoSuchMethodError: javax.xml.transform.dom.DOMResult.getNex
tSibling()Lorg/w3c/dom/Node;
at org.apache.xalan.transformer.TransformerIdentityIm pl.createResultCont
entHandler(TransformerIdentityImpl.java:201)
at org.apache.xalan.transformer.TransformerIdentityIm pl.transform(Transf
ormerIdentityImpl.java:330)
at org.springframework.xml.transform.TransformerObjec tSupport.transform(
TransformerObjectSupport.java:71)
at org.springframework.ws.wsdl.wsdl11.provider.Inlini ngXsdSchemaTypesPro
vider.getSchemaElement(InliningXsdSchemaTypesProvi der.java:113)
at org.springframework.ws.wsdl.wsdl11.provider.Inlini ngXsdSchemaTypesPro
vider.addTypes(InliningXsdSchemaTypesProvider.java :101)
at org.springframework.ws.wsdl.wsdl11.ProviderBasedWs dl4jDefinition.afte
rPropertiesSet(ProviderBasedWsdl4jDefinition.java: 233)
at org.springframework.ws.wsdl.wsdl11.DefaultWsdl11De finition.afterPrope
rtiesSet(DefaultWsdl11Definition.java:170)
at org.springframework.beans.factory.support.Abstract AutowireCapableBean
Factory.invokeInitMethods(AbstractAutowireCapableB eanFactory.java:1368)
at org.springframework.beans.factory.support.Abstract AutowireCapableBean
Factory.initializeBean(AbstractAutowireCapableBean Factory.java:1334)
... 40 more
************************************************** *************
Here is the XSD that is being used:
************************************************** *************
<xs:schema xmlns:xs="/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" targetNamespace="/raptor/eal/schemas">
<xs:include schemaLocation="MyPortfolio.xsd"/>
<xs:element name="EALSolution" type="PublishRequest" nillable="false">
<xs:annotation>
<xs:documentation>Overall EAL Solution for the publish functionality.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:complexType name="PublishRequest">
<xs:annotation>
<xs:documentation>This represents the request payload solution xml. </xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="solution" type="MyPortfolioDataContainer"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="PublishResponse">
<xs:annotation>
<xs:documentation>This represents the response that would indicate if the upload of the solution is successful. </xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="publishStatus" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Error">
<xs:annotation>
<xs:documentation>Error contains the details of the error like type, description,code and timestamp.</xs:documentation>
</xs:annotation>
</xs:complexType>
<xs:complexType name="Errors">
<xs:annotation>
<xs:documentation>Represents a collection of multiple error types.</xs:documentation>
</xs:annotation>
<xs:sequence maxOccurs="unbounded">
<xs:element name="Error" type="Error"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ServiceError">
<xs:annotation>
<xs:documentation>The error indicates that a communication failure like connectivity to database server, email server etc occurred while uploading of the payload. </xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="Errors" type="Errors"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="DataError">
<xs:annotation>
<xs:documentation>The error indicates a problem with the data in the payload.</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="Error">
<xs:sequence>
<xs:element name="Errors" type="Errors"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>
-
Aug 11th, 2008, 05:36 AM
#2
Hi,
please check your Xalan and Xerces versions and try to use latest versions as Xalan 2.7.0 and Xerces 2.8.1 . Also make sure other dependencies does not load old versions of Xalan and Xerces specially if you have Jaxen as a dependency.
-
Aug 11th, 2008, 01:54 PM
#3
Thanks!
I have downloaded Xalan 2.7.1 and I have also downloaded Xerxes 2.9.1. Based on my classpath, the newer versions should get loaded before any older version.
I can check again, but just wanted to confirm if this is a Xalan & Xerxes issue or it can be something else.
Thanks,
Sharad
-
Aug 11th, 2008, 11:20 PM
#4
I tried to expose your XSD within a Maven2 project and got a different exception because you have used invalid namespace for XS ( i think it because of this Forum restrictions
) . With the correct namespace it worked fine with me and WSDL definition also generated. I couldn't find any other issue with your setting.
i think still you have problem with dependencies please double check .
-
Aug 12th, 2008, 11:01 PM
#5
Thanks!
I had to edit the namespace because the forum doesnt allow me to include URL(s). I think the only problem might be the Xalan & Xerxes version.
If possible could you send me the exact version numbers for these parsers? It'll be most useful.
I'm on Spring 2.5, JDK 1.5.x and TOMCAT 5.5.
Thanks,
Sharad
-
Aug 12th, 2008, 11:16 PM
#6
Hi
This is part of my POM file including dependencies, hope this will help you .Also i tested on Jetty server not with any Tomcat Version. I fell its better to check jar flies in Tomcat lib also , just a suggestion.
<dependencies>
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-oxm</artifactId>
<version>1.5.0</version>
</dependency>
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-core</artifactId>
<version>1.5.0</version>
</dependency>
<dependency>
<groupId>jdom</groupId>
<artifactId>jdom</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
<version>1.1</version>
<exclusions>
<exclusion>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
</exclusion>
<exclusion>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.8.1</version>
</dependency>
<dependency>
<groupId>javax.xml.soap</groupId>
<artifactId>saaj-api</artifactId>
<version>1.3</version>
<!-- <scope>runtime</scope>-->
</dependency>
<dependency>
<groupId>com.sun.xml.messaging.saaj</groupId>
<artifactId>saaj-impl</artifactId>
<version>1.3</version>
<!-- <scope>runtime</scope> -->
</dependency>
</dependencies>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules