JFinal 配置druid访问报错

freedomcat 发布于 2016/01/04 14:18
阅读 320
收藏 0

@JFinal 你好,想跟你请教个问题:

JFinal 配置druid 的时候访问

public void configPlugin(Plugins me) {
DruidPlugin datasource = new DruidPlugin(DB_URL, DB_USERNAME, DB_PASSWORD);//数据库连接插件
datasource.addFilter(new StatFilter());
WallFilter wall = new WallFilter();
wall.setDbType("mysql");
datasource.addFilter(wall);
me.add(datasource);
}

public void configHandler(Handlers me) {
    DruidStatViewHandler dvh = new DruidStatViewHandler("/druid");
    me.add(dvh);
}

localhost/druid/index.html报错

HTTP Status 500 - Filter execution threw an exception

type Exception report

message Filter execution threw an exception

description The server encountered an internal error that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Filter execution threw an exception

root cause

java.lang.IllegalAccessError: tried to access method com.alibaba.druid.support.http.StatViewServlet.returnResourceFile(Ljava/lang/String;Ljava/lang/String;Ljavax/servlet/http/HttpServletResponse;)V from class com.jfinal.plugin.druid.DruidStatViewHandler$JFinalStatViewServlet
	com.jfinal.plugin.druid.DruidStatViewHandler$JFinalStatViewServlet.service(DruidStatViewHandler.java:163)
	com.jfinal.plugin.druid.DruidStatViewHandler.handle(DruidStatViewHandler.java:69)
	com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:72)

note The full stack trace of the root cause is available in the Apache Tomcat/8.0.28 logs.


Apache Tomcat/8.0.28

加载中
0
JFinal
JFinal
去掉 web.xml 中对 druid filter 的配置
freedomcat
freedomcat
我把druid 的版本升级之后可以了。还是很感谢
返回顶部
顶部