You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use getStackTraceString method to create a shorter stack trace. By default, getStackTraceString will generate the
same long stack trace as a string for you. You need to define some rules for getStackTraceString to use. Those rules
define how the exception stack trace is processed and shortened.
Exceptions.getStackTraceString(e);
2.1.3 Use root packages.
root package is the entry point in an exception chain. If you define a root package, then all stack trace elements
before that root package will be discarded, and you will get a cleaner, compact stack trace. A root package can be
defined in two different ways.
org.springframework.web.util.NestedServletException: Method not found. at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) at org.springframework.mock.web.MockFilterChain.doFilter(MockFilterChain.java:134) at org.springframework.test.web.servlet.MockMvc.perform(MockMvc.java:183) at com.arthenica.smartexception.java.SpringTest.putUserTest(SpringTest.java:100)
Instead of this one.
org.springframework.web.util.NestedServletException: Method not found. at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) at org.springframework.mock.web.MockFilterChain.doFilter(MockFilterChain.java:134) at org.springframework.test.web.servlet.MockMvc.perform(MockMvc.java:183) at com.arthenica.smartexception.java.SpringTest.putUserTest(SpringTest.java:100) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invo ke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) ... 35 more
2.2. Logback converters
Install smart-exception-logback by adding the following dependency to your build.gradle.
Note that smart-exception-logback requires Java 9 or later