给大家提供两个SSH项目配置过程中出现的问题以及他们对应的解决方案希望对大家有帮助
无法初始化Action
Unable to instantiate Action, userAction, defined for 'userAction_login' in namespace '/'Error creating bean with name 'userAction': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.itheima.bos.service.IUserService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(shareable=true, mappedName=, description=, name=, type=class java.lang.Object, authenticationType=CONTAINER)}
这个错误的起因是Service没有配置好或者配置错误,请仔细观察自己的Service配置。如果是注解配置方式,请观察自己是否错写了@Service配置
找不到staffAction_Login.Action
这个主要是因为后缀名的原因。不要将后缀名写成大写。应该是staffAction._Login.action
Could not execute JDBC batch update
这种错误多半是自己的hbm文件写得有问题。。仔细检查hbm文件与类文件和数据库之间的对应关系。。找到错误并修改
网友评论