問題
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ws="http://jax-ws.dev.java.net/spring/core"
xmlns:wss="http://jax-ws.dev.java.net/spring/servlet"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://jax-ws.dev.java.net/spring/core
http://jax-ws.dev.java.net/spring/core.xsd
http://jax-ws.dev.java.net/spring/servlet
http://jax-ws.dev.java.net/spring/servlet.xsd"
>
<wss:binding url="/ws">
<wss:service>
<ws:service bean="#UserWs"/>
</wss:service>
</wss:binding>
<!-- this bean implements web service methods -->
<bean id="UserWs" class="com.mkyong.user.ws.UserWS">
<property name="UserBo" ref="com.mkyong.user.bo.UserBo"/>
</bean>
</beans>
しかし、次のエラーメッセージが表示されます。
java.lang.ClassNotFoundException: org.apache.xbean.spring.context.v2.XBeanNamespaceHandler
解決策
“org.apache.xbean.spring.context.v2.XBeanNamespaceHandler`”は
xbean-spring.jar
に属します。 Mavenの中央リポジトリhttp://repo1.maven.org/maven2/org/apache/xbean/xbean-spring/[here]から取得したり、xbeanの依存関係をpom.xmlファイルに宣言したりできます。
File:pom.xml
<dependency>
<artifactId>xbean</artifactId>
<groupId>org.apache.xbean</groupId>
<version>3.7</version>
</dependency>