Reputation: 549
I am new to maven. When I try to build my project which has spring injection, im getting the following error:
Rule:InstanceVariableThreadSafety Priority:1 A class extending RequestHandler
or Action or SessionBean contains instance variables. It may not be Threadsafe.
The code should be reviewed and validated by the application team Tech Lead..
Please help me to resolve this.
Thanks.
Upvotes: 0
Views: 187
Reputation: 9141
This rule is a customized one, probably written by the "tech lead" to prevent you from adding instances variables into singleton classes such as Struts 1 Actions, EJB Statless SessionBean, and (Tapestry ?) RequestHandler.
If you're injecting a service into an action, you're right and your tech lead should refine his rule. There may be some way to add service dependencies which do not fire the rule though, only the tech lead will now this (and the developpment guide if you have one...)
Upvotes: 1