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:09:42 UTC
[jira] Created: (WW-3164) Using Struts 2.1.6 Portlet Plugin Causes
NullPointerException When Executing A Normal Struts 2 Action
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
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.
[jira] Commented: (WW-3164) Using Struts 2.1.6 Portlet Plugin
Causes NullPointerException When Executing A Normal Struts 2 Action
Posted by "Bruce Phillips (JIRA)" <ji...@apache.org>.
[ 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.
[jira] Resolved: (WW-3164) Using Struts 2.1.6 Portlet Plugin Causes
NullPointerException When Executing A Normal Struts 2 Action
Posted by "Nils-Helge Garli (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-3164?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nils-Helge Garli resolved WW-3164.
----------------------------------
Resolution: Fixed
Fix Version/s: 2.1.8
Assignee: Nils-Helge Garli
Fixed in trunk. You can fetch the source and test it. I did encounter some other issues with your sample app, but it should not be related to the original issue.
> 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
> Assignee: Nils-Helge Garli
> Fix For: 2.1.8
>
> Attachments: Struts2PortletExample.zip, StrutsExample.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.
[jira] Commented: (WW-3164) Using Struts 2.1.6 Portlet Plugin
Causes NullPointerException When Executing A Normal Struts 2 Action
Posted by "Bruce Phillips (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-3164?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46439#action_46439 ]
Bruce Phillips commented on WW-3164:
------------------------------------
I added to the Jira bug report another example application that demonstrates the problem. The StrutsExample application is a simple Struts 2 (using 2.1.6) application that has both normal actions and Portlet actions.
You can also download this example application (an archive of an Eclipse Dynamic Web Project that uses Maven) at http://www.brucephillips.name/struts/StrutsExample.zip.
Unzip the example application and the open a command window. Navigate to where you unzipped the application.
Run "mvn clean" at the command prompt
Run "mvn jetty:run" at the command prompt
When you see the message [INFO] Started Jetty Server open your web browser and navigate to
http://localhost:8080/StrutsExample/index.jsp
Click on link for normal Struts 2 action and you should see "Hello from Struts 2"
Click on link for Hello from portlet action and you should see "Hello from Struts 2"
Click on link for Run Run a normal Struts 2 action that loads a JSP with a search form built using s:form tag and you'll get the exception discussed earlier.
Type control C in the command prompt window to stop Jetty server
Edit the pom.xml file:
Change the Struts 2 to version 2.0.11
Comment out the dependency on struts2-portlet-plugin
Save the pom.xml file
In command window run "mvn clean" and then "mvn jetty:run"
When you see the message [INFO] Started Jetty Server open your web browser and navigate to
http://localhost:8080/StrutsExample/index.jsp
Click on link for normal Struts 2 action and you should see "Hello from Struts 2"
Click on link for Hello from portlet action and you should see "Hello from Struts 2"
Click on link for Run Run a normal Struts 2 action that loads a JSP with a search form built using s:form tag and you'll see the simple search form built using the s:form tag
Click on the link Click here to start the search form example as a portlet and you'll also see the simple search form
It seems that the s:form tag is causing a problem when using the struts2-portlet-plugin version 2.1.6 with struts 2 core version 2.1.6.
We hope this is fixed in the upcoming release of version 2.1.7 as we would like to use the current release of Struts 2 to build web applications that can be used as standalone applications and as portlet within a portlet container.
> 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.
[jira] Updated: (WW-3164) Using Struts 2.1.6 Portlet Plugin Causes
NullPointerException When Executing A Normal Struts 2 Action
Posted by "Bruce Phillips (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-3164?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bruce Phillips updated WW-3164:
-------------------------------
Attachment: StrutsExample.zip
> 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, StrutsExample.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.
[jira] Updated: (WW-3164) Using Struts 2.1.6 Portlet Plugin Causes
NullPointerException When Executing A Normal Struts 2 Action
Posted by "Bruce Phillips (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-3164?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bruce Phillips updated WW-3164:
-------------------------------
Attachment: Struts2PortletExample.zip
Unzip the attached project
In command window go to where you unzipped the project
execute mvn clean
execute mvn jetty:run
in web browser go to http://localhost:8080/StrutsPortletExample/index.html
Click on Add New Employee link
See rest of instructions for duplicating the error in main comment
> 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.