kumare
asked on
javax.servlet.ServletException
I see the below exeception without much details. Not sure the root cause of it
javax.servlet.ServletExcep tion
at javax.faces.webapp.FacesSe rvlet.serv ice(FacesS ervlet.jav a:277)
at org.apache.catalina.core.A pplication FilterChai n.internal DoFilter(A pplication FilterChai n.java:291 )
at org.apache.catalina.core.A pplication FilterChai n.doFilter (Applicati onFilterCh ain.java:2 06)
at org.apache.tomcat.websocke t.server.W sFilter.do Filter(WsF ilter.java :52)
at org.apache.catalina.core.A pplication FilterChai n.internal DoFilter(A pplication FilterChai n.java:239 )
at org.apache.catalina.core.A pplication FilterChai n.doFilter (Applicati onFilterCh ain.java:2 06)
at some.other.package.RoleRes toreFilter .doFilter( RoleRestor eFilter.ja va:115)
at org.apache.catalina.core.A pplication FilterChai n.internal DoFilter(A pplication FilterChai n.java:239 )
at org.apache.catalina.core.A pplication FilterChai n.doFilter (Applicati onFilterCh ain.java:2 06)
at some.package.SecurityFilte r.doFilter (SecurityF ilter.java :321)
at org.apache.catalina.core.A pplication FilterChai n.internal DoFilter(A pplication FilterChai n.java:239 )
at org.apache.catalina.core.A pplication FilterChai n.doFilter (Applicati onFilterCh ain.java:2 06)
at org.apache.catalina.core.S tandardWra pperValve. invoke(Sta ndardWrapp erValve.ja va:203)
at org.apache.catalina.core.S tandardCon textValve. invoke(Sta ndardConte xtValve.ja va:106)
at org.apache.catalina.authen ticator.Au thenticato rBase.invo ke(Authent icatorBase .java:501)
at org.apache.catalina.core.S tandardHos tValve.inv oke(Standa rdHostValv e.java:142 )
at org.apache.catalina.valves .ErrorRepo rtValve.in voke(Error ReportValv e.java:79)
at org.apache.catalina.valves .AbstractA ccessLogVa lve.invoke (AbstractA ccessLogVa lve.java:6 10)
at org.apache.catalina.core.S tandardEng ineValve.i nvoke(Stan dardEngine Valve.java :88)
at org.apache.catalina.connec tor.Coyote Adapter.se rvice(Coyo teAdapter. java:516)
at org.apache.coyote.http11.A bstractHtt p11Process or.process (AbstractH ttp11Proce ssor.java: 1086)
at org.apache.coyote.Abstract Protocol$A bstractCon nectionHan dler.proce ss(Abstrac tProtocol. java:659)
at org.apache.coyote.http11.H ttp11NioPr otocol$Htt p11Connect ionHandler .process(H ttp11NioPr otocol.jav a:223)
at org.apache.tomcat.util.net .NioEndpoi nt$SocketP rocessor.d oRun(NioEn dpoint.jav a:1558)
at org.apache.tomcat.util.net .NioEndpoi nt$SocketP rocessor.r un(NioEndp oint.java: 1515)
at java.util.concurrent.Threa dPoolExecu tor.runWor ker(Thread PoolExecut or.java:11 42)
at java.util.concurrent.Threa dPoolExecu tor$Worker .run(Threa dPoolExecu tor.java:6 17)
at org.apache.tomcat.util.thr eads.TaskT hread$Wrap pingRunnab le.run(Tas kThread.ja va:61)
at java.lang.Thread.run(Threa d.java:745 )
Caused by: java.lang.NullPointerExcep tion
javax.servlet.ServletExcep
at javax.faces.webapp.FacesSe
at org.apache.catalina.core.A
at org.apache.catalina.core.A
at org.apache.tomcat.websocke
at org.apache.catalina.core.A
at org.apache.catalina.core.A
at some.other.package.RoleRes
at org.apache.catalina.core.A
at org.apache.catalina.core.A
at some.package.SecurityFilte
at org.apache.catalina.core.A
at org.apache.catalina.core.A
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.authen
at org.apache.catalina.core.S
at org.apache.catalina.valves
at org.apache.catalina.valves
at org.apache.catalina.core.S
at org.apache.catalina.connec
at org.apache.coyote.http11.A
at org.apache.coyote.Abstract
at org.apache.coyote.http11.H
at org.apache.tomcat.util.net
at org.apache.tomcat.util.net
at java.util.concurrent.Threa
at java.util.concurrent.Threa
at org.apache.tomcat.util.thr
at java.lang.Thread.run(Threa
Caused by: java.lang.NullPointerExcep
I suspect you've missed out the part of the stack trace that's of interest
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("java x.servlet. error.exce ption");
....
...
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?
Here is the code that prints the stacktrace
Throwable e = (Throwable) request.getAttribute("java
....
...
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
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?
Why not try
e.printStackTrace
and look in the container's log?
ASKER
The logging method accepts throwable
The logging method accepts throwableYes, i know ;)
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 TRIALMembers 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.