Link to home
Start Free TrialLog in
Avatar of kumare
kumareFlag for United States of America

asked on

javax.servlet.ServletException

I see the below exeception without much details. Not sure the root cause of it
javax.servlet.ServletException
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:277)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at some.other.package.RoleRestoreFilter.doFilter(RoleRestoreFilter.java:115)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at some.package.SecurityFilter.doFilter(SecurityFilter.java:321)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:203)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
      at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:516)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1086)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:659)
      at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:223)
      at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1558)
      at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1515)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

I suspect you've missed out the part of the stack trace that's of interest
Avatar of kumare

ASKER

This is what i see in the logs. I feel some of the info is truncated

Here is the code that prints the stacktrace
 Throwable e = (Throwable) request.getAttribute("javax.servlet.error.exception");
....
...
logger.error(" System Exception: " , e);

Do we need e.getCause() or e.      printStackTrace() to get more of the stack trace or just printing e is enough. what is the difference?
Again, there's information hidden. The pieces of code that are not dots would not throw an NPE
Avatar of kumare

ASKER

the exception is already thrown.. the piece of code is just logging it logs
Oh i see. Normally, if there is a logging method that accepts a Throwable, it should show all the stack trace. Pretty useless otherwise

Why not try

e.printStackTrace

and look in the container's log?
Avatar of kumare

ASKER

The logging method accepts throwable
The logging method accepts throwable
Yes, i know ;)
Avatar of kumare

ASKER

i tried above methods to find root cause but no use.. as I think the implementation of facesservlet suppresses the original exception
I can't think of anything further to add unfortunately
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.