1 Reply Latest reply on Sep 18, 2014 3:17 AM by Sandeep Samdaria

    Unable to access the request.forwardURI after a 404 redirect.

    Sandeep Samdaria Newbie

      In my grails application I had a custom redirect for "404". Whenever the application used to hit a 404, it used to log the request.forwardURI and redirect the user to a 404 page. But after upgrading to wildfly-8.0.0(also tried 8.1.0 and 9.0.0-alpha), the application doesn't log the actual URI( request.forwardURI).

      However, in the request dump I see the actual URI that was requested. I believe, it might not be a grails problem as the actual request is getting logged in jboss-4 and the jboss-eap-6.2.

      The Request class in wildfly is HttpServletRequestImpl, whereas in older version it was ApplicationHttpRequest.

      I have copied the war into https://www.dropbox.com/sh/trzzmfp7pp5ut0f/AADBDczE4fx1oJGDUAw8FxAqa?dl=0. Please let me know if is there any other way by which I can get the actual request.

       

      Logs for wildfly

      10:32:18,242 INFO  [stdout] (default task-8) Request Class *** class io.undertow.servlet.spec.HttpServletRequestImpl

      10:32:18,242 INFO  [stdout] (default task-8) Request dump-------------------

      10:32:18,245 INFO  [stdout] (default task-8) <io.undertow.servlet.spec.HttpServletRequestImpl@6d806f8e exchange=HttpServerExchange{ GET /test1/grails/common/redirectUrl.dispatch} originalServletContext=io.undertow.servlet.spec.ServletContextImpl@4a622bb servletContext=io.undertow.servlet.spec.ServletContextImpl@4a622bb attributes=[javax.servlet.forward.request_uri:/test1/grails-errorhandler, org.springframework.web.servlet.DispatcherServlet.THEME_SOURCE:org.codehaus.groovy.grails.commons.spring.GrailsWebApplicationContext@52728c5: startup date [Thu Sep 18 10:31:55 IST 2014]; parent: Root WebApplicationContext, org.springframework.web.servlet.DispatcherServlet.THEME_RESOLVER:org.springframework.web.servlet.theme.FixedThemeResolver@39ec09de, javax.servlet.forward.context_path:/test1, javax.servlet.error.servlet_name:default, javax.servlet.error.message:Not Found, javax.servlet.forward.servlet_path:/grails-errorhandler, org.codehaus.groovy.grails.GRAILS_APPLICATION_ATTRIBUTES:org.codehaus.groovy.grails.web.servlet.DefaultGrailsApplicationAttributes@377beb87, urlMapping.FILTERED:true, charEncodingFilter.FILTERED:true, org.codehaus.groovy.grails.FLASH_SCOPE:[:], org.codehaus.groovy.grails.CONTROLLER_NAME_ATTRIBUTE:common, org.codehaus.groovy.grails.CONTROLLER:CommonController@28a40886, javax.servlet.error.request_uri:/test1/asdf, hiddenHttpMethod.FILTERED:true, grailsWebRequest.FILTERED:true, javax.servlet.forward.query_string:null, org.springframework.web.servlet.DispatcherServlet.FLASH_MAP_MANAGER:org.springframework.web.servlet.support.SessionFlashMapManager@292baa42, javax.servlet.forward.path_info:null, org.springframework.web.servlet.DispatcherServlet.CONTEXT:org.codehaus.groovy.grails.commons.spring.GrailsWebApplicationContext@52728c5: startup date [Thu Sep 18 10:31:55 IST 2014]; parent: Root WebApplicationContext, javax.servlet.error.status_code:404, org.codehaus.grails.INCLUDED_JS_LIBRARIES:[], org.codehaus.groovy.grails.ACTION_NAME_ATTRIBUTE:redirectUrl, org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.GSP_SITEMESH_PAGE:org.codehaus.groovy.grails.web.sitemesh.GSPSitemeshPage@71b6e82b, org.springframework.web.servlet.DispatcherServlet.OUTPUT_FLASH_MAP:[:], com.opensymphony.sitemesh.APPLIED_ONCE:true, org.hibernate.impl.SessionFactoryImpl@22de1eda.PARTICIPATE:1, org.codehaus.groovy.grails.WEB_REQUEST:ServletWebRequest: uri=/test1/grails/common/redirectUrl.dispatch;client=127.0.0.1, org.springframework.web.servlet.DispatcherServlet.LOCALE_RESOLVER:org.springframework.web.servlet.i18n.SessionLocaleResolver@1f449960] servletInputStream=null reader=null cookies=null parts=null asyncStarted=false asyncContext=null queryParameters=[:[]] parsedFormData=null characterEncoding=UTF-8 readStarted=false sessionCookieSource=null>

      10:32:18,246 INFO  [stdout] (default task-8) ---------------------------

      10:32:18,247 INFO  [stdout] (default task-8) Request URI *** /test1/grails/common/redirectUrl.dispatch

      10:32:18,249 INFO  [stdout] (default task-8) Forward URI *** /test1/grails-errorhandler

       

      Logs for older jboss

      10:25:37,510 INFO  [stdout] (http-/127.0.0.1:8080-1)  Request Class *** class org.apache.catalina.core.ApplicationHttpRequest

      10:25:37,510 INFO  [stdout] (http-/127.0.0.1:8080-1) Request dump-------------------

      10:25:37,514 INFO  [stdout] (http-/127.0.0.1:8080-1) <org.apache.catalina.core.ApplicationHttpRequest@4cc7420c context=StandardEngine[jboss.web].StandardHost[default-host].StandardContext[/test1] contextPath=/test1 crossContext=false dispatcherType=1 parameters=[:] parsedParams=true pathInfo=null queryParamString=null queryString=null requestDispatcherPath=/grails-errorhandler requestURI=/test1/grails/common/redirectUrl.dispatch servletPath=/grails/common/redirectUrl.dispatch session=null specialAttributes=[null, null, null, null, null, null, null, null, null, null, null, null, null, null, null] request=org.apache.catalina.core.ApplicationHttpRequest@1ad23c25>

      10:25:37,514 INFO  [stdout] (http-/127.0.0.1:8080-1) ------------URI and domainname --------------

      10:25:37,515 INFO  [stdout] (http-/127.0.0.1:8080-1) Request URI *** / /test1/grails/common/redirectUrl.dispatch

      10:25:37,516 INFO  [stdout] (http-/127.0.0.1:8080-1) Forward URI *** /test1/test