程序采用struts1+spring2.5+ibatis架构
就实现一个简单的用户登录功能
启动Tomcat老实提示找不到LoginAction类
求解
struts.xml中相关配置:
    <action path="/loginAction" type="org.springframework.web.struts.DelegatingActionProxy" validate="true" scope="request">
      <forward name="success" path="/loginsucc.jsp" />
      <forward name="fail" path="/fail.jsp" />
    </action>spring的配置文件applicationContext.xml中相关配置:
<bean name="/loginAction" class="com.lee.action.LoginAction">
<property name="loginDao">
<ref bean="LoginDAO"/>
</property>
</bean>
启动服务器时后台提示错误:
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.lee.action.LoginAction] for bean with name '/loginAction' defined in ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.lang.ClassNotFoundException: com.lee.action.LoginAction找了好久不知道到底哪里出问题了
求高手指点

解决方案 »

  1.   

    看配置文件,应是STRUTS2才对,不是STRUTS1吧。
      

  2.   

    就是struts1呀
    就算是struts2
    你说该怎么解决呢?
      

  3.   

    applicationContext.xml放到类路径下,或者
    <bean name="/loginAction" class="com.lee.action.LoginAction">
    <property name="loginDao">
    <ref bean="LoginDAO"/>
    </property>
    </bean>
    红字写完整路径
      

  4.   

    师傅帮我改成
    <bean name="/loginAction" class="com.lee.action.LoginAciton">
    <property name="loginDao">
    <ref bean="loginDAO"/>
    </property>
    </bean>
    好吧,我承认,是我的类名写成LoginAciton了...
      

  5.   

    没找到hibernate的配置文件吧,举个例子:
    <list>
      <value>classpath:/com/test/bean/Users.hbm.xml</value> 
    </list>
    试试
    还有,我没有看到applicationContext里配没配dataSource,因为你引用了,所以需要配置这个对象。
      

  6.   

    没找到hibernate的配置文件吧,举个例子:
    <list>
      <value>classpath:/com/test/bean/Users.hbm.xml</value> 
    </list>
    试试
    还有,我没有看到applicationContext里配没配dataSource,因为你引用了,所以需要配置这个对象。