开发者社区> 问答> 正文

JFinal 配置druid访问报错?报错

@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

展开
收起
爱吃鱼的程序员 2020-06-10 15:19:57 645 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    去掉web.xml中对druidfilter的配置我把druid的版本升级之后可以了。还是很感谢

    2020-06-10 15:20:14
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Java Spring Boot开发实战系列课程【第15讲】:Spring Boot 2.0 API与Spring REST Docs实战 立即下载
Apache Dubbo3 源码深入解读 立即下载
Java Spring Boot开发实战系列课程【第6讲】:Spring Boot 2.0实战MyBatis与优化(Java面试题) 立即下载