问答详情
源自:4-4 Action类交给Spring创建-Struts2整合Spring

报500错误

我的action无论交给spring处理还是交给struts处理 都是500错误。而且提示信息都是

HTTP Status 500 - Unable to instantiate Action, productAction, defined for 'product_save' in namespace '/'Error creating bean with name 'productAction' defined in URL [file:/D:/tts9/apache-tomcat-7.0.67/wtpwebapps/ssh/WEB-INF/classes/applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'productService' of bean class [cn.muke.ssh.service.ProductService]: Bean property 'productService' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?

查了下 ,大概意思就是namespace="/"路径下找不到对应的action,可是我都配置了,心累



提问者:Tarotnineteen 2017-11-27 11:43

个回答

  • qq_满天星_19
    2018-02-28 13:32:41

    class中应该是 cn.muke.ssh.action.ProductAction

    题外话:我的跳转addProduct.jsp页面也报错500,空指针异常???

  • Tarotnineteen
    2017-11-27 11:46:31

    http://img3.mukewang.com/5a1b8a7c0001342108170261.jpg补充下  这是我的applicationContext