我在Spring和Hibernate中使用Axis2。所有Spring库都位于AAR / lib
文件夹中。但是在启动初始化方法时会抛出这个:
...Caused by: java.lang.ClassNotFoundException: org.springframework.context.ApplicationContextAware
这是我的Spring init服务:
<service name="SpringInitService"
class="services.implementations.SpringInitService">
<parameter name="ServiceTCCL">composite</parameter>
<parameter name="ServiceObjectSupplier">org.apache.axis2.extensions.spring.receivers.SpringAppContextAwareObjectSupplier
</parameter>
<parameter name="SpringBeanName">SpringInitService</parameter>
<!-- <parameter name="load-on-startup">true</parameter> -->
<operation name="getValue">
<messageReceiver
class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver" />
</operation>
</service>
启动方法:
@SuppressWarnings("resource")
public void startUp(ConfigurationContext ignore, AxisService service) {
ClassLoader classLoader = service.getClassLoader();
ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext(
new String[] { "classpath:spring/applicationContext.xml" }, false);
applicationContext.setClassLoader(classLoader);
applicationContext.refresh();
}
注意:我不想移动WEB-INF / lib中的库
请帮忙!