Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring WS DefaultWsdl11Definition Error

I am using Spring WS and declaring a DefaultWsdl11Definition bean to generate the WSDL Files on the fly.

However , When i start the webserver (tomcat) I get a bean instantiaion error due to :

    Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: javax/wsdl/extensions/ExtensibilityElement
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:141)
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:74)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:958)
    ... 45 more
Caused by: java.lang.NoClassDefFoundError: javax/wsdl/extensions/ExtensibilityElement
    at org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition.<init>(DefaultWsdl11Definition.java:56)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126)
    ... 47 more
Caused by: java.lang.ClassNotFoundException: javax.wsdl.extensions.ExtensibilityElement
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1671)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1516)
    ... 53 more

Bean in SpringWS-Servlet.xml

<bean id="beanWS" class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition">
        <property name="schema">
            <bean class="org.springframework.xml.xsd.SimpleXsdSchema">
                <property name="xsd" value="/WEB-INF/somexsd.xsd"/>
            </bean>
        </property>
        <property name="portTypeName" value="beanWS"/>
        <property name="locationUri"
                  value="http://localhost:8080/springws"/>
    </bean>

Any Idea what the problem might be ..

PS : Spring version is 3.0.5 , Spring WS Version is 2.0.0-M3

Thanks

like image 378
Wael Awada Avatar asked Dec 13 '10 17:12

Wael Awada


2 Answers

Spring-WS depends on the WSDL4J library, which you seem to be missing.

like image 98
skaffman Avatar answered Nov 18 '22 17:11

skaffman


I got the same error. Then I realized that wsdl4j dependency was missing.

<dependency>
    <groupId>wsdl4j</groupId>
    <artifactId>wsdl4j</artifactId>
</dependency>
like image 28
shashi ranjan Avatar answered Nov 18 '22 16:11

shashi ranjan