Yes, I tried both methods. For whatever reason when I extend ActionSupport it no longer works.

Dave Newton wrote:
Does it do the same thing if you don't explicitly
declare the bean (put the classname directly in the
struts.xml file)?

Just curious... I don't have direct experience with
what you're doing.

--- Adam Ruggles <[EMAIL PROTECTED]> wrote:

Ok I think I found the problem.  If I remove the
"extends ActionSupport" it works without any problems. I know "extends ActionSupport" works with Webwork 2, is this a bug or a change in
implementation?

Adam Ruggles wrote:
I am following the guide here
http://cwiki.apache.org/S2WIKI/struts-2-spring-2-jpa-ajax.html
For some reason when trying to map a method other
than execute I
recieve the following error:
- Servlet.service() for servlet default threw
exception
java.lang.NoSuchMethodException: $Proxy18.find()

Below are the configuration files and a segment of
the UserAction class.
struts.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
  "-//Apache Software Foundation//DTD Struts
Configuration 2.0//EN"
  "http://struts.apache.org/dtds/struts-2.0.dtd";>
<struts>
  <constant name="struts.objectFactory"
value="spring" />
  <!-- <constant name="struts.devMode"
value="true" />  -->
  <include file="struts-default.xml"/>
    <package name="havoc"
extends="struts-default">
      <action name="list" class="userAction"
method="execute">
          <result
name="success">/WEB-INF/pages/list.jsp</result>
      </action>
      <action name="save" class="userAction"
method="save">
          <result name="success"
type="redirect">/list.action</result>
      </action>
      <action name="find" class="userAction"
method="find">
          <result
name="success">/WEB-INF/pages/index.jsp</result>
      </action>
  </package>
</struts>

Application Context
<?xml version="1.0" encoding="UTF-8"?>
<beans default-autowire="byName"
xmlns="http://www.springframework.org/schema/beans";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:aop="http://www.springframework.org/schema/aop";
xmlns:tx="http://www.springframework.org/schema/tx";
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.0.xsd";>
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
autowire="no">
      <property name="location"
value="/WEB-INF/havoc.properties"/>
  </bean>

  <bean id="config"
class="com.havoc.forum.util.Config" autowire="no">
      <property name="location"
value="/WEB-INF/havoc.properties"/>
  </bean>
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
      <property name="driverClassName"
value="${jdbc.driverClassName}"/>
      <property name="url" value="${jdbc.url}"/>
      <property name="username"
value="${jdbc.username}"/>
      <property name="password"
value="${jdbc.password}"/>
  </bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
      <property name="dataSource"
ref="dataSource"/>
      <!-- This will cause spring to return the
raw SessionFactory
instead of the spring proxied one. -->
      <!-- <property
name="exposeTransactionAwareSessionFactory"
value="false" />  -->
<property name="configurationClass"
value="org.hibernate.cfg.AnnotationConfiguration"/>
<property name="configLocation" value="classpath:hibernate.cfg.xml"/>
<property
name="hibernateProperties">
          <props>
<prop
key="hibernate.dialect">${hibernate.dialect}</prop>
<prop
key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop>
              <prop
key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop
key="hibernate.bytecode.use_reflection_optimizer">${hibernate.bytecode.use_reflection_optimizer}</prop>
<prop
key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}</prop>
<prop
key="hibernate.cache.provider_class">${hibernate.cache.provider_class}</prop>
<prop
key="hibernate.current_session_context_class">thread</prop>
<prop
key="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</prop>
          </props>
      </property>         </bean>
  <!--
      Instruct Spring to perform declarative
transaction management
automatically
      on annotated classes.
  -->
  <tx:annotation-driven
transaction-manager="transactionManager" />
       <!-- Transaction manager for a single
Hibernate SessionFactory
(alternative to JTA) -->
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory"><ref bean="sessionFactory"/></property>
  </bean>

  <!-- Model Objects -->
  <bean id="user"
class="com.havoc.forum.model.User" />
  <bean id="group"
class="com.havoc.forum.model.Group" />
  <bean id="rank"
class="com.havoc.forum.model.Rank" />
  <!-- Data Access Objects -->
  <bean id="userDAO"
class="com.havoc.forum.dao.hibernate.UserDAO" />
  <bean id="groupDAO"
class="com.havoc.forum.dao.hibernate.GroupDAO" />
  <bean id="rankDAO"
class="com.havoc.forum.dao.hibernate.RankDAO" />
    <!-- Actions -->
  <bean id="userAction"
class="com.havoc.forum.action.UserAction"
scope="prototype" />
 </beans>

UserAction

public class UserAction extends ActionSupport {
=== message truncated ===



____________________________________________________________________________________ We won't tell. Get more on shows you hate to love (and love to hate): Yahoo! TV's Guilty Pleasures list. http://tv.yahoo.com/collections/265
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to