You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Bruce Phillips (JIRA)" <ji...@apache.org> on 2009/06/20 14:31:43 UTC
[jira] Commented: (WW-3164) Using Struts 2.1.6 Portlet Plugin
Causes NullPointerException When Executing A Normal Struts 2 Action
[ https://issues.apache.org/struts/browse/WW-3164?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46427#action_46427 ]
Bruce Phillips commented on WW-3164:
------------------------------------
I did some more trouble-shooting and think I may have found what is causing the problem.
I noticed that another person who reported this problem said his action was causing a jsp to render that included the s:form tag.
My application's action that would cause the NullPointerException also was causing a jsp to render that included the s:form tag
I removed the s:form from the jsp and I no longer get the NullPointerException when using the Struts 2.1.6 portlet plugin.
Some of the exception stack trace seems to indicate the problem is with the s:form tag when using the Struts 2.1.6 Portlet Plugin:
java.lang.NullPointerException
org.apache.struts2.components.UIBean.evaluateParams(UIBean.java:792)
org.apache.struts2.components.UIBean.end(UIBean.java:510)
org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)
org.apache.jsp.jsp.employeeForm_jsp._jspx_meth_s_005ftextfield_005f0(employeeForm_jsp.java:424)
org.apache.jsp.jsp.employeeForm_jsp._jspx_meth_s_005fform_005f0(employeeForm_jsp.java:359)
org.apache.jsp.jsp.employeeForm_jsp._jspService(employeeForm_jsp.java:121)
> Using Struts 2.1.6 Portlet Plugin Causes NullPointerException When Executing A Normal Struts 2 Action
> -----------------------------------------------------------------------------------------------------
>
> Key: WW-3164
> URL: https://issues.apache.org/struts/browse/WW-3164
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Portlet
> Affects Versions: 2.1.6
> Environment: Windows XP, JDK 6
> Reporter: Bruce Phillips
> Attachments: Struts2PortletExample.zip
>
>
> Created a Struts 2 web/portlet application with a pom.xml having a dependency on struts2-core-2.0.11.2.jar. Works both as a normal web application and as a portlet application.
> Changed the dependencies to be struts2-core-2.1.6.jar and struts2-portlet-plugin-2.1.6.jar. Running the application as a web application in Tomcat 6 or Jetty results in a org.apache.jasper.JasperException: java.lang.NullPointerException whenever a Struts 2 action is called.
> Removed the dependency on struts2-portlet-plugin-2.1.6.jar and the application runs fine as a normal Struts 2 web application.
> You can download an archived Eclipse dynamic web project that uses maven here:
> http://www.brucephillips.name/struts/struts2portletexample.zip
> 1. Unzip the project
> 2. In a command window navigate to where you unzipped the project
> 3. In the root folder for the project run mvn clean
> 4. Then run mvn jetty:run
> 5. Open your browser and go to http://localhost:8080/StrutsPortletExample/index.html
> 6. click on the link for add new employee
> 7. You'll get a NullPointerException
> 8. Close Jetty by using Control C
> 9. In the pom.xml file for the project comment out the dependency on Struts 2.1.6 Porlet Plugin
> 10. In command window redo mvn clean and then mvn jetty:run
> 11. Open your browser and go to http://localhost:8080/StrutsPortletExample/index.html
> 12. click on the link for add new employee and the Struts 2 action will execute successfully and you'll get the add employee page
> In Struts 2.0.11 we were able to use both Struts 2 actions and a Struts 2 portlet in the same web application. Trying to use the new Struts 2.1.6 Portlet Plugin causes an exception when user clicks on a normal struts 2 action link.
> Here is the first part of the Exception stack trace as reported by Struts 2:
> Struts Problem Report
> Struts has detected an unhandled exception:
> # Messages: java.lang.NullPointerException
> File: org/apache/struts2/components/UIBean.java
> Line number: 792
> Stacktraces
> org.apache.jasper.JasperException: java.lang.NullPointerException
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:418)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:486)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:380)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:389)
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417)
> org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:334)
> org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
> org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:154)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.