Hi, First touch with WebWork2. The ActionProxy is a good stuff for unit testing. However, I got the above error when run a simple action.
What is wrong? Jirong ---error ---- java.lang.NullPointerException at com.opensymphony.webwork.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:52) at com.opensymphony.webwork.dispatcher.WebWorkResultSupport.execute(WebWorkResultSupport.java:53) at com.opensymphony.xwork.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:269) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:191) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:37) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:169) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:37) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:169) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:37) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:169) at com.opensymphony.xwork.interceptor.TimerInterceptor.intercept(TimerInterceptor.java:66) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:169) at com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:116) at acl.web.test.TestUserAction.testFindUser(TestUserAction.java:53) at acl.web.test.TestUserAction.main(TestUserAction.java:28) ----xwork.xml ---- <action name="findUserAction" class="acl.web.UserAction" method="findUser"> <result name="success" type="dispatcher"> <param name="location">/test.jsp</param> </result> <interceptor-ref name="defaultStack"/> </action> ------- Action class ------------- public String execute() throws Exception { return Action.SUCCESS; } public String findUser() throws Exception { String method = "UserAction::findUser(): "; System.out.println(method + "ENTRY"); ACAdminBD acAdminBD = new ACAdminBD(); HashMap user = acAdminBD.findUser("AdminUser"); //System.out.println(method + "UserID:" + user.get("ID") + " GroupID:" + user.get("GROUPS")); userId = (String) user.get("ID"); // ArrayList groups = (ArrayList) user.get("GROUPS"); System.out.println(method + "userId:" + userId); System.out.println(method + "EXIT"); return Action.SUCCESS; } ----- JUnit test case ----- public void testFindUser() throws Exception { String method = "TestUserActioni::testFindUser(): "; System.out.println(method + "ENTRY"); ActionProxyFactory factory = ActionProxyFactory.getFactory(); ActionProxy proxy = factory.createActionProxy("", "findUserAction", null); if (proxy != null) System.out.println(method + "proxy is NOT null"); System.out.println(proxy.execute()); UserAction userAction = (UserAction) proxy.getAction(); System.out.println(method + "UserId: " + userAction.getUserId()); System.out.println(method + "EXIT"); __________________________________ Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing. http://photos.yahoo.com/ ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork