Interceptor invoke异常

Linux出问题,win没问题。jfinal2.2

异常内容:

2016-08-24 17:11:20
[ERROR]-[Thread: http-18080-2]-[com.jfinal.core.ActionHandler.handle()]: /webservice/receive
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at com.jfinal.aop.Invocation.invoke(Invocation.java:87)
	at com.rayootech.webservice.interceptor.CommonInterceptor.intercept(CommonInterceptor.java:20)
	at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
	at com.rayootech.webservice.interceptor.UserInterceptor.intercept(UserInterceptor.java:27)
	at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
	at com.jfinal.ext.interceptor.SessionInViewInterceptor.intercept(SessionInViewInterceptor.java:44)
	at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
	at com.jfinal.core.ActionHandler.handle(ActionHandler.java:74)
	at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:72)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:620)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at com.jfinal.aop.Invocation.invoke(Invocation.java:73)
	... 20 more
Caused by: java.lang.NoClassDefFoundError: org/eclipse/jetty/util/log/Log
	at com.rayootech.webservice.service.DatasourcesService.init(DatasourcesService.java:71)
	at com.rayootech.webservice.handler.InitDatasourceHandler.handle(InitDatasourceHandler.java:53)
	at com.rayootech.webservice.service.SendOutService.receive(SendOutService.java:252)
	at com.rayootech.webservice.web.WebserviceController.receive(WebserviceController.java:166)
	... 25 more

源码:

import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;
import com.jfinal.kit.PropKit;

public class CommonInterceptor implements Interceptor {

  @Override
  public void intercept(Invocation ai) {
    ai.getController().getRequest().setAttribute("ctx", ai.getController().getRequest().getContextPath());
    ai.getController().getRequest().setAttribute("webtitle", PropKit.get("title"));
    ai.invoke();
  }

}

异常:

	at com.rayootech.webservice.interceptor.CommonInterceptor.intercept(CommonInterceptor.java:20)

第20行是 

ai.invoke();

Config配置:

  /**
   * 配置全局拦截器
   */
  public void configInterceptor(Interceptors me) {
    me.add(new SessionInViewInterceptor());
    me.add(new UserInterceptor());
    me.add(new CommonInterceptor());
  }


评论区

JFinal

2016-08-24 21:38

核心是这一行:Caused by: java.lang.NoClassDefFoundError: org/eclipse/jetty/util/log/Log
应该是项目部署在 tomcat 之下,但 jetty 的 jar 包没清干净

无为

2016-08-24 22:14

@JFinal 这一行的错误已经修正,org/eclipse/jetty/util/log/Log。这是两个不同的异常,不在一个文件里呀。

JFinal

2016-08-25 10:58

@无为 没秒懂,是啥意思?

sdfsf

2016-08-25 12:43

@JFinal 请问下 JFInal 自带事物处理么 怎么用

JFinal

2016-08-25 15:25

@sdfsf 使用拦截器以及 Db.tx(...) 事务方法都可以,具体用法看一下 jfinal 手册,在首页有手册的下载链接

无为

2016-08-26 13:26

@JFinal 修复org/eclipse/jetty/util/log/Log异常,重新发布,解决问题。