Spring WS DefaultWsdl11Definition 错误

发布于 2024-10-07 21:04:07 字数 2423 浏览 2 评论 0原文

我正在使用 Spring WS 并声明 DefaultWsdl11Definition bean 来动态生成 W​​SDL 文件。

但是,当我启动网络服务器(tomcat)时,我收到一个 bean 实例化错误,原因是:

    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

SpringWS-Servlet.xml 中的 Bean

<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>

任何想法可能是什么问题..

PS:Spring 版本是 3.0.5 ,Spring WS 版本是 2.0.0-M3

谢谢

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

陈甜 2024-10-14 21:04:07

Spring-WS 依赖于 WSDL4J 库,您似乎缺少该库。

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

红尘作伴 2024-10-14 21:04:07

我遇到了同样的错误。然后我意识到缺少 wsdl4j 依赖项。

<dependency>
    <groupId>wsdl4j</groupId>
    <artifactId>wsdl4j</artifactId>
</dependency>

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

<dependency>
    <groupId>wsdl4j</groupId>
    <artifactId>wsdl4j</artifactId>
</dependency>
掩于岁月 2024-10-14 21:04:07

如果您升级 Spring-ws 版本,您可以使用下面的 pom.xml

<properties>
    <spring.version>4.2.5.RELEASE</spring.version>
    <spring.ws.version>2.2.4.RELEASE</spring.ws.version>
    <log4j.version>1.2.16</log4j.version>
    <apache.ws.version>1.6.19</apache.ws.version>
    <context.path>spring-server</context.path>
</properties>
<dependencies>
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>${log4j.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.6</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-beans</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aop</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aspects</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>commons-collections</groupId>
        <artifactId>commons-collections</artifactId>
        <version>3.2</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-oxm</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.ws</groupId>
        <artifactId>spring-ws-core</artifactId>
        <version>${spring.ws.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.ws</groupId>
        <artifactId>spring-ws-security</artifactId>
        <version>${spring.ws.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.ws</groupId>
        <artifactId>spring-xml</artifactId>
        <version>${spring.ws.version}</version>
    </dependency>

    <dependency>
        <groupId>org.apache.ws.xmlschema</groupId>
        <artifactId>xmlschema-core</artifactId>
        <version>2.2.1</version>
    </dependency>

    <dependency>
        <groupId>org.apache.ws.security</groupId>
        <artifactId>wss4j</artifactId>
        <version>${apache.ws.version}</version>
    </dependency>
    <dependency>
        <groupId>wsdl4j</groupId>
        <artifactId>wsdl4j</artifactId>
        <version>1.6.2</version>
    </dependency>
</dependencies>

In case if you upgrade your Spring-ws version you can use below pom.xml

<properties>
    <spring.version>4.2.5.RELEASE</spring.version>
    <spring.ws.version>2.2.4.RELEASE</spring.ws.version>
    <log4j.version>1.2.16</log4j.version>
    <apache.ws.version>1.6.19</apache.ws.version>
    <context.path>spring-server</context.path>
</properties>
<dependencies>
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>${log4j.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.6</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-beans</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aop</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aspects</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>commons-collections</groupId>
        <artifactId>commons-collections</artifactId>
        <version>3.2</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-oxm</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.ws</groupId>
        <artifactId>spring-ws-core</artifactId>
        <version>${spring.ws.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.ws</groupId>
        <artifactId>spring-ws-security</artifactId>
        <version>${spring.ws.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.ws</groupId>
        <artifactId>spring-xml</artifactId>
        <version>${spring.ws.version}</version>
    </dependency>

    <dependency>
        <groupId>org.apache.ws.xmlschema</groupId>
        <artifactId>xmlschema-core</artifactId>
        <version>2.2.1</version>
    </dependency>

    <dependency>
        <groupId>org.apache.ws.security</groupId>
        <artifactId>wss4j</artifactId>
        <version>${apache.ws.version}</version>
    </dependency>
    <dependency>
        <groupId>wsdl4j</groupId>
        <artifactId>wsdl4j</artifactId>
        <version>1.6.2</version>
    </dependency>
</dependencies>
梦幻之岛 2024-10-14 21:04:07

您需要包含 WSDL 库。 Spring WS Core 2.0.0-M1 的 POM 包含此参考:

http://mvnrepository.com/artifact/org.springframework.ws/spring-ws-core/2.0.0-M1

You need the WSDL library to be included. The POM for Spring WS Core 2.0.0-M1 includes this reference:

http://mvnrepository.com/artifact/org.springframework.ws/spring-ws-core/2.0.0-M1

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文