I had a custom interceptor in hand and I want it to be associated to an Action class using annotation. I had added interceptor-ref using the one declared in struts.xml but am ge
I do not have much exp using annotation with or without struts2 but i believe you are using convention-plugin.Here is a quick shot of what they saying about your problem.
If you get errors like "Unable to find interceptor class referenced by ref-name XYZ". This means that the package where Convention is placing your actions, does not extend the package where the interceptor is defined. To fix this problem either
- Use @ParentPackage annotation(or struts.convention.default.parent.package) passing the name of the package that defines the interceptor.
- Create a package in XML that extends the package that defines the interceptor, and use @ParentPackage(or Struts.convention.default.parent.package) to point to it.
For more details refer there documentation
convention-plugin