struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "" <>
Subject Problem With Struts 2.3.1 and Testing Struts Portlet
Date Tue, 27 Dec 2011 16:32:04 GMT
I'm upgrading a Struts 2 portlet application from to 2.3.1.  A test
of my Action class that extends StrutsSpringTestCase that passed when using 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:

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
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

I get the same error if the project is using the Struts Spring plugin or

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.


View this message in context:
Sent from the Struts - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message