java - Disable Spring's implicit method dependency injection -


i'm using struts develop app, , hello world page worked fine until made extend actionsupport access i18n features. upon doing this, action started returning input result string. unexpected there no validation done @ moment. after debugging, noticed spring decided inject field error map, validation sees something, causing unexpected return value.

injection parameter]1

here stack trace:

daemon thread [http-0.0.0.0-8080-2] (suspended (breakpoint @ line 79 in actionsupport))     index(actionsupport).setfielderrors(map<string,list<string>>) line: 79   nativemethodaccessorimpl.invoke0(method, object, object[]) line: not available [native method]   nativemethodaccessorimpl.invoke(object, object[]) line: not available    delegatingmethodaccessorimpl.invoke(object, object[]) line: not available    method.invoke(object, object...) line: not available     beanwrapperimpl.setpropertyvalue(beanwrapperimpl$propertytokenholder, propertyvalue) line: 1134  beanwrapperimpl.setpropertyvalue(propertyvalue) line: 903    beanwrapperimpl(abstractpropertyaccessor).setpropertyvalues(propertyvalues, boolean, boolean) line: 75   beanwrapperimpl(abstractpropertyaccessor).setpropertyvalues(propertyvalues) line: 57     defaultlistablebeanfactory(abstractautowirecapablebeanfactory).applypropertyvalues(string, beandefinition, beanwrapper, propertyvalues) line: 1450   defaultlistablebeanfactory(abstractautowirecapablebeanfactory).populatebean(string, rootbeandefinition, beanwrapper) line: 1158  defaultlistablebeanfactory(abstractautowirecapablebeanfactory).autowirebeanproperties(object, int, boolean) line: 376    strutsspringobjectfactory(springobjectfactory).autowirebean(object, autowirecapablebeanfactory) line: 218    strutsspringobjectfactory(springobjectfactory).buildbean(class, map<string,object>) line: 198    strutsspringobjectfactory(springobjectfactory).buildbean(string, map<string,object>, boolean) line: 164  strutsspringobjectfactory(objectfactory).buildbean(string, map<string,object>) line: 178     defaultactionfactory.buildaction(string, string, actionconfig, map<string,object>) line: 22  strutsspringobjectfactory(objectfactory).buildaction(string, string, actionconfig, map<string,object>) line: 148     defaultactioninvocation.createaction(map<string,object>) line: 295   defaultactioninvocation.init(actionproxy) line: 395  strutsactionproxy(defaultactionproxy).prepare() line: 194    strutsactionproxy.prepare() line: 63     strutsactionproxyfactory.createactionproxy(actioninvocation, string, string, string, boolean, boolean) line: 37  strutsactionproxyfactory(defaultactionproxyfactory).createactionproxy(string, string, string, map<string,object>, boolean, boolean) line: 58     dispatcher.serviceaction(httpservletrequest, httpservletresponse, actionmapping) line: 554   executeoperations.executeaction(httpservletrequest, httpservletresponse, actionmapping) line: 81     strutsprepareandexecutefilter.dofilter(servletrequest, servletresponse, filterchain) line: 99    applicationfilterchain.internaldofilter(servletrequest, servletresponse) line: 235   applicationfilterchain.dofilter(servletrequest, servletresponse) line: 206   opensessioninviewfilter.dofilterinternal(httpservletrequest, httpservletresponse, filterchain) line: 232     opensessioninviewfilter(onceperrequestfilter).dofilter(servletrequest, servletresponse, filterchain) line: 106   applicationfilterchain.internaldofilter(servletrequest, servletresponse) line: 235   applicationfilterchain.dofilter(servletrequest, servletresponse) line: 206   replyheaderfilter.dofilter(servletrequest, servletresponse, filterchain) line: 96    applicationfilterchain.internaldofilter(servletrequest, servletresponse) line: 235   applicationfilterchain.dofilter(servletrequest, servletresponse) line: 206   standardwrappervalve.invoke(request, response) line: 230     standardcontextvalve.invoke(request, response) line: 175     securityassociationvalve.invoke(request, response) line: 182     jacccontextvalve.invoke(request, response) line: 84  standardhostvalve.invoke(request, response) line: 127    errorreportvalve.invoke(request, response) line: 102     cachedconnectionvalve.invoke(request, response) line: 157    standardenginevalve.invoke(request, response) line: 109  coyoteadapter.service(request, response) line: 262   http11processor.process(socket) line: 844    http11protocol$http11connectionhandler.process(socket) line: 583     jioendpoint$worker.run() line: 446   thread.run() line: not available     

this class contains:

public class index extends actionsupport implements useraware {     private user user;       @override     public string execute()     {         system.out.println("this doesn't print out");         return "success";     }      @override     public void setuser(user user)     {         this.user = user;     }      public user getuser()     {         return user;     } } 

i'm using @autowired annotated property injection, i'd disable method injection fix issue. of course if problem. have misinterpreted symptoms.

versions

  • spring 3.2.9
  • struts 2.3.24

struts , spring not go default, need add struts2-spring-plugin-x.y.z.jar in web-inf/lib struts lib directory. , configure in web.xml, refer http://www.tutorialspoint.com/struts_2/struts_spring.htm


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -