qq_22939371 2015-05-07 12:29 采纳率: 0%
浏览 1947
已结题

SSH整合问题Unable to instantiate Action

问题:Unable to instantiate Action, userAction, defined for 'user-userLogin' in namespace ''userAction
不知道哪里问题,网上的方法试了好多遍,都没解决,客户端只能停留在登录界面,无法登录成功,无法访问服务器,求大神指教
Struts.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">







</package>

beans.xml
<?xml version="1.0" encoding="UTF-8"?>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
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.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd">
context:annotation-config/

<property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
<property name="url" value="jdbc:sqlserver://localhost:1433;DatabaseName=intelligent_tutoring"/>
<property name="username" value="sa"/>
<property name="password" value="1234"/>





com.it.bean





org.hibernate.dialect.SQLServer2008Dialect

true
none
update



class="org.springframework.orm.hibernate3.HibernateTransactionManager">


class="org.springframework.orm.hibernate3.HibernateTemplate">


tx:attributes
<!-- -->

/tx:attributes
/tx:advice
aop:config


/aop:config

  • 写回答

2条回答

  • 夜独醉╋心碎 2015-05-14 07:38
    关注

    <?xml version="1.0" encoding="UTF-8"?>
    xmlns="http://www.springframework.org/schema/beans"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:p="http://www.springframework.org/schema/p"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context-2.5.xsd
    http://www.springframework.org/schema/aop
    http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
    http://www.springframework.org/schema/tx
    http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">

     <!-- 定义组件扫描的基本包 -->                   
    <context:component-scan base-package="com.*.service,com.base,com.system.dao"></context:component-scan>                 
    
     <!--  数据源 -->                  
    <bean id="dataSource"
        class="org.springframework.jdbc.datasource.DriverManagerDataSource">
        <property name="driverClassName"
            value="oracle.jdbc.driver.OracleDriver">
        </property>
        <property name="url"
            value="jdbc:oracle:thin:@10.0.4.58:1521:orcl">
        </property>
        <property name="username" value="scott"></property>
        <property name="password" value="tiger"></property>
    </bean>  
    <!-- sessionFactory -->                
    <bean id="sessionFactory"
        class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
        <property name="dataSource">
            <ref bean="dataSource"/>
        </property>
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.dialect">
                    org.hibernate.dialect.Oracle9Dialect
                </prop>
                <prop key="hibernate.show_sql">true</prop>
            </props>
        </property>
    
        <property name="annotatedClasses">
            <list>
                <value>com.model.Mapmark</value>
                <value>com.model.Maplist</value>
                <value>com.model.Mapxzqh</value>
    
            </list>
        </property>
    </bean>
    
    <!-- 事务管理器   -->
    <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
        <property name="sessionFactory">
            <ref bean="sessionFactory"/>
        </property>
    </bean>
    <tx:annotation-driven/>
    </beans>
    

    这个 是我 的页面,而且 这个 配置 我是写在 spring.xml里的

    下面这个页面是struts.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN"
    "http://struts.apache.org/dtds/struts-2.1.dtd">

    <!--定义全局package -->




    <!--把自己的拦截器添加到定义的拦截器栈里面-->


    <!--定义自己的拦截器-->
    class="com.base.interceptor.InvocationHandler" />

    <!--调用拦截器-->

    </package>
    

    如果 帮你解决问题 请采纳 谢谢

    评论

报告相同问题?

悬赏问题

  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
  • ¥50 成都蓉城足球俱乐部小程序抢票
  • ¥15 yolov7训练自己的数据集
  • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
  • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
  • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)