سؤال

في محاولة لإدماج Spring 2.5.5 مع Xfire 1.2.6، أحاول حقن إحدى فاصولي في خدمتي، لكنها فشلت في التهوية مع الاستثناء التالي:

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. لقد كنت googling و تكافح لعدة أيام مع هذا الآن وأحب بعض المساعدة :)

إليك 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>

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

لا فكرة لماذا يحدث هذا. الجرار التي أستخدمها هي كما يلي:

  • التنشيط - 1.1.jar.
  • تطبيق Snapshot.jar.
  • Commons-Beanutils-1.7.0.jar
  • Commons-Codec-1.3.Jar
  • مجموعات العموم
  • العموم - digester.jar.
  • العم-fileupload.jar.
  • Commons-httpClient-3.0.1.jar
  • العموم - Lang.Jar.
  • كومونس تسجيل - 1.0.4.jar
  • كومونس تسجيل-API-1.0.JAR
  • commons-validator.jar.
  • JAXEN-1.1-BETA-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
  • SAIJ-IMPLE-1.3.JAR
  • Spring-WebMVC-1.2.6.JAR
  • spring.2.5.5.1.jar.
  • الدعامات- legacy.jar.
  • struts.jar.
  • WSDL4J-1.6.1.jar.
  • WSTX-ASL-3.2.0.JAR
  • XBEAN-Spring-2.8.Jar
  • Xfire-Aegis-1.2.6.jar
  • Xfire-anentations-1.2.6.jar
  • Xfire-Core-1.2.6.jar
  • Xfire-Java5-1.2.6.jar.
  • Xfire-Jaxws-1.2.6.jar
  • Xfire-JSR181-API-1.0-M1.JAR
  • Xfire-Spring-1.2.6.jar
  • xmlschema-1.1.jar.

أنا نشر هذا على Weblogic 8.2 كملف حرب.

سيتم تقدير أي مساعدة إلى حد كبير.

هل كانت مفيدة؟

المحلول

يبدو أن لديك عدم تطابق الإصدار في الجرار الربيع الخاص بك - الربيع هو 2.5.1 وربيع الويب MVC هو (قديم إلى حد ما) 1.2.6. لماذا لا تتحرك كل منهما إلى أحدث 2.5.6.SEC01؟

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top