0 Replies Latest reply on Mar 30, 2015 4:04 AM by Mahesh Narkepatil

    Liferay jboss : Handle 500 exception

    Mahesh Narkepatil Newbie

      Enviorment:

      liferay 6.2

      App server: jboss

       

       

      I am trying to display the custom error message whenever the 500 exception i.e internal server error occurs.

      Below are setting available in web.xml

       

          <error-page>

                  <error-code>404</error-code>

                  <location>/errors/code.jsp</location>

              </error-page>

              <error-page>

                  <error-code>500</error-code>

                  <location>/errors/code.jsp</location>

              </error-page>

       

      Also i changed the code.jsp and added the custom code. Just simple text error message. But it is not calling the code.jsp instead complete stack trace is getting printed on browser.

      The url i am hitting is:

       

         https://localhost/xyzportlet/js/xyz.js?browserId=firefox&minifierType=js&languageId=en_US&b=6210&t=1424361709000&fakeParam=%24{76428%2b66104%2b%27f60cec015d33e6f70fc90789dd6659ff6b83da4d49f58d1fb7d1f0ae210ff7a8de500d534018c03aa77a440178e47b9e9dc66b53afa119163810502c2d1946f2%27}

        JBWEB000065: HTTP Status 500 - /jboss/jboss-eap-6.1/standalone/tmp/work/jboss.web/default-host/xyz-portlet/aggregate/https_/xyz-portlet/js/xyz.jsbrowserId=firefox&minifierType=js&languageId=en_US&b=6210&t=1424361709000&fakeParam=%24{76428%2b66104%2b%27f60cec015d33e6f70fc90789dd6659ff6b83da4d49f58d1fb7d1f0ae210ff7a8de500d534018c03aa77a440178e47b9e9dc66b53afa119163810502c2d1946f2%27}_E_CONTENT_TYPE (File name too long)

       

      Also instead of calling js if i call other jsp,css or other , it gives resource not found error instead of 500.

       JBWEB000069: description JBWEB000145: The server encountered an internal error that prevented it from fulfilling this request.
      
          JBWEB000070: exception
      
          java.io.FileNotFoundException: /jboss/jboss-eap-6.1/standalone/tmp/work/jboss.web/default-host/empAppMgmt-portlet/aggregate/https_/empAppMgmt-portlet/js/empAppMgmt.jsbrowserId=firefox&minifierType=js&languageId=en_US&b=6210&t=1424361709000&fakeParam=%24{76428%2b66104%2b%27f60cec015d33e6f70fc90789dd6659ff6b83da4d49f58d1fb7d1f0ae210ff7a8de500d534018c03aa77a440178e47b9e9dc66b53afa119163810502c2d1946f2%27}_E_CONTENT_TYPE (File name too long)
              java.io.FileOutputStream.open(Native Method)
              java.io.FileOutputStream.<init>(FileOutputStream.java:221)
              com.liferay.portal.util.FileImpl.write(FileImpl.java:949)
              com.liferay.portal.util.FileImpl.write(FileImpl.java:927)
              com.liferay.portal.util.FileImpl.write(FileImpl.java:922)
              com.liferay.portal.kernel.util.FileUtil.write(FileUtil.java:425)
              com.liferay.portal.servlet.filters.aggregate.AggregateFilter.getContent(AggregateFilter.java:408)
              com.liferay.portal.servlet.filters.aggregate.AggregateFilter.processFilter(AggregateFilter.java:508)
              com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
              com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
              com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
              com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:74)
              com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
              com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
              sun.reflect.GeneratedMethodAccessor270.invoke(Unknown Source)
              sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              java.lang.reflect.Method.invoke(Method.java:606)
              com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:67)
              com.sun.proxy.$Proxy1748.doFilter(Unknown Source)
              com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
              com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
              com.liferay.portal.servlet.filters.language.LanguageFilter.processFilter(LanguageFilter.java:84)
              com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
              com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
              com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
              com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:74)
              com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
              com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
              sun.reflect.GeneratedMethodAccessor270.invoke(Unknown Source)
              sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              java.lang.reflect.Method.invoke(Method.java:606)
              com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:67)
              com.sun.proxy.$Proxy1748.doFilter(Unknown Source)
              com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
              com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
              com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:123)
              com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
              com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
              com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
              com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:74)
              com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
              com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
              sun.reflect.GeneratedMethodAccessor270.invoke(Unknown Source)
              sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              java.lang.reflect.Method.invoke(Method.java:606)
              com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:67)
              com.sun.proxy.$Proxy1748.doFilter(Unknown Source)
              com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
              com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
              com.liferay.portal.servlet.filters.cache.CacheFilter.processFilter(CacheFilter.java:421)
              com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
              com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
              com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
              com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:74)
              com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
              com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
              sun.reflect.GeneratedMethodAccessor270.invoke(Unknown Source)
              sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              java.lang.reflect.Method.invoke(Method.java:606)
              com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:67)
              com.sun.proxy.$Proxy1748.doFilter(Unknown Source)
              com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
              com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
              com.liferay.portal.servlet.filters.etag.ETagFilter.processFilter(ETagFilter.java:86)
              com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
              com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
              com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
              com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:74)
              com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
              com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
              sun.reflect.GeneratedMethodAccessor270.invoke(Unknown Source)
              sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              java.lang.reflect.Method.invoke(Method.java:606)
              com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:67)
              com.sun.proxy.$Proxy1748.doFilter(Unknown Source)
              com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
              com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
              com.liferay.portal.servlet.filters.header.HeaderFilter.processFilter(HeaderFilter.java:154)
              com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
              com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
              com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
              com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:74)
              com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
              com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
              sun.reflect.GeneratedMethodAccessor270.invoke(Unknown Source)
              sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              java.lang.reflect.Method.invoke(Method.java:606)
              com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:67)
              com.sun.proxy.$Proxy1748.doFilter(Unknown Source)
              com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
              com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:165)
              com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
              com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:74)
              com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
              com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
              com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:96)
      
          JBWEB000072: note JBWEB000073: The full stack trace of the root cause is available in the JBoss Web/7.2.2.Final-redhat-1 logs.
      

       

       

      Anyone let me know what i am missing to handle 500 exceptions.