配置ssh常见异常

1、在做struts时,出现找不到资源的错误,可能是你新建了struts.xml但没有在web.xml中配置。

2、在配置web.xml时,出现如下异常

javax.servlet.UnavailableException: Missing configuration resource for path /WEB-INF/struts/oa/struts-config-email.xml

配置多个xml时之间要加逗号,如

<!--*********  DAO和Service 层的 spring 文件  *********-->
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>
        <!--此处记得加逗号-->       
        /WEB-INF/spring/oa/email-cfg.xml,
        /WEB-INF/spring/oa/dataelement-cfg.xml
        </param-value>
    </context-param>

 3、异常:org.springframework.beans.NotWritablePropertyException: Invalid property 'dataElementDao' of bean class [com.kinth.oa.dataelement.service.impl.DataElementServiceImpl]: Bean property 'dataElementDao' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter?
原因是没有写setDataElementDao方法。

4、异常:org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named

原因可能是(1)service没注入。(2)注入是写在某个xml中,但没有配置到web.xml中。

5、异常:Property 'target' is required 原因可能是在配置的beang中没有写abstract="true"(

如果你有一个(父)bean定义你希望仅仅作为模版使用,而这个定义说明了一个类,你必须把abstract参数设置为true,否则应用程序上下文将试图预先初始化它。

6、struts2访问action找不到路径报404错 试试在访问的路径上加个.action

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值