Not sure I follow your configuration.

> I found if log4j or slf4j  exists

Does this mean you are, or are not, using slf4j + log4j?

> the Exception will turn to  WARN  o.e.jetty.servlet.ServletHandler ,
> not Exception?
> can somebody explain the behaviour?

So the Exception is logged at WARN level, but it's no longer an Exception?
I don't understand what you are saying or asking.


--
Joakim Erdfelt <[email protected]>
webtide.com <http://www.webtide.com/> - intalio.com/jetty
Expert advice, services and support from from the Jetty & CometD experts
eclipse.org/jetty - cometd.org


On Wed, Nov 20, 2013 at 1:00 AM, admin dd <[email protected]> wrote:

> 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]
>   ....
> _______________________________________________
> jetty-users mailing list
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/jetty-users
>
_______________________________________________
jetty-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to