Return-Path: X-Original-To: apmail-struts-user-archive@www.apache.org Delivered-To: apmail-struts-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 288E47766 for ; Tue, 27 Dec 2011 16:32:35 +0000 (UTC) Received: (qmail 26526 invoked by uid 500); 27 Dec 2011 16:32:32 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 26487 invoked by uid 500); 27 Dec 2011 16:32:32 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 26479 invoked by uid 99); 27 Dec 2011 16:32:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Dec 2011 16:32:32 +0000 X-ASF-Spam-Status: No, hits=2.3 required=5.0 tests=SPF_SOFTFAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: softfail (nike.apache.org: transitioning domain of bphillips@ku.edu does not designate 216.139.236.26 as permitted sender) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Dec 2011 16:32:26 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1RfZwa-0007Jv-W8 for user@struts.apache.org; Tue, 27 Dec 2011 08:32:04 -0800 Date: Tue, 27 Dec 2011 08:32:04 -0800 (PST) From: "bphillips@ku.edu" To: user@struts.apache.org Message-ID: <1325003524973-5103393.post@n5.nabble.com> Subject: Problem With Struts 2.3.1 and Testing Struts Portlet MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org I'm upgrading a Struts 2 portlet application from 2.2.3.1 to 2.3.1. A test of my Action class that extends StrutsSpringTestCase that passed when using 2.2.3.1 now fails when using version 2.3.1. I've created a simple Struts 2 portlet example application to demonstrate the issue. You can download the zipped example here: http://www.brucephillips.name/struts/struts2helloworldportlet.zip Unzip the download. In a terminal window navigate to the project's root folder. run mvn clean test The test will pass. Open the pom.xml and change the struts.version property to 2.3.1 and save your change run mvn clean test The test will now fail. Here is part of the error message in the test report: Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.314 sec <<< FAILURE! testExecute(com.struts2.tutorial.action.DefaultActionTest) Time elapsed: 1.252 sec <<< ERROR! Error creating bean with name 'org.apache.struts2.portlet.result.PortletResult': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.apache.struts2.portlet.result.PortletResult]: Constructor threw exception; nested exception is java.lang.NullPointerException - action - file:/Users/bphillips/eclipse_workspaces/kucard/Struts2HelloWorldPortlet/target/classes/struts.xml:11:74 at com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionInvocation.java:224) I get the same error if the project is using the Struts Spring plugin or not. I think the error is in the Struts unit testing framework as I can still run the project successfully. For example after updating the struts.version in pom.xml enter this command in the terminal window: mvn jetty:run When you see the message [INFO] Started Jetty Server go to this URL in your web browser: http://localhost:8080/struts2helloworldportlet/pluto/index.jsp and you should see the example portlet. Bruce -- View this message in context: http://struts.1045723.n5.nabble.com/Problem-With-Struts-2-3-1-and-Testing-Struts-Portlet-tp5103393p5103393.html Sent from the Struts - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org