views:

388

answers:

1

Hi all,

Trying to integrate Spring 2.5.5 with Xfire 1.2.6, I'm attempting to inject one of my beans into my service but it's failing on initialisation with the following exception:

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

I get this as soon as I send my first request to the service via SoapUI. I've been googling and struggling for days with this now and I'd love some help :)

Here's my 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"&gt;
    <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>

and 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"&gt;

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

and finally, my 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"&gt;
 <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>

No idea why this is occuring. The JARs I'm using are as follows:

  • activation-1.1.jar
  • app-SNAPSHOT.jar
  • commons-beanutils-1.7.0.jar
  • commons-codec-1.3.jar
  • commons-collections.jar
  • commons-digester.jar
  • commons-fileupload.jar
  • commons-httpclient-3.0.1.jar
  • commons-lang.jar
  • commons-logging-1.0.4.jar
  • commons-logging-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
  • saaj-impl-1.3.jar
  • spring-webmvc-1.2.6.jar
  • spring.2.5.1.jar
  • struts-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-annotations-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

I'm deploying this on Weblogic 8.2 as a WAR file.

Any help would be greatly appreciated.

+3  A: 

It seems you have version mismatch in your spring jars - the spring is 2.5.1 and the spring web mvc is the (rather old) 1.2.6. Why not move both of them to the latest 2.5.6.SEC01?

David Rabinowitz
spring-webmvc-1.2.6.jar is the only one I could find for Spring WebMVC. I got it via repo1.maven.org/maven2. Any ideas where I could get that version (2.5.6) for both?
atc
http://repo1.maven.org/maven2/org/springframework/spring-webmvc/2.5.6.SEC01/
David Rabinowitz
Even if 1.2.6 was the only version you could find, that's no reason to use it anyway, it's clearly not going to work with the 2.5.1 core.
skaffman
Scrap that, found the JARs locally. Trying with the updated JARs
atc
This fixed it. I feel really stupid :(Thanks a lot!
atc
http://www.springsource.org/download
matt b