[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[jetty-users] jetty log question
|
maven webapp project
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-webapp</artifactId>
<version>9.0.6.v20130930</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-jsp</artifactId>
<version>9.0.6.v20130930</version>
<scope>provided</scope>
</dependency>
spring webmvc code like
@RequestMapping("/login")
public String login() {
if(true){
throw new Exception("test exception");
}
return "/login";
}
when I use mvn package, put war to tomcat
access the login url
the Exception display in the console
==============
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.webapp.WebAppContext;
public class QuickStartServer {
public static final int PORT = 8080;
public static final String CONTEXT = "/xx";
public static void main(String[] args) throws Exception {
Server server = new Server(PORT);
WebAppContext context = new WebAppContext();
context.setDescriptor("src/main/webapp/WEB-INF/web.xml");
context.setResourceBase("src/main/webapp");
context.setContextPath(CONTEXT);
context.setParentLoaderPriority(true);
server.setHandler(context);
server.start();
System.out.println("server started");
server.join();
}
}
I found if log4j or slf4j exists
the Exception will turn to WARN o.e.jetty.servlet.ServletHandler ,
not Exception?
can somebody explain the behaviour?
org.springframework.web.util.NestedServletException: Request
processing failed; nested exception is java.lang.Exception: test
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:948)
~[spring-webmvc-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:827)
~[spring-webmvc-3.2.5.RELEASE.jar:3.2.5.RELEASE]
.....
Caused by: java.lang.Exception: xxxx
at com.xxx.LoginController.login(LoginController.java:xx) ~[classes/:na]
....