Hi there, after a form is sent to a DispatchAction (which should works as CRUD) returns me the following error:
09:45:28,474 ERROR [RequestProcessor] No action instance for path /userManagement could be created java.lang.NullPointerException at xx.xxxxxxx.struts.action.user.UserDispatchAction.<init>(UserDispatchAction.java:54) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
and the class
from the logger I can see that the UserService is correctly instancied but the code doesn't get to the [create] start! line. It seems that this error could be related to different reasons, but the majority complains that the class doesn't extends the Action.
DispatchAction extends Action... so what's the problem?
As I look at the error message you're getting, it appears that your UserDispatchAction class may be throwing a NPE in the constructor. The message tells you what line number the error is on: 54. Look at line 54 of your UserDispatchAction class and try to determine why some object being dereferenced is null when you're not expecting it to be.
It seems to me that the most likely possibility is that the servlet variable is null. This variable is declared by the superclass, but I'm wondering if you override it or set it to null in your class. A safer way of coding it would be: