转发的请求未通过,正在处理一个空的请求jboss eap 6.4 [英] Forwarded request is not passed and an empty one is being processed jboss eap 6.4

查看:132
本文介绍了转发的请求未通过,正在处理一个空的请求jboss eap 6.4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个与HttpServletRequest有关的问题. 不知何故,它不能通过Forward传递给被调用的过滤器.

I have a problem related to HttpServletRequest. Somehow it can not be not passed to the called filter with Forward.

当我尝试访问请求中的字段以及请求的会话时,出现空指针异常.

When I try to access the fields on request and the session of the request I get null pointer exception.

这是代码: 如您所见,在转发请求之前,我正在打印会话的内容.我输入的所有字段都在那里.我在日志中看到它.

Here is the code: As you can see I am printing the content of the session just before forwarding the request. And all the fields that I put in it is there. I see it in logs.

    HttpServletRequest reqServ = (HttpServletRequest)request;
    Enumeration sessionKeys = reqServ.getSession().getAttributeNames();
    while (sessionKeys.hasMoreElements())
    {
      String key = (String)sessionKeys.nextElement();
      System.out.println(key + ": " + reqServ.getSession().getValue(key) + "<br>");
    }

    request.getRequestDispatcher("/jsp/XXXXX.jsp").forward(request, response);

此转发中的请求已完全填充,不能为空. 但是,当/jsp/XXXXX.do获取完全空的请求对象并且会话仅包含LOCALE参数时,该过滤器才会生效.

request in this forward is fully filled and not empty. But the filter which takes affect when /jsp/XXXXX.do is getting a totally empty request object and session containes only a LOCALE param.

原因是我无法获取需要使用的参数,并且在尝试时会给我一个空指针异常.

Cause of that I can not get the params that I need to use and when I try it gives me a null pointer exception.

这是XXXXX.jsp的struts-config.xml

Here is struts-config.xml for XXXXX.jsp

    <action name="XXXXXFormBean" path="/XXXXX" scope="request" type="com.AAAAAA.service.actions.XXXXXAction"
        input="/jsp/XXXXX.jsp">
        <forward name="oneself" path="/jsp/XXXXX.jsp"></forward>
        <forward name="XXXXX" path="/jsp/XXXXX.jsp"></forward>
    </action>

我已经在互联网上搜索了此类问题,但一无所获.

I have searched for such an issue on internet and got nothing.

我正在使用JBoss EAP 6.4

I am using JBoss EAP 6.4

Struts 1.3.8

Struts 1.3.8

Java 1.7

我该怎么做才能解决此问题?

What can I do to solve this issue?

谢谢.

这是我得到的带有跟踪的完整错误消息.

Here is the full error message with trace I got.

    14:25:57,414 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/BBBBBBB].[action]] (http-localhost/127.0.0.1:8080-2) JBWEB000236: Servlet.service() for servlet action threw exception: java.lang.NullPointerException
        at com.AAAAAA.service.actions.XXXXX.execute(XXXXX.java:75) [classes:]
        at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58) [struts-core-1.3.8.jar:1.3.8]
        at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67) [struts-core-1.3.8.jar:1.3.8]
        at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51) [struts-core-1.3.8.jar:1.3.8]
        at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190) [commons-chain-1.1.jar:1.1]
        at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304) [commons-chain-1.1.jar:1.1]
        at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190) [commons-chain-1.1.jar:1.1]
        at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283) [struts-core-1.3.8.jar:1.3.8]
        at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) [struts-core-1.3.8.jar:1.3.8]
        at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462) [struts-core-1.3.8.jar:1.3.8]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:754) [jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-2.jar:1.0.2.Final-redhat-2]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-2.jar:1.0.2.Final-redhat-2]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
        at com.AAAAAA.service.filter.RequestEncodingFilter.doFilter(RequestEncodingFilter.java:41) [classes:]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
        at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:150) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:854) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_80]

推荐答案

该项目的编写大约在13年前,当时认为手动更改JSESSIONID是在WebSphere中要做的一件好事,并且不会创建一个问题.但是,使用JBoss EAP 6.4会产生问题.我已经将JSSESIONID代码更改为不更改,并且全部解决了.

This project was written like 13 years ago and at that time that thought that changing the JSESSIONID manally is a good thing to do in WebSphere and it does not create an issues with that. But with JBoss EAP 6.4 it is creating an issue. I have changed the JSSESIONID code to not changing it and all worked out.

这篇关于转发的请求未通过,正在处理一个空的请求jboss eap 6.4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆