Spring 2.5.1和Xfire 1.2.6 - NoSuchMethodError:<init> </init>

时间:2009-09-21 12:14:42

标签: java web-services spring weblogic xfire

尝试将Spring 2.5.5与Xfire 1.2.6集成,我试图将我的一个bean注入到我的服务中,但它在初始化时失败,但有以下异常:

java.lang.NoSuchMethodError: <init>
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:420)
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:357)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
        Truncated. see log file for complete stacktrace

一旦我通过SoapUI向服务发送第一个请求,我就会收到此消息。我现在一直在谷歌上搜索和挣扎几天,我会喜欢一些帮助:)

这是我的web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4"
         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee   http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/spring/datasourceContext.xml
            /WEB-INF/spring/applicationContext.xml
            classpath:org/codehaus/xfire/spring/xfire.xml
        </param-value>
    </context-param>

    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <listener>
        <listener-class>com.moo.app.util.appWSEnvLifeCycleListener</listener-class>
    </listener>

    <servlet>
        <servlet-name>xfire</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet>
        <servlet-name>action</servlet-name>
        <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
        <init-param>
            <param-name>config</param-name>
            <param-value>/WEB-INF/struts-config.xml</param-value>
        </init-param>
        <init-param>
            <param-name>debug</param-name>
            <param-value>3</param-value>
        </init-param>
        <init-param>
            <param-name>detail</param-name>
            <param-value>3</param-value>
        </init-param>
        <load-on-startup>0</load-on-startup>
    </servlet>

    <servlet>
        <servlet-name>LogFile</servlet-name>
        <servlet-class>com.moo.app.dashboard.servlet.LogFileServlet</servlet-class>
        <load-on-startup>2</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>xfire</servlet-name>
        <url-pattern>/services/*</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>action</servlet-name>
        <url-pattern>*.do</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>LogFile</servlet-name>
        <url-pattern>*.zip</url-pattern>
    </servlet-mapping>

    <mime-mapping>
        <extension>zip</extension>
        <mime-type>application/zip</mime-type>
    </mime-mapping>

    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>

    <!-- Struts Tag Library Descriptors -->
    <jsp-config>
        <taglib>
            <taglib-uri>/tags/struts-bean</taglib-uri>
            <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
        </taglib>
        <taglib>
            <taglib-uri>/tags/struts-html</taglib-uri>
            <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
        </taglib>
        <taglib>
            <taglib-uri>/tags/struts-logic</taglib-uri>
            <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
        </taglib>
        <taglib>
            <taglib-uri>/tags/struts-nested</taglib-uri>
            <taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
        </taglib>
        <taglib>
            <taglib-uri>/tags/struts-tiles</taglib-uri>
            <taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
        </taglib>
    </jsp-config>
</web-app>

和我的applicationContext.xml:

<beans xmlns="http://www.springframework.org/schema/beans"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:aop="http://www.springframework.org/schema/aop"
 xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">

 <bean id="app.TransactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
  <property name="dataSource" ref="appDataSource" />
 </bean>

 <bean id="app.TxProxyTemplate"
  class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"
  abstract="true">
  <property name="transactionManager" ref="app.TransactionManager" />
  <property name="transactionAttributes">
   <props>
    <prop key="save*">PROPAGATION_REQUIRED</prop>
    <prop key="create*">PROPAGATION_SUPPORTS</prop>
    <prop key="update*">PROPAGATION_SUPPORTS</prop>
    <prop key="*">PROPAGATION_SUPPORTS,readOnly</prop>
   </props>
  </property>
 </bean>

 <bean id="app.BaseappDAO" class="com.moo.app.app.data.BaseappDAO" abstract="true">
  <property name="dataSource" ref="appDataSource" />
 </bean>

 <bean id="app.MembershipDetailsDAO" class="com.moo.app.app.data.MembershipDetailsDAOImpl"
  parent="app.BaseappDAO">
 </bean>

 <bean id="app.MembershipDetails" class="com.moo.app.app.data.MembershipDetailsServiceImpl">
  <property name="membershipDetailsDAO" ref="app.MembershipDetailsDAO" />
 </bean>

 <bean id="app.appService" class="com.moo.app.app">
     <property name="membershipDetailsService" ref="app.MembershipDetails" />
 </bean>
</beans>

最后,我的xfire-servlet.xml:

<beans xmlns="http://www.springframework.org/schema/beans"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:aop="http://www.springframework.org/schema/aop"
 xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
 <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
  <property name="urlMap">
   <map>
    <entry key="/services/app/">
     <ref bean="app.appService"/>
    </entry>
   </map>
  </property>
 </bean>

 <!-- Declare a parent bean with all properties common to both services -->
 <bean id="echo" class="org.codehaus.xfire.spring.remoting.XFireExporter">
  <property name="serviceFactory">
   <ref bean="xfire.serviceFactory"/>
  </property>
  <property name="xfire">
   <ref bean="xfire"/>
  </property>
  <property name="serviceBean">
   <ref bean="app.appService"/>
  </property>
  <property name="serviceClass">
   <value>com.moo.app.app.appService</value>
  </property>
 </bean>
</beans>

不知道为什么会这样。我正在使用的JAR如下:

  • 活化-1.1.jar
  • APP-SNAPSHOT.jar
  • 公地BeanUtils的-1.7.0.jar
  • 公地编解码器-1.3.jar
  • 公地collections.jar
  • 公地digester.jar
  • 公地fileupload.jar
  • 公地HttpClient的-3.0.1.jar
  • 公地lang.jar
  • 共享记录-1.0.4.jar
  • 共享记录-API-1.0.jar
  • 公地validator.jar
  • Jaxen的-1.1-β-9.jar
  • JAXWS-API-2.0.jar
  • JDOM-1.0.jar
  • jsr173_api-1.0.jar
  • 的log4j-1.2.12.jar
  • ojdbc14.jar的
  • SAAJ-API-1.3.jar
  • SAAJ-IMPL-1.3.jar
  • 弹簧webmvc-1.2.6.jar
  • spring.2.5.1.jar
  • 支柱-legacy.jar
  • 的struts.jar
  • WSDL4J-1.6.1.jar
  • wstx-ASL-3.2.0.jar
  • xbean - 弹簧 - 2.8.jar
  • XFire软件-主持-1.2.6.jar
  • XFire软件的注解-1.2.6.jar
  • XFire软件核-1.2.6.jar
  • XFire软件-java5-1.2.6.jar
  • XFire软件-JAXWS-1.2.6.jar
  • XFire软件-JSR181-API-1.0-M1.jar
  • XFire软件 - 弹簧 - 1.2.6.jar
  • XMLSchema的1.1.jar

我在Weblogic 8.2上将其部署为WAR文件。

非常感谢任何帮助。

1 个答案:

答案 0 :(得分:3)

您的弹簧罐中看起来版本不匹配 - 弹簧为2.5.1,弹簧网mvc为(相当旧)1.2.6。为什么不将它们都移到最新的2.5.6.SEC01?