Struts2 +Spring 3.0+hibernate 3.3 注解异常.expected at least 1 bean which qualifies as autowir我用注解来实现的SSH,用@Entity 来标示实体bean,用 来让Spring 来注入,可以在service里面用@Autowired\x05\x05@Qualifier("taUser")\x0

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/28 20:14:46
Struts2 +Spring 3.0+hibernate 3.3 注解异常.expected at least 1 bean which qualifies as autowir我用注解来实现的SSH,用@Entity 来标示实体bean,用 来让Spring 来注入,可以在service里面用@Autowired\x05\x05@Qualifier(
xV[OG+#78 8&H%Rð;KֻVT$6Pcd'ťRCgv'Bn DT"ckf;ߜ364u4. IM1ԏ/^HKTWIa׏ZXFH0%4J&ӒF,"K)e,}/r?|YzL~аbJfȩ:/@n?NvԢ*u@ _M]P}!Pz_H r!8wk>~n;,Wf\n~ q}B96~wf%V܈[vcwf,/v5~SZΞ4ŰVgm:j r!VY;`@8Y_-f*$8)JTP3$x;)Sb$=(lcRH( ú:__P82N%RSo*THVH2!@5D2a:CIU9 ggb ՒEf/(:x80q_duDE{Gd4K+gT8 cpЦ{KMZBC [:2=j33QɨְAzfx/)"J"oNLCJ.7NP>޳b&D:AdrTld3ZZUx; Y%~(;4PIJd/]; 3_IĴ/ݮh묖Xl/FQVu*`Feڏ!f 1{/j>S2L+3ݙR?iQ<U_ݢݬO1E`pu o^.vVrLOAk)P1:́ d$4`:Ply O3ٙzam.V!d+Yqo C

Struts2 +Spring 3.0+hibernate 3.3 注解异常.expected at least 1 bean which qualifies as autowir我用注解来实现的SSH,用@Entity 来标示实体bean,用 来让Spring 来注入,可以在service里面用@Autowired\x05\x05@Qualifier("taUser")\x0
Struts2 +Spring 3.0+hibernate 3.3 注解异常.expected at least 1 bean which qualifies as autowir
我用注解来实现的SSH,用@Entity 来标示实体bean,用 来让Spring 来注入,可以在service里面用@Autowired\x05
\x05@Qualifier("taUser")
\x05TaUser taUser;
来使用这个实体bean的时候就报下面这个错,说找不到,貌似Spring没注入耶.再次万谢各位帮忙解决下(据说是 3.0和3.3 jar 冲突,但是我不知道那个有冲突啊).
Unable to instantiate Action,com.ta.action.UserCreateAction,defined for 'user-create' in namespace '/'Error creating bean with name 'com.ta.action.UserCreateAction':Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException:Could not autowire field:com.ta.service.UserServices com.ta.action.UserCreateAction.userServices; nested exception is org.springframework.beans.factory.BeanCreationException:Error creating bean with name 'userServicesImpl':Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException:Could not autowire field:com.ta.entity.model.TaUser com.ta.service.impl.UserServicesImpl.taUser; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException:No matching bean of type [com.ta.entity.model.TaUser] found for dependency:expected at least 1 bean which qualifies as autowire candidate for this dependency.Dependency annotations:{@org.springframework.beans.factory.annotation.Autowired(required=true),@org.springframework.beans.factory.annotation.Qualifier(value=taUser)}
\x05com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:318)
\x05com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:399)

Struts2 +Spring 3.0+hibernate 3.3 注解异常.expected at least 1 bean which qualifies as autowir我用注解来实现的SSH,用@Entity 来标示实体bean,用 来让Spring 来注入,可以在service里面用@Autowired\x05\x05@Qualifier("taUser")\x0
你这种写法,Spring根本就不知道你要注入那个实体,再说了,你也没有使用自动装配,要是你是Spring的话,你知道别人想要你注入什么东西?

多写几个属性:





收起