You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Cyril Gambis (JIRA)" <ji...@apache.org> on 2007/06/06 09:34:27 UTC

[jira] Created: (WW-1969) Error in TagUtils (NullPointerException) when viewing a page which didn't go through Struts 2 interceptor stack

Error in TagUtils (NullPointerException) when viewing a page which didn't go through Struts 2 interceptor stack
---------------------------------------------------------------------------------------------------------------

                 Key: WW-1969
                 URL: https://issues.apache.org/struts/browse/WW-1969
             Project: Struts 2
          Issue Type: Bug
          Components: Views
    Affects Versions: 2.0.6
         Environment: Tomcat 4.1
Java 1.4
Struts 2 - Java 1.4 retrotranslated version
            Reporter: Cyril Gambis
            Priority: Critical


I searched for that item and havn't find anything in JIRA. I think there may be a patch because it is quite a serious issue and it is a regression from Struts 2.0.5 as I read on some forum.

With this bug, some HelloWorld tutorials don't work anymore.

The stack trace is:

Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrappe r.java:467)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


root cause

java.lang.NullPointerException
org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:58)
org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport .java:54)
org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport .java:49)
org.apache.jsp.WebContent.index_jsp._jspx_meth_s_005fhead_005f0(index_jsp.java: 155)
org.apache.jsp.WebContent.index_jsp._jspService(index_jsp.java:77)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803) 

I understand that if you access directly a jsp page containing a tag like s:text, s:a or s:url, which usually won't need for a value stack. A solution may be to have everything go through the struts 2 interceptor stack, but believe me, for legacy application it is sometimes not easy at all (one of my developer has work on this problem for 2 days, currently).

Is there any patch, anywhere? Especially for the Java 1.4 version or Struts 2?

Some links:
http://forums.opensymphony.com/thread.jspa?messageID=155149&#155149
http://www.mail-archive.com/user@struts.apache.org/msg57582.html


Thanks!
Cyril Gambis

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-1969) Error in TagUtils (NullPointerException) when viewing a page which didn't go through Struts 2 interceptor stack

Posted by "Dave Newton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-1969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43369#action_43369 ] 

Dave Newton commented on WW-1969:
---------------------------------

I don't have much sympathy for anyone expecting S2 tags to work without passing through the filter, but I'm mean.

If there's a simplistic way to create a meaningful error message I'm all for it (it didn't seem like this patch does it but I'm not on my dev machine, so who knows) but I'd consider closing this issue and creating a linked atch-all for S2 tags when no value stack is available.

> Error in TagUtils (NullPointerException) when viewing a page which didn't go through Struts 2 interceptor stack
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-1969
>                 URL: https://issues.apache.org/struts/browse/WW-1969
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Plugin - Tags
>    Affects Versions: 2.0.9
>         Environment: Tomcat 4.1
> Java 1.4
> Struts 2 - Java 1.4 retrotranslated version
>            Reporter: Cyril Gambis
>            Priority: Critical
>             Fix For: Future
>
>         Attachments: WW-1969.patch
>
>
> I searched for that item and havn't find anything in JIRA. I think there may be a patch because it is quite a serious issue and it is a regression from Struts 2.0.5 as I read on some forum.
> With this bug, some HelloWorld tutorials don't work anymore.
> The stack trace is:
> Stacktrace:
> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrappe r.java:467)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> root cause
> java.lang.NullPointerException
> org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:58)
> org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport .java:54)
> org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport .java:49)
> org.apache.jsp.WebContent.index_jsp._jspx_meth_s_005fhead_005f0(index_jsp.java: 155)
> org.apache.jsp.WebContent.index_jsp._jspService(index_jsp.java:77)
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803) 
> I understand that if you access directly a jsp page containing a tag like s:text, s:a or s:url, which usually won't need for a value stack. A solution may be to have everything go through the struts 2 interceptor stack, but believe me, for legacy application it is sometimes not easy at all (one of my developer has work on this problem for 2 days, currently).
> Is there any patch, anywhere? Especially for the Java 1.4 version or Struts 2?
> Some links:
> http://forums.opensymphony.com/thread.jspa?messageID=155149&#155149
> http://www.mail-archive.com/user@struts.apache.org/msg57582.html
> Thanks!
> Cyril Gambis

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WW-1969) Error in TagUtils (NullPointerException) when viewing a page which didn't go through Struts 2 interceptor stack

Posted by "Don Brown (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-1969?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Don Brown updated WW-1969:
--------------------------

    Issue Type: Improvement  (was: Bug)

> Error in TagUtils (NullPointerException) when viewing a page which didn't go through Struts 2 interceptor stack
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-1969
>                 URL: https://issues.apache.org/struts/browse/WW-1969
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Views
>    Affects Versions: 2.0.6
>         Environment: Tomcat 4.1
> Java 1.4
> Struts 2 - Java 1.4 retrotranslated version
>            Reporter: Cyril Gambis
>            Priority: Critical
>             Fix For: Future
>
>
> I searched for that item and havn't find anything in JIRA. I think there may be a patch because it is quite a serious issue and it is a regression from Struts 2.0.5 as I read on some forum.
> With this bug, some HelloWorld tutorials don't work anymore.
> The stack trace is:
> Stacktrace:
> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrappe r.java:467)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> root cause
> java.lang.NullPointerException
> org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:58)
> org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport .java:54)
> org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport .java:49)
> org.apache.jsp.WebContent.index_jsp._jspx_meth_s_005fhead_005f0(index_jsp.java: 155)
> org.apache.jsp.WebContent.index_jsp._jspService(index_jsp.java:77)
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803) 
> I understand that if you access directly a jsp page containing a tag like s:text, s:a or s:url, which usually won't need for a value stack. A solution may be to have everything go through the struts 2 interceptor stack, but believe me, for legacy application it is sometimes not easy at all (one of my developer has work on this problem for 2 days, currently).
> Is there any patch, anywhere? Especially for the Java 1.4 version or Struts 2?
> Some links:
> http://forums.opensymphony.com/thread.jspa?messageID=155149&#155149
> http://www.mail-archive.com/user@struts.apache.org/msg57582.html
> Thanks!
> Cyril Gambis

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WW-1969) Error in TagUtils (NullPointerException) when viewing a page which didn't go through Struts 2 interceptor stack

Posted by "Wes Wannemacher (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-1969?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Wes Wannemacher resolved WW-1969.
---------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: Future)
                   2.1.1
         Assignee: Wes Wannemacher

As discussed in the comments, the NPE is fixed, but the tags remain unavailable without the Struts2 filter.

> Error in TagUtils (NullPointerException) when viewing a page which didn't go through Struts 2 interceptor stack
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-1969
>                 URL: https://issues.apache.org/struts/browse/WW-1969
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Plugin - Tags
>    Affects Versions: 2.0.9
>         Environment: Tomcat 4.1
> Java 1.4
> Struts 2 - Java 1.4 retrotranslated version
>            Reporter: Cyril Gambis
>            Assignee: Wes Wannemacher
>            Priority: Critical
>             Fix For: 2.1.1
>
>         Attachments: WW-1969.patch
>
>
> I searched for that item and havn't find anything in JIRA. I think there may be a patch because it is quite a serious issue and it is a regression from Struts 2.0.5 as I read on some forum.
> With this bug, some HelloWorld tutorials don't work anymore.
> The stack trace is:
> Stacktrace:
> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrappe r.java:467)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> root cause
> java.lang.NullPointerException
> org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:58)
> org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport .java:54)
> org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport .java:49)
> org.apache.jsp.WebContent.index_jsp._jspx_meth_s_005fhead_005f0(index_jsp.java: 155)
> org.apache.jsp.WebContent.index_jsp._jspService(index_jsp.java:77)
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803) 
> I understand that if you access directly a jsp page containing a tag like s:text, s:a or s:url, which usually won't need for a value stack. A solution may be to have everything go through the struts 2 interceptor stack, but believe me, for legacy application it is sometimes not easy at all (one of my developer has work on this problem for 2 days, currently).
> Is there any patch, anywhere? Especially for the Java 1.4 version or Struts 2?
> Some links:
> http://forums.opensymphony.com/thread.jspa?messageID=155149&#155149
> http://www.mail-archive.com/user@struts.apache.org/msg57582.html
> Thanks!
> Cyril Gambis

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-1969) Error in TagUtils (NullPointerException) when viewing a page which didn't go through Struts 2 interceptor stack

Posted by "Borys Marcelo Borches Herrera (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-1969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_42144 ] 

Borys Marcelo Borches Herrera commented on WW-1969:
---------------------------------------------------

I'm having the same problem here. I'm trying to use a simple page as a helloworld to test Struts2 Ajax tag. But, as you can see this issue isn't making it possible. I'm deploying my app into a test Websphere 6.1 TestEnvironment  built in on RAD 7. My Web.xml looks like this:

<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Struts_Course</display-name>

    <filter>
    <filter-name>struts-cleanup</filter-name>
    <filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class>
</filter>
<filter>
    <filter-name>struts</filter-name>
    <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>

<filter-mapping>
    <filter-name>struts-cleanup</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
    <filter-name>struts</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>


    <listener>
    	<description>
    	</description>
    	<display-name>
    	SpringContextLoader</display-name>
    	<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <servlet>
    	<description>
    	Configures main application</description>
    	<display-name>
    	Configurator</display-name>
    	<servlet-name>Configurator</servlet-name>
    	<servlet-class>
    	com.ibm.learning.struts2.webclient.view.configuration.Configurator</servlet-class>
    	<load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    	<servlet-name>Configurator</servlet-name>
    	<url-pattern>/Configurator</url-pattern>
    </servlet-mapping>

    <welcome-file-list>
    	<welcome-file>welcome.jsp</welcome-file>
    </welcome-file-list>
</web-app>

the welcome page file is set to "welcome.jsp" just as a lot of applications does... but while trying to access the application root http://localhost:9080/Struts_Course/, which it is supposed to forward the request to the welcome.jsp, it gives me a 500 error:

Error 500:


and the following stack trace:

9/5/07 11:52:06:081 BRT] 00000028 ServletWrappe I   SRVE0242I: [Struts_start] [/Struts_Course] [FilterProxyServlet]: Initialization successful.
[9/5/07 11:52:06:352 BRT] 00000028 SystemOut     O 2007-09-05 11:52:06,342 DEBUG (org.apache.struts2.dispatcher.ActionContextCleanUp:122) - skipping cleanup counter=1
[9/5/07 11:52:06:502 BRT] 00000028 ServletWrappe I   SRVE0242I: [Struts_start] [/Struts_Course] [/welcome.jsp]: Initialization successful.
[9/5/07 11:52:06:842 BRT] 00000028 ServletWrappe E   SRVE0068E: Uncaught exception thrown in one of the service methods of the servlet: /welcome.jsp. Exception thrown : java.lang.NullPointerException
	at org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:58)
	at org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport.java:52)
	at org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:49)
	at com.ibm._jsp._welcome._jspx_meth_s_head_0(_welcome.java:121)
	at com.ibm._jsp._welcome._jspService(_welcome.java:77)
	at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:85)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:989)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:930)
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:118)
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
	at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:761)
	at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:673)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:498)
	at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:464)
	at com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:122)
	at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:205)
	at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionProcessor.handleRequest(AbstractJSPExtensionProcessor.java:277)
	at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:321)
	at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:555)
	at com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:113)
	at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3252)
	at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:264)
	at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
	at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)
	at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:112)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:454)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:383)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:263)
	at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
	at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
	at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
	at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
	at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
	at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
	at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
	at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
	at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)

here is the welcome.jsp code: 

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>

<html>
<head>

    <title>Welcome</title>
    <s:head theme="ajax" />
    <link href="<s:url value="/theme/Master.css"/>" rel="stylesheet"
          type="text/css"/>
          
        
          
          
</head>

<s:url id="newUserForm" action="NewUserFormPage" method="generateForm" /> 


<body>


  <script language="Javascript">
          
          function escutaTopico(data, type, e){
            alert('inside a topic event. type='+type + ' data: ' + data);
         //data : text returned
         //type : "before", "load" or "error"
         //e    : request object
         }
          
          dojo.event.topic.subscribe("/after", escutaTopico);
          
          
          
          </script>
<h3>Testing some links to other actions:</h3>
<table>
<tr>
<td>

    <s:a id="registerUserLink" 
     theme="ajax" 
     href="%{newUserForm}" 
     targets="mainContent" notifyTopics="/after" 
     indicator="indicator"> Register</s:a>
     
     <img id="indicator" src="${pageContext.request.contextPath}/pages/images/indicator.gif" alt="Loading..." style="display:none"/>
     
    </td></tr>
    <tr>
    <td>
    
    <div id="mainContent"> Initial content </div>
    
    </td></tr>
    <tr>
    <td>
    <a href="<s:url action="Logon"/>">Sign On</a>
    </td>
    </tr>
</table>
</body>
</html>



So setting issue WW-1969 as an Improvement it's a mistake as most applications have calls directly jsp's without going through Struts actions.

> Error in TagUtils (NullPointerException) when viewing a page which didn't go through Struts 2 interceptor stack
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-1969
>                 URL: https://issues.apache.org/struts/browse/WW-1969
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Views
>    Affects Versions: 2.0.6
>         Environment: Tomcat 4.1
> Java 1.4
> Struts 2 - Java 1.4 retrotranslated version
>            Reporter: Cyril Gambis
>            Priority: Critical
>             Fix For: Future
>
>
> I searched for that item and havn't find anything in JIRA. I think there may be a patch because it is quite a serious issue and it is a regression from Struts 2.0.5 as I read on some forum.
> With this bug, some HelloWorld tutorials don't work anymore.
> The stack trace is:
> Stacktrace:
> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrappe r.java:467)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> root cause
> java.lang.NullPointerException
> org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:58)
> org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport .java:54)
> org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport .java:49)
> org.apache.jsp.WebContent.index_jsp._jspx_meth_s_005fhead_005f0(index_jsp.java: 155)
> org.apache.jsp.WebContent.index_jsp._jspService(index_jsp.java:77)
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803) 
> I understand that if you access directly a jsp page containing a tag like s:text, s:a or s:url, which usually won't need for a value stack. A solution may be to have everything go through the struts 2 interceptor stack, but believe me, for legacy application it is sometimes not easy at all (one of my developer has work on this problem for 2 days, currently).
> Is there any patch, anywhere? Especially for the Java 1.4 version or Struts 2?
> Some links:
> http://forums.opensymphony.com/thread.jspa?messageID=155149&#155149
> http://www.mail-archive.com/user@struts.apache.org/msg57582.html
> Thanks!
> Cyril Gambis

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WW-1969) Error in TagUtils (NullPointerException) when viewing a page which didn't go through Struts 2 interceptor stack

Posted by "Ted Husted (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-1969?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ted Husted updated WW-1969:
---------------------------

    Fix Version/s: Future

Setting Fix Version to "future" for issues without a set fix version. 


> Error in TagUtils (NullPointerException) when viewing a page which didn't go through Struts 2 interceptor stack
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-1969
>                 URL: https://issues.apache.org/struts/browse/WW-1969
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Views
>    Affects Versions: 2.0.6
>         Environment: Tomcat 4.1
> Java 1.4
> Struts 2 - Java 1.4 retrotranslated version
>            Reporter: Cyril Gambis
>            Priority: Critical
>             Fix For: Future
>
>
> I searched for that item and havn't find anything in JIRA. I think there may be a patch because it is quite a serious issue and it is a regression from Struts 2.0.5 as I read on some forum.
> With this bug, some HelloWorld tutorials don't work anymore.
> The stack trace is:
> Stacktrace:
> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrappe r.java:467)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> root cause
> java.lang.NullPointerException
> org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:58)
> org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport .java:54)
> org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport .java:49)
> org.apache.jsp.WebContent.index_jsp._jspx_meth_s_005fhead_005f0(index_jsp.java: 155)
> org.apache.jsp.WebContent.index_jsp._jspService(index_jsp.java:77)
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803) 
> I understand that if you access directly a jsp page containing a tag like s:text, s:a or s:url, which usually won't need for a value stack. A solution may be to have everything go through the struts 2 interceptor stack, but believe me, for legacy application it is sometimes not easy at all (one of my developer has work on this problem for 2 days, currently).
> Is there any patch, anywhere? Especially for the Java 1.4 version or Struts 2?
> Some links:
> http://forums.opensymphony.com/thread.jspa?messageID=155149&#155149
> http://www.mail-archive.com/user@struts.apache.org/msg57582.html
> Thanks!
> Cyril Gambis

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-1969) Error in TagUtils (NullPointerException) when viewing a page which didn't go through Struts 2 interceptor stack

Posted by "Wes Wannemacher (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-1969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43370#action_43370 ] 

Wes Wannemacher commented on WW-1969:
-------------------------------------

I am not even near as mean as you Dave ;-)
But, I don't have any sympathy either. How does the old (developers') saying go - There is no such thing as a free lunch.... If you want S2 tags, you need to run the filter.

I verified that the current code will throw an NPE, and also validated that my fix will throw an exception with the reminder that to get the tags to work, you need the filter. My fix doesn't necessarily create a meaningful message, the message was always there, it just would never have been reached. I am going to apply the patch and close the JIRA.

> Error in TagUtils (NullPointerException) when viewing a page which didn't go through Struts 2 interceptor stack
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-1969
>                 URL: https://issues.apache.org/struts/browse/WW-1969
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Plugin - Tags
>    Affects Versions: 2.0.9
>         Environment: Tomcat 4.1
> Java 1.4
> Struts 2 - Java 1.4 retrotranslated version
>            Reporter: Cyril Gambis
>            Priority: Critical
>             Fix For: Future
>
>         Attachments: WW-1969.patch
>
>
> I searched for that item and havn't find anything in JIRA. I think there may be a patch because it is quite a serious issue and it is a regression from Struts 2.0.5 as I read on some forum.
> With this bug, some HelloWorld tutorials don't work anymore.
> The stack trace is:
> Stacktrace:
> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrappe r.java:467)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> root cause
> java.lang.NullPointerException
> org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:58)
> org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport .java:54)
> org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport .java:49)
> org.apache.jsp.WebContent.index_jsp._jspx_meth_s_005fhead_005f0(index_jsp.java: 155)
> org.apache.jsp.WebContent.index_jsp._jspService(index_jsp.java:77)
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803) 
> I understand that if you access directly a jsp page containing a tag like s:text, s:a or s:url, which usually won't need for a value stack. A solution may be to have everything go through the struts 2 interceptor stack, but believe me, for legacy application it is sometimes not easy at all (one of my developer has work on this problem for 2 days, currently).
> Is there any patch, anywhere? Especially for the Java 1.4 version or Struts 2?
> Some links:
> http://forums.opensymphony.com/thread.jspa?messageID=155149&#155149
> http://www.mail-archive.com/user@struts.apache.org/msg57582.html
> Thanks!
> Cyril Gambis

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WW-1969) Error in TagUtils (NullPointerException) when viewing a page which didn't go through Struts 2 interceptor stack

Posted by "Lucian Ochian (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-1969?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lucian Ochian updated WW-1969:
------------------------------

    Affects Version/s:     (was: 2.0.6)
                       2.0.9

I had a similar problem with Struts 2.0.9 and I mapped the Struts filters like that:

<filter-mapping>
        <filter-name>struts-cleanup</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
    </filter-mapping>
    <filter-mapping>
        <filter-name>struts</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
    </filter-mapping>

It seems that adding the <dispacher> for struts filter fixed the issue for me.



> Error in TagUtils (NullPointerException) when viewing a page which didn't go through Struts 2 interceptor stack
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-1969
>                 URL: https://issues.apache.org/struts/browse/WW-1969
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Views
>    Affects Versions: 2.0.9
>         Environment: Tomcat 4.1
> Java 1.4
> Struts 2 - Java 1.4 retrotranslated version
>            Reporter: Cyril Gambis
>            Priority: Critical
>             Fix For: Future
>
>
> I searched for that item and havn't find anything in JIRA. I think there may be a patch because it is quite a serious issue and it is a regression from Struts 2.0.5 as I read on some forum.
> With this bug, some HelloWorld tutorials don't work anymore.
> The stack trace is:
> Stacktrace:
> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrappe r.java:467)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> root cause
> java.lang.NullPointerException
> org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:58)
> org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport .java:54)
> org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport .java:49)
> org.apache.jsp.WebContent.index_jsp._jspx_meth_s_005fhead_005f0(index_jsp.java: 155)
> org.apache.jsp.WebContent.index_jsp._jspService(index_jsp.java:77)
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803) 
> I understand that if you access directly a jsp page containing a tag like s:text, s:a or s:url, which usually won't need for a value stack. A solution may be to have everything go through the struts 2 interceptor stack, but believe me, for legacy application it is sometimes not easy at all (one of my developer has work on this problem for 2 days, currently).
> Is there any patch, anywhere? Especially for the Java 1.4 version or Struts 2?
> Some links:
> http://forums.opensymphony.com/thread.jspa?messageID=155149&#155149
> http://www.mail-archive.com/user@struts.apache.org/msg57582.html
> Thanks!
> Cyril Gambis

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WW-1969) Error in TagUtils (NullPointerException) when viewing a page which didn't go through Struts 2 interceptor stack

Posted by "Wes Wannemacher (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-1969?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Wes Wannemacher updated WW-1969:
--------------------------------

    Attachment: WW-1969.patch

Although I don't think this is a real fix, I did notice that if an instance of Dispatcher is unavailable, there is a potential NPE. It looks like there is a friendly error message attached to the thrown exception when someone is using a tag w/o the filter being applied. But, the friendly message may never be reached because the condition that would cause the exception to be thrown would also cause an NPE before the friendly error could be reached. 

I am not too familiar with TagUtils, so I don't want to commit this without some review. That being said, do we really need to keep this issue open? It seems more like a user error than a bug. 

> Error in TagUtils (NullPointerException) when viewing a page which didn't go through Struts 2 interceptor stack
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-1969
>                 URL: https://issues.apache.org/struts/browse/WW-1969
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Plugin - Tags
>    Affects Versions: 2.0.9
>         Environment: Tomcat 4.1
> Java 1.4
> Struts 2 - Java 1.4 retrotranslated version
>            Reporter: Cyril Gambis
>            Priority: Critical
>             Fix For: Future
>
>         Attachments: WW-1969.patch
>
>
> I searched for that item and havn't find anything in JIRA. I think there may be a patch because it is quite a serious issue and it is a regression from Struts 2.0.5 as I read on some forum.
> With this bug, some HelloWorld tutorials don't work anymore.
> The stack trace is:
> Stacktrace:
> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrappe r.java:467)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> root cause
> java.lang.NullPointerException
> org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:58)
> org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport .java:54)
> org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport .java:49)
> org.apache.jsp.WebContent.index_jsp._jspx_meth_s_005fhead_005f0(index_jsp.java: 155)
> org.apache.jsp.WebContent.index_jsp._jspService(index_jsp.java:77)
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803) 
> I understand that if you access directly a jsp page containing a tag like s:text, s:a or s:url, which usually won't need for a value stack. A solution may be to have everything go through the struts 2 interceptor stack, but believe me, for legacy application it is sometimes not easy at all (one of my developer has work on this problem for 2 days, currently).
> Is there any patch, anywhere? Especially for the Java 1.4 version or Struts 2?
> Some links:
> http://forums.opensymphony.com/thread.jspa?messageID=155149&#155149
> http://www.mail-archive.com/user@struts.apache.org/msg57582.html
> Thanks!
> Cyril Gambis

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-1969) Error in TagUtils (NullPointerException) when viewing a page which didn't go through Struts 2 interceptor stack

Posted by "Don Brown (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-1969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_42118 ] 

Don Brown commented on WW-1969:
-------------------------------

Well, I fixed the NPE so a more informative error message will be shown, but the core issue remains.  The main thing that ties the tags to the dispatcher is getting the value stack, which loads itself with the configured locale.  Technically, each filter could have its own locale setting, so it is needed to properly create the stack.  What if you used the cleanup filter, but not the main filter dispatcher?  Then, the dispatcher would be on the request but it shouldn't interfere with the request processing.

> Error in TagUtils (NullPointerException) when viewing a page which didn't go through Struts 2 interceptor stack
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-1969
>                 URL: https://issues.apache.org/struts/browse/WW-1969
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Views
>    Affects Versions: 2.0.6
>         Environment: Tomcat 4.1
> Java 1.4
> Struts 2 - Java 1.4 retrotranslated version
>            Reporter: Cyril Gambis
>            Priority: Critical
>             Fix For: Future
>
>
> I searched for that item and havn't find anything in JIRA. I think there may be a patch because it is quite a serious issue and it is a regression from Struts 2.0.5 as I read on some forum.
> With this bug, some HelloWorld tutorials don't work anymore.
> The stack trace is:
> Stacktrace:
> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrappe r.java:467)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> root cause
> java.lang.NullPointerException
> org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:58)
> org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport .java:54)
> org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport .java:49)
> org.apache.jsp.WebContent.index_jsp._jspx_meth_s_005fhead_005f0(index_jsp.java: 155)
> org.apache.jsp.WebContent.index_jsp._jspService(index_jsp.java:77)
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803) 
> I understand that if you access directly a jsp page containing a tag like s:text, s:a or s:url, which usually won't need for a value stack. A solution may be to have everything go through the struts 2 interceptor stack, but believe me, for legacy application it is sometimes not easy at all (one of my developer has work on this problem for 2 days, currently).
> Is there any patch, anywhere? Especially for the Java 1.4 version or Struts 2?
> Some links:
> http://forums.opensymphony.com/thread.jspa?messageID=155149&#155149
> http://www.mail-archive.com/user@struts.apache.org/msg57582.html
> Thanks!
> Cyril Gambis

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-1969) Error in TagUtils (NullPointerException) when viewing a page which didn't go through Struts 2 interceptor stack

Posted by "Cyril Gambis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-1969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43377#action_43377 ] 

Cyril Gambis commented on WW-1969:
----------------------------------

Yep, Ok.

I understand the purpose of going through the filter. My point was that some legacy applications, with only jsp, can't do that easily; but we worked out a solution (we don't use struts 2 when we can't go through the filter, and we use struts 2 for the pages that can be redesigned, and for the new pages - it's a bit sad for some pages, since we cannot use the i18n of struts 2 for legacy pages, but we have to live with it).

Thanks for your efforts on this great framework.

Cyril

> Error in TagUtils (NullPointerException) when viewing a page which didn't go through Struts 2 interceptor stack
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-1969
>                 URL: https://issues.apache.org/struts/browse/WW-1969
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Plugin - Tags
>    Affects Versions: 2.0.9
>         Environment: Tomcat 4.1
> Java 1.4
> Struts 2 - Java 1.4 retrotranslated version
>            Reporter: Cyril Gambis
>            Assignee: Wes Wannemacher
>            Priority: Critical
>             Fix For: 2.1.1
>
>         Attachments: WW-1969.patch
>
>
> I searched for that item and havn't find anything in JIRA. I think there may be a patch because it is quite a serious issue and it is a regression from Struts 2.0.5 as I read on some forum.
> With this bug, some HelloWorld tutorials don't work anymore.
> The stack trace is:
> Stacktrace:
> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrappe r.java:467)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> root cause
> java.lang.NullPointerException
> org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:58)
> org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport .java:54)
> org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport .java:49)
> org.apache.jsp.WebContent.index_jsp._jspx_meth_s_005fhead_005f0(index_jsp.java: 155)
> org.apache.jsp.WebContent.index_jsp._jspService(index_jsp.java:77)
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803) 
> I understand that if you access directly a jsp page containing a tag like s:text, s:a or s:url, which usually won't need for a value stack. A solution may be to have everything go through the struts 2 interceptor stack, but believe me, for legacy application it is sometimes not easy at all (one of my developer has work on this problem for 2 days, currently).
> Is there any patch, anywhere? Especially for the Java 1.4 version or Struts 2?
> Some links:
> http://forums.opensymphony.com/thread.jspa?messageID=155149&#155149
> http://www.mail-archive.com/user@struts.apache.org/msg57582.html
> Thanks!
> Cyril Gambis

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-1969) Error in TagUtils (NullPointerException) when viewing a page which didn't go through Struts 2 interceptor stack

Posted by "Pattabiraman Meenakshisundaram (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-1969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_42603 ] 

Pattabiraman Meenakshisundaram commented on WW-1969:
----------------------------------------------------

The suggestion by Lucian helped me could you let me know the reason. 

> Error in TagUtils (NullPointerException) when viewing a page which didn't go through Struts 2 interceptor stack
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-1969
>                 URL: https://issues.apache.org/struts/browse/WW-1969
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Plugin - Tags
>    Affects Versions: 2.0.9
>         Environment: Tomcat 4.1
> Java 1.4
> Struts 2 - Java 1.4 retrotranslated version
>            Reporter: Cyril Gambis
>            Priority: Critical
>             Fix For: Future
>
>
> I searched for that item and havn't find anything in JIRA. I think there may be a patch because it is quite a serious issue and it is a regression from Struts 2.0.5 as I read on some forum.
> With this bug, some HelloWorld tutorials don't work anymore.
> The stack trace is:
> Stacktrace:
> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrappe r.java:467)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> root cause
> java.lang.NullPointerException
> org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:58)
> org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport .java:54)
> org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport .java:49)
> org.apache.jsp.WebContent.index_jsp._jspx_meth_s_005fhead_005f0(index_jsp.java: 155)
> org.apache.jsp.WebContent.index_jsp._jspService(index_jsp.java:77)
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803) 
> I understand that if you access directly a jsp page containing a tag like s:text, s:a or s:url, which usually won't need for a value stack. A solution may be to have everything go through the struts 2 interceptor stack, but believe me, for legacy application it is sometimes not easy at all (one of my developer has work on this problem for 2 days, currently).
> Is there any patch, anywhere? Especially for the Java 1.4 version or Struts 2?
> Some links:
> http://forums.opensymphony.com/thread.jspa?messageID=155149&#155149
> http://www.mail-archive.com/user@struts.apache.org/msg57582.html
> Thanks!
> Cyril Gambis

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-1969) Error in TagUtils (NullPointerException) when viewing a page which didn't go through Struts 2 interceptor stack

Posted by "Cyril Gambis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-1969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_41183 ] 

Cyril Gambis commented on WW-1969:
----------------------------------

If the filter is changed in order to have every request go through the interceptor stack, then there is no problem.
But for legacy application which have Struts 1 or something else, and for applications with only jsp with the internationalization of Struts 2, it is a big problem.

Cyril

> Error in TagUtils (NullPointerException) when viewing a page which didn't go through Struts 2 interceptor stack
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-1969
>                 URL: https://issues.apache.org/struts/browse/WW-1969
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Views
>    Affects Versions: 2.0.6
>         Environment: Tomcat 4.1
> Java 1.4
> Struts 2 - Java 1.4 retrotranslated version
>            Reporter: Cyril Gambis
>            Priority: Critical
>
> I searched for that item and havn't find anything in JIRA. I think there may be a patch because it is quite a serious issue and it is a regression from Struts 2.0.5 as I read on some forum.
> With this bug, some HelloWorld tutorials don't work anymore.
> The stack trace is:
> Stacktrace:
> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrappe r.java:467)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> root cause
> java.lang.NullPointerException
> org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:58)
> org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport .java:54)
> org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport .java:49)
> org.apache.jsp.WebContent.index_jsp._jspx_meth_s_005fhead_005f0(index_jsp.java: 155)
> org.apache.jsp.WebContent.index_jsp._jspService(index_jsp.java:77)
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803) 
> I understand that if you access directly a jsp page containing a tag like s:text, s:a or s:url, which usually won't need for a value stack. A solution may be to have everything go through the struts 2 interceptor stack, but believe me, for legacy application it is sometimes not easy at all (one of my developer has work on this problem for 2 days, currently).
> Is there any patch, anywhere? Especially for the Java 1.4 version or Struts 2?
> Some links:
> http://forums.opensymphony.com/thread.jspa?messageID=155149&#155149
> http://www.mail-archive.com/user@struts.apache.org/msg57582.html
> Thanks!
> Cyril Gambis

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-1969) Error in TagUtils (NullPointerException) when viewing a page which didn't go through Struts 2 interceptor stack

Posted by "Maxx (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-1969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_41476 ] 

Maxx commented on WW-1969:
--------------------------

Hello!

I'm having the same problem with an application only using form-based authentication through web.xml
(like:
	<login-config>
		<auth-method>FORM</auth-method>
		<form-login-config>
			<form-login-page>/pages/login.jsp</form-login-page>
			<form-error-page>/pages/login.jsp</form-error-page>
		</form-login-config>
	</login-config>
)

It's impossible to use simple s:text, s:a or s:url tags in that page (/pages/login.jsp) because I got that annoying "NullPointerException"...
And the application is not big enough to develop some complicated filter schemes.

Some work-arounds? (except not using Struts tags...)

Regards,
Maxx

> Error in TagUtils (NullPointerException) when viewing a page which didn't go through Struts 2 interceptor stack
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-1969
>                 URL: https://issues.apache.org/struts/browse/WW-1969
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Views
>    Affects Versions: 2.0.6
>         Environment: Tomcat 4.1
> Java 1.4
> Struts 2 - Java 1.4 retrotranslated version
>            Reporter: Cyril Gambis
>            Priority: Critical
>
> I searched for that item and havn't find anything in JIRA. I think there may be a patch because it is quite a serious issue and it is a regression from Struts 2.0.5 as I read on some forum.
> With this bug, some HelloWorld tutorials don't work anymore.
> The stack trace is:
> Stacktrace:
> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrappe r.java:467)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> root cause
> java.lang.NullPointerException
> org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:58)
> org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport .java:54)
> org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport .java:49)
> org.apache.jsp.WebContent.index_jsp._jspx_meth_s_005fhead_005f0(index_jsp.java: 155)
> org.apache.jsp.WebContent.index_jsp._jspService(index_jsp.java:77)
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803) 
> I understand that if you access directly a jsp page containing a tag like s:text, s:a or s:url, which usually won't need for a value stack. A solution may be to have everything go through the struts 2 interceptor stack, but believe me, for legacy application it is sometimes not easy at all (one of my developer has work on this problem for 2 days, currently).
> Is there any patch, anywhere? Especially for the Java 1.4 version or Struts 2?
> Some links:
> http://forums.opensymphony.com/thread.jspa?messageID=155149&#155149
> http://www.mail-archive.com/user@struts.apache.org/msg57582.html
> Thanks!
> Cyril Gambis

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-1969) Error in TagUtils (NullPointerException) when viewing a page which didn't go through Struts 2 interceptor stack

Posted by "Dave Newton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-1969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_42604 ] 

Dave Newton commented on WW-1969:
---------------------------------

Because the filter is what makes the OGNL value stack available for the S2 tags in a JSP page.

> Error in TagUtils (NullPointerException) when viewing a page which didn't go through Struts 2 interceptor stack
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-1969
>                 URL: https://issues.apache.org/struts/browse/WW-1969
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Plugin - Tags
>    Affects Versions: 2.0.9
>         Environment: Tomcat 4.1
> Java 1.4
> Struts 2 - Java 1.4 retrotranslated version
>            Reporter: Cyril Gambis
>            Priority: Critical
>             Fix For: Future
>
>
> I searched for that item and havn't find anything in JIRA. I think there may be a patch because it is quite a serious issue and it is a regression from Struts 2.0.5 as I read on some forum.
> With this bug, some HelloWorld tutorials don't work anymore.
> The stack trace is:
> Stacktrace:
> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrappe r.java:467)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> root cause
> java.lang.NullPointerException
> org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:58)
> org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport .java:54)
> org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport .java:49)
> org.apache.jsp.WebContent.index_jsp._jspx_meth_s_005fhead_005f0(index_jsp.java: 155)
> org.apache.jsp.WebContent.index_jsp._jspService(index_jsp.java:77)
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803) 
> I understand that if you access directly a jsp page containing a tag like s:text, s:a or s:url, which usually won't need for a value stack. A solution may be to have everything go through the struts 2 interceptor stack, but believe me, for legacy application it is sometimes not easy at all (one of my developer has work on this problem for 2 days, currently).
> Is there any patch, anywhere? Especially for the Java 1.4 version or Struts 2?
> Some links:
> http://forums.opensymphony.com/thread.jspa?messageID=155149&#155149
> http://www.mail-archive.com/user@struts.apache.org/msg57582.html
> Thanks!
> Cyril Gambis

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-1969) Error in TagUtils (NullPointerException) when viewing a page which didn't go through Struts 2 interceptor stack

Posted by "Musachy Barroso (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-1969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_41176 ] 

Musachy Barroso commented on WW-1969:
-------------------------------------

I've seen this problem on the forums before, I don't remember exactly what was the cause, but I think it was related to the filter configuration on web.xml (the order of different filters maybe)

> Error in TagUtils (NullPointerException) when viewing a page which didn't go through Struts 2 interceptor stack
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-1969
>                 URL: https://issues.apache.org/struts/browse/WW-1969
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Views
>    Affects Versions: 2.0.6
>         Environment: Tomcat 4.1
> Java 1.4
> Struts 2 - Java 1.4 retrotranslated version
>            Reporter: Cyril Gambis
>            Priority: Critical
>
> I searched for that item and havn't find anything in JIRA. I think there may be a patch because it is quite a serious issue and it is a regression from Struts 2.0.5 as I read on some forum.
> With this bug, some HelloWorld tutorials don't work anymore.
> The stack trace is:
> Stacktrace:
> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrappe r.java:467)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> root cause
> java.lang.NullPointerException
> org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:58)
> org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport .java:54)
> org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport .java:49)
> org.apache.jsp.WebContent.index_jsp._jspx_meth_s_005fhead_005f0(index_jsp.java: 155)
> org.apache.jsp.WebContent.index_jsp._jspService(index_jsp.java:77)
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803) 
> I understand that if you access directly a jsp page containing a tag like s:text, s:a or s:url, which usually won't need for a value stack. A solution may be to have everything go through the struts 2 interceptor stack, but believe me, for legacy application it is sometimes not easy at all (one of my developer has work on this problem for 2 days, currently).
> Is there any patch, anywhere? Especially for the Java 1.4 version or Struts 2?
> Some links:
> http://forums.opensymphony.com/thread.jspa?messageID=155149&#155149
> http://www.mail-archive.com/user@struts.apache.org/msg57582.html
> Thanks!
> Cyril Gambis

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (WW-1969) Error in TagUtils (NullPointerException) when viewing a page which didn't go through Struts 2 interceptor stack

Posted by "Borys Marcelo Borches Herrera (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-1969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_42144 ] 

borysmarcelo edited comment on WW-1969 at 9/5/07 10:19 AM:
----------------------------------------------------------------------------

I'm having the same problem here. I'm trying to use a simple page as a helloworld to test Struts2 Ajax tag. But, as you can see this issue isn't making it possible. I'm deploying my app into a test Websphere 6.1 TestEnvironment  built in on RAD 7 with Java JRE 5. My Web.xml looks like this:

<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Struts_Course</display-name>

    <filter>
    <filter-name>struts-cleanup</filter-name>
    <filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class>
</filter>
<filter>
    <filter-name>struts</filter-name>
    <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>

<filter-mapping>
    <filter-name>struts-cleanup</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
    <filter-name>struts</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>


    <listener>
    	<description>
    	</description>
    	<display-name>
    	SpringContextLoader</display-name>
    	<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <servlet>
    	<description>
    	Configures main application</description>
    	<display-name>
    	Configurator</display-name>
    	<servlet-name>Configurator</servlet-name>
    	<servlet-class>
    	com.ibm.learning.struts2.webclient.view.configuration.Configurator</servlet-class>
    	<load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    	<servlet-name>Configurator</servlet-name>
    	<url-pattern>/Configurator</url-pattern>
    </servlet-mapping>

    <welcome-file-list>
    	<welcome-file>welcome.jsp</welcome-file>
    </welcome-file-list>
</web-app>

the welcome page file is set to "welcome.jsp" just as a lot of applications does... but while trying to access the application root http://localhost:9080/Struts_Course/, which it is supposed to forward the request to the welcome.jsp, it gives me a 500 error:

Error 500:


and the following stack trace:

9/5/07 11:52:06:081 BRT] 00000028 ServletWrappe I   SRVE0242I: [Struts_start] [/Struts_Course] [FilterProxyServlet]: Initialization successful.
[9/5/07 11:52:06:352 BRT] 00000028 SystemOut     O 2007-09-05 11:52:06,342 DEBUG (org.apache.struts2.dispatcher.ActionContextCleanUp:122) - skipping cleanup counter=1
[9/5/07 11:52:06:502 BRT] 00000028 ServletWrappe I   SRVE0242I: [Struts_start] [/Struts_Course] [/welcome.jsp]: Initialization successful.
[9/5/07 11:52:06:842 BRT] 00000028 ServletWrappe E   SRVE0068E: Uncaught exception thrown in one of the service methods of the servlet: /welcome.jsp. Exception thrown : java.lang.NullPointerException
	at org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:58)
	at org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport.java:52)
	at org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:49)
	at com.ibm._jsp._welcome._jspx_meth_s_head_0(_welcome.java:121)
	at com.ibm._jsp._welcome._jspService(_welcome.java:77)
	at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:85)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:989)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:930)
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:118)
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
	at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:761)
	at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:673)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:498)
	at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:464)
	at com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:122)
	at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:205)
	at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionProcessor.handleRequest(AbstractJSPExtensionProcessor.java:277)
	at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:321)
	at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:555)
	at com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:113)
	at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3252)
	at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:264)
	at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
	at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)
	at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:112)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:454)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:383)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:263)
	at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
	at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
	at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
	at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
	at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
	at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
	at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
	at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
	at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)

here is the welcome.jsp code: 

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>

<html>
<head>

    <title>Welcome</title>
    <s:head theme="ajax" />
    <link href="<s:url value="/theme/Master.css"/>" rel="stylesheet"
          type="text/css"/>
          
        
          
          
</head>

<s:url id="newUserForm" action="NewUserFormPage" method="generateForm" /> 


<body>


  <script language="Javascript">
          
          function escutaTopico(data, type, e){
            alert('inside a topic event. type='+type + ' data: ' + data);
         //data : text returned
         //type : "before", "load" or "error"
         //e    : request object
         }
          
          dojo.event.topic.subscribe("/after", escutaTopico);
          
          
          
          </script>
<h3>Testing some links to other actions:</h3>
<table>
<tr>
<td>

    <s:a id="registerUserLink" 
     theme="ajax" 
     href="%{newUserForm}" 
     targets="mainContent" notifyTopics="/after" 
     indicator="indicator"> Register</s:a>
     
     <img id="indicator" src="${pageContext.request.contextPath}/pages/images/indicator.gif" alt="Loading..." style="display:none"/>
     
    </td></tr>
    <tr>
    <td>
    
    <div id="mainContent"> Initial content </div>
    
    </td></tr>
    <tr>
    <td>
    <a href="<s:url action="Logon"/>">Sign On</a>
    </td>
    </tr>
</table>
</body>
</html>



So setting issue WW-1969 as an Improvement it's a mistake as most applications have calls directly jsp's without going through Struts actions.

      was (Author: borysmarcelo):
    I'm having the same problem here. I'm trying to use a simple page as a helloworld to test Struts2 Ajax tag. But, as you can see this issue isn't making it possible. I'm deploying my app into a test Websphere 6.1 TestEnvironment  built in on RAD 7. My Web.xml looks like this:

<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Struts_Course</display-name>

    <filter>
    <filter-name>struts-cleanup</filter-name>
    <filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class>
</filter>
<filter>
    <filter-name>struts</filter-name>
    <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>

<filter-mapping>
    <filter-name>struts-cleanup</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
    <filter-name>struts</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>


    <listener>
    	<description>
    	</description>
    	<display-name>
    	SpringContextLoader</display-name>
    	<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <servlet>
    	<description>
    	Configures main application</description>
    	<display-name>
    	Configurator</display-name>
    	<servlet-name>Configurator</servlet-name>
    	<servlet-class>
    	com.ibm.learning.struts2.webclient.view.configuration.Configurator</servlet-class>
    	<load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    	<servlet-name>Configurator</servlet-name>
    	<url-pattern>/Configurator</url-pattern>
    </servlet-mapping>

    <welcome-file-list>
    	<welcome-file>welcome.jsp</welcome-file>
    </welcome-file-list>
</web-app>

the welcome page file is set to "welcome.jsp" just as a lot of applications does... but while trying to access the application root http://localhost:9080/Struts_Course/, which it is supposed to forward the request to the welcome.jsp, it gives me a 500 error:

Error 500:


and the following stack trace:

9/5/07 11:52:06:081 BRT] 00000028 ServletWrappe I   SRVE0242I: [Struts_start] [/Struts_Course] [FilterProxyServlet]: Initialization successful.
[9/5/07 11:52:06:352 BRT] 00000028 SystemOut     O 2007-09-05 11:52:06,342 DEBUG (org.apache.struts2.dispatcher.ActionContextCleanUp:122) - skipping cleanup counter=1
[9/5/07 11:52:06:502 BRT] 00000028 ServletWrappe I   SRVE0242I: [Struts_start] [/Struts_Course] [/welcome.jsp]: Initialization successful.
[9/5/07 11:52:06:842 BRT] 00000028 ServletWrappe E   SRVE0068E: Uncaught exception thrown in one of the service methods of the servlet: /welcome.jsp. Exception thrown : java.lang.NullPointerException
	at org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:58)
	at org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport.java:52)
	at org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:49)
	at com.ibm._jsp._welcome._jspx_meth_s_head_0(_welcome.java:121)
	at com.ibm._jsp._welcome._jspService(_welcome.java:77)
	at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:85)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:989)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:930)
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:118)
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
	at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:761)
	at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:673)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:498)
	at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:464)
	at com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:122)
	at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:205)
	at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionProcessor.handleRequest(AbstractJSPExtensionProcessor.java:277)
	at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:321)
	at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:555)
	at com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:113)
	at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3252)
	at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:264)
	at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
	at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)
	at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:112)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:454)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:383)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:263)
	at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
	at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
	at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
	at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
	at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
	at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
	at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
	at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
	at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)

here is the welcome.jsp code: 

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>

<html>
<head>

    <title>Welcome</title>
    <s:head theme="ajax" />
    <link href="<s:url value="/theme/Master.css"/>" rel="stylesheet"
          type="text/css"/>
          
        
          
          
</head>

<s:url id="newUserForm" action="NewUserFormPage" method="generateForm" /> 


<body>


  <script language="Javascript">
          
          function escutaTopico(data, type, e){
            alert('inside a topic event. type='+type + ' data: ' + data);
         //data : text returned
         //type : "before", "load" or "error"
         //e    : request object
         }
          
          dojo.event.topic.subscribe("/after", escutaTopico);
          
          
          
          </script>
<h3>Testing some links to other actions:</h3>
<table>
<tr>
<td>

    <s:a id="registerUserLink" 
     theme="ajax" 
     href="%{newUserForm}" 
     targets="mainContent" notifyTopics="/after" 
     indicator="indicator"> Register</s:a>
     
     <img id="indicator" src="${pageContext.request.contextPath}/pages/images/indicator.gif" alt="Loading..." style="display:none"/>
     
    </td></tr>
    <tr>
    <td>
    
    <div id="mainContent"> Initial content </div>
    
    </td></tr>
    <tr>
    <td>
    <a href="<s:url action="Logon"/>">Sign On</a>
    </td>
    </tr>
</table>
</body>
</html>



So setting issue WW-1969 as an Improvement it's a mistake as most applications have calls directly jsp's without going through Struts actions.
  
> Error in TagUtils (NullPointerException) when viewing a page which didn't go through Struts 2 interceptor stack
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-1969
>                 URL: https://issues.apache.org/struts/browse/WW-1969
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Views
>    Affects Versions: 2.0.6
>         Environment: Tomcat 4.1
> Java 1.4
> Struts 2 - Java 1.4 retrotranslated version
>            Reporter: Cyril Gambis
>            Priority: Critical
>             Fix For: Future
>
>
> I searched for that item and havn't find anything in JIRA. I think there may be a patch because it is quite a serious issue and it is a regression from Struts 2.0.5 as I read on some forum.
> With this bug, some HelloWorld tutorials don't work anymore.
> The stack trace is:
> Stacktrace:
> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrappe r.java:467)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> root cause
> java.lang.NullPointerException
> org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:58)
> org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport .java:54)
> org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport .java:49)
> org.apache.jsp.WebContent.index_jsp._jspx_meth_s_005fhead_005f0(index_jsp.java: 155)
> org.apache.jsp.WebContent.index_jsp._jspService(index_jsp.java:77)
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803) 
> I understand that if you access directly a jsp page containing a tag like s:text, s:a or s:url, which usually won't need for a value stack. A solution may be to have everything go through the struts 2 interceptor stack, but believe me, for legacy application it is sometimes not easy at all (one of my developer has work on this problem for 2 days, currently).
> Is there any patch, anywhere? Especially for the Java 1.4 version or Struts 2?
> Some links:
> http://forums.opensymphony.com/thread.jspa?messageID=155149&#155149
> http://www.mail-archive.com/user@struts.apache.org/msg57582.html
> Thanks!
> Cyril Gambis

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-1969) Error in TagUtils (NullPointerException) when viewing a page which didn't go through Struts 2 interceptor stack

Posted by "Cyril Gambis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-1969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_42121 ] 

Cyril Gambis commented on WW-1969:
----------------------------------

Actually, it's quite complicated. I used workarounds, like avoiding Struts 2 tags for some pages, or creating mapping in order to force the request to go through Struts 2 interceptors before going to the old legacy jsp page. But I'm a bit disappointed, I thought it was easier to put some bits of Struts 2 into legacy application, without refactoring all the application.
Actually, it is more or less possible, but these strange behaviors take a lot of time to analyse and understand (I still consider it a "bug" since it breaks the old tutorial examples)...

Nevertheless, I'm pretty confident that when my teams will know well Struts 2, it will be a big improvement over what we did previously (including Struts 1). But Struts 2, even if it is based on the mature Webwork 2 project, and not anymore more a beta, is still not so mature.

> Error in TagUtils (NullPointerException) when viewing a page which didn't go through Struts 2 interceptor stack
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-1969
>                 URL: https://issues.apache.org/struts/browse/WW-1969
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Views
>    Affects Versions: 2.0.6
>         Environment: Tomcat 4.1
> Java 1.4
> Struts 2 - Java 1.4 retrotranslated version
>            Reporter: Cyril Gambis
>            Priority: Critical
>             Fix For: Future
>
>
> I searched for that item and havn't find anything in JIRA. I think there may be a patch because it is quite a serious issue and it is a regression from Struts 2.0.5 as I read on some forum.
> With this bug, some HelloWorld tutorials don't work anymore.
> The stack trace is:
> Stacktrace:
> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrappe r.java:467)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> root cause
> java.lang.NullPointerException
> org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:58)
> org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport .java:54)
> org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport .java:49)
> org.apache.jsp.WebContent.index_jsp._jspx_meth_s_005fhead_005f0(index_jsp.java: 155)
> org.apache.jsp.WebContent.index_jsp._jspService(index_jsp.java:77)
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803) 
> I understand that if you access directly a jsp page containing a tag like s:text, s:a or s:url, which usually won't need for a value stack. A solution may be to have everything go through the struts 2 interceptor stack, but believe me, for legacy application it is sometimes not easy at all (one of my developer has work on this problem for 2 days, currently).
> Is there any patch, anywhere? Especially for the Java 1.4 version or Struts 2?
> Some links:
> http://forums.opensymphony.com/thread.jspa?messageID=155149&#155149
> http://www.mail-archive.com/user@struts.apache.org/msg57582.html
> Thanks!
> Cyril Gambis

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.