sqlserver2000 远程连接报错connection validation failed for current managed connection.

好奇怪呀,有传统方式就可以连上,用druid就不行

jfinal错误2.png

jfinal错误1.png


//原来没有写配置现在补上

//配置一、

package com.mcdc.common.config;

import com.jfinal.config.Constants;

import com.jfinal.config.Handlers;

import com.jfinal.config.Interceptors;

import com.jfinal.config.JFinalConfig;

import com.jfinal.config.Plugins;

import com.jfinal.config.Routes;

import com.jfinal.core.JFinal;

import com.jfinal.kit.PropKit;

import com.jfinal.template.Engine;

import com.jfinal.plugin.druid.DruidPlugin;

import com.jfinal.plugin.activerecord.ActiveRecordPlugin;

import com.jfinal.plugin.activerecord.dialect.SqlServerDialect;

import com.jfinal.plugin.activerecord.CaseInsensitiveContainerFactory;

import com.jfinal.render.ViewType;


public class MainConfig extends JFinalConfig {

@Override

public void configConstant(Constants me) {

//读取数据库配置文件

PropKit.use("config.properties");

//设置当前是否为开发模式

me.setDevMode(PropKit.getBoolean("devMode"));

//设置默认上传文件保存路径 getFile等使用

me.setBaseUploadPath("upload/temp/");

//设置上传最大限制尺寸

//me.setMaxPostSize(1024*1024*10);

//设置默认下载文件路径 renderFile使用

me.setBaseDownloadPath("download");

//设置默认视图类型

me.setViewType(ViewType.JFINAL_TEMPLATE);

//me.setError404View("404.html");

}


@Override

public void configRoute(Routes me) {}


@Override

public void configPlugin(Plugins me) {

//配置数据库连接池插件

DruidPlugin dbPlugin=new DruidPlugin(PropKit.get("jdbcUrl"), PropKit.get("user"), PropKit.get("password"));

//orm映射 配置ActiveRecord插件

ActiveRecordPlugin arp=new ActiveRecordPlugin(dbPlugin);

arp.setShowSql(PropKit.getBoolean("devMode"));

dbPlugin.setDriverClass("com.microsoft.jdbc.sqlserver.SQLServerDriver");

arp.setDialect(new SqlServerDialect());

arp.setContainerFactory(new CaseInsensitiveContainerFactory(true));

me.add(dbPlugin);

me.add(arp);

}

@Override

public void configInterceptor(Interceptors me) {}

@Override

public void configHandler(Handlers me) {}

@Override

public void configEngine(Engine me) {}

public static void main(String[] args) {JFinal.start("WebRoot", 8001, "/", 5);}

}

// 配置二 、propity文件中内容(为了安全)没写用户名和密码,但是用户名和密码都是正确的

#database config

dbType=sqlserver

jdbcUrl=jdbc:microsoft:sqlserver://122.114.253.148:56890;DatabaseName=Agency

user = *****

password =******

devMode =true

//由于是slq server2000我又多加了3个jar包

另外三个jar包.png


//以下是控制台返回的结果

运行结果2.png

Starting JFinal 3.0

Starting scanner at interval of 5 seconds.

Starting web server on port: 8001

大概15秒后出现下面的内容

2017-03-20 12:55:14

[WARN]-[Thread: main]-[com.alibaba.druid.pool.vendor.MSSQLValidConnectionChecker.isValidConnection()]: warning: connection validation failed for current managed connection.


2017-03-20 12:55:14

[ERROR]-[Thread: main]-[com.alibaba.druid.pool.DruidDataSource.init()]: init datasource error

java.sql.SQLException: validateConnection false

at com.alibaba.druid.pool.DruidAbstractDataSource.validateConnection(DruidAbstractDataSource.java:1199)

at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1422)

at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:602)

at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:876)

at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:872)

at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:97)

at com.jfinal.plugin.activerecord.TableBuilder.build(TableBuilder.java:38)

at com.jfinal.plugin.activerecord.ActiveRecordPlugin.start(ActiveRecordPlugin.java:209)

at com.jfinal.core.Config.startPlugins(Config.java:107)

at com.jfinal.core.Config.configJFinal(Config.java:53)

at com.jfinal.core.JFinal.init(JFinal.java:63)

at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:49)

at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:119)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:724)

at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)

at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)

at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706)

at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)

at org.eclipse.jetty.server.Server.doStart(Server.java:277)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at com.jfinal.server.JettyServer.doStart(JettyServer.java:131)

at com.jfinal.server.JettyServer.start(JettyServer.java:70)

at com.jfinal.core.JFinal.start(JFinal.java:159)

at com.mcdc.common.config.MainConfig.main(MainConfig.java:98)


2017-03-20 12:55:14

[ERROR]-[Thread: main]-[com.alibaba.druid.pool.DruidDataSource.init()]: dataSource init error

java.sql.SQLException: validateConnection false

at com.alibaba.druid.pool.DruidAbstractDataSource.validateConnection(DruidAbstractDataSource.java:1199)

at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1422)

at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:602)

at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:876)

at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:872)

at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:97)

at com.jfinal.plugin.activerecord.TableBuilder.build(TableBuilder.java:38)

at com.jfinal.plugin.activerecord.ActiveRecordPlugin.start(ActiveRecordPlugin.java:209)

at com.jfinal.core.Config.startPlugins(Config.java:107)

at com.jfinal.core.Config.configJFinal(Config.java:53)

at com.jfinal.core.JFinal.init(JFinal.java:63)

at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:49)

at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:119)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:724)

at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)

at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)

at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706)

at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)

at org.eclipse.jetty.server.Server.doStart(Server.java:277)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at com.jfinal.server.JettyServer.doStart(JettyServer.java:131)

at com.jfinal.server.JettyServer.start(JettyServer.java:70)

at com.jfinal.core.JFinal.start(JFinal.java:159)

at com.mcdc.common.config.MainConfig.main(MainConfig.java:98)


2017-03-20 12:55:14

[ERROR]-[Thread: main]-[com.jfinal.core.Config.startPlugins()]: Plugin start error: com.jfinal.plugin.activerecord.ActiveRecordPlugin. 

java.sql.SQLException: validateConnection false

com.jfinal.plugin.activerecord.ActiveRecordException: java.sql.SQLException: validateConnection false

at com.jfinal.plugin.activerecord.TableBuilder.build(TableBuilder.java:50)

at com.jfinal.plugin.activerecord.ActiveRecordPlugin.start(ActiveRecordPlugin.java:209)

at com.jfinal.core.Config.startPlugins(Config.java:107)

at com.jfinal.core.Config.configJFinal(Config.java:53)

at com.jfinal.core.JFinal.init(JFinal.java:63)

at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:49)

at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:119)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:724)

at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)

at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)

at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706)

at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)

at org.eclipse.jetty.server.Server.doStart(Server.java:277)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at com.jfinal.server.JettyServer.doStart(JettyServer.java:131)

at com.jfinal.server.JettyServer.start(JettyServer.java:70)

at com.jfinal.core.JFinal.start(JFinal.java:159)

at com.mcdc.common.config.MainConfig.main(MainConfig.java:98)

Caused by: java.sql.SQLException: validateConnection false

at com.alibaba.druid.pool.DruidAbstractDataSource.validateConnection(DruidAbstractDataSource.java:1199)

at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1422)

at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:602)

at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:876)

at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:872)

at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:97)

at com.jfinal.plugin.activerecord.TableBuilder.build(TableBuilder.java:38)

... 20 more

2017-03-20 12:55:14.969:WARN:oejuc.AbstractLifeCycle:FAILED jfinal: java.lang.RuntimeException: Plugin start error: com.jfinal.plugin.activerecord.ActiveRecordPlugin. |java.sql.SQLException: validateConnection false

java.lang.RuntimeException: Plugin start error: com.jfinal.plugin.activerecord.ActiveRecordPlugin. |java.sql.SQLException: validateConnection false

at com.jfinal.core.Config.startPlugins(Config.java:116)

at com.jfinal.core.Config.configJFinal(Config.java:53)

at com.jfinal.core.JFinal.init(JFinal.java:63)

at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:49)

at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:119)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:724)

at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)

at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)

at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706)

at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)

at org.eclipse.jetty.server.Server.doStart(Server.java:277)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at com.jfinal.server.JettyServer.doStart(JettyServer.java:131)

at com.jfinal.server.JettyServer.start(JettyServer.java:70)

at com.jfinal.core.JFinal.start(JFinal.java:159)

at com.mcdc.common.config.MainConfig.main(MainConfig.java:98)

Caused by: 

com.jfinal.plugin.activerecord.ActiveRecordException: java.sql.SQLException: validateConnection false

at com.jfinal.plugin.activerecord.TableBuilder.build(TableBuilder.java:50)

at com.jfinal.plugin.activerecord.ActiveRecordPlugin.start(ActiveRecordPlugin.java:209)

at com.jfinal.core.Config.startPlugins(Config.java:107)

at com.jfinal.core.Config.configJFinal(Config.java:53)

at com.jfinal.core.JFinal.init(JFinal.java:63)

at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:49)

at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:119)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:724)

at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)

at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)

at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706)

at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)

at org.eclipse.jetty.server.Server.doStart(Server.java:277)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at com.jfinal.server.JettyServer.doStart(JettyServer.java:131)

at com.jfinal.server.JettyServer.start(JettyServer.java:70)

at com.jfinal.core.JFinal.start(JFinal.java:159)

at com.mcdc.common.config.MainConfig.main(MainConfig.java:98)

Caused by: 

java.sql.SQLException: validateConnection false

at com.alibaba.druid.pool.DruidAbstractDataSource.validateConnection(DruidAbstractDataSource.java:1199)

at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1422)

at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:602)

at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:876)

at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:872)

at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:97)

at com.jfinal.plugin.activerecord.TableBuilder.build(TableBuilder.java:38)

at com.jfinal.plugin.activerecord.ActiveRecordPlugin.start(ActiveRecordPlugin.java:209)

at com.jfinal.core.Config.startPlugins(Config.java:107)

at com.jfinal.core.Config.configJFinal(Config.java:53)

at com.jfinal.core.JFinal.init(JFinal.java:63)

at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:49)

at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:119)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:724)

at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)

at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)

at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706)

at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)

at org.eclipse.jetty.server.Server.doStart(Server.java:277)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at com.jfinal.server.JettyServer.doStart(JettyServer.java:131)

at com.jfinal.server.JettyServer.start(JettyServer.java:70)

at com.jfinal.core.JFinal.start(JFinal.java:159)

at com.mcdc.common.config.MainConfig.main(MainConfig.java:98)

2017-03-20 12:55:14.969:WARN:oejw.WebAppContext:Failed startup of context o.e.j.w.WebAppContext{/,file:/E:/Users/Administrator/workspace/mcdc04/WebRoot/}

java.lang.RuntimeException: Plugin start error: com.jfinal.plugin.activerecord.ActiveRecordPlugin. |java.sql.SQLException: validateConnection false

at com.jfinal.core.Config.startPlugins(Config.java:116)

at com.jfinal.core.Config.configJFinal(Config.java:53)

at com.jfinal.core.JFinal.init(JFinal.java:63)

at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:49)

at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:119)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:724)

at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)

at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)

at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706)

at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)

at org.eclipse.jetty.server.Server.doStart(Server.java:277)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at com.jfinal.server.JettyServer.doStart(JettyServer.java:131)

at com.jfinal.server.JettyServer.start(JettyServer.java:70)

at com.jfinal.core.JFinal.start(JFinal.java:159)

at com.mcdc.common.config.MainConfig.main(MainConfig.java:98)

Caused by: 

com.jfinal.plugin.activerecord.ActiveRecordException: java.sql.SQLException: validateConnection false

at com.jfinal.plugin.activerecord.TableBuilder.build(TableBuilder.java:50)

at com.jfinal.plugin.activerecord.ActiveRecordPlugin.start(ActiveRecordPlugin.java:209)

at com.jfinal.core.Config.startPlugins(Config.java:107)

at com.jfinal.core.Config.configJFinal(Config.java:53)

at com.jfinal.core.JFinal.init(JFinal.java:63)

at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:49)

at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:119)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:724)

at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)

at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)

at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706)

at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)

at org.eclipse.jetty.server.Server.doStart(Server.java:277)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at com.jfinal.server.JettyServer.doStart(JettyServer.java:131)

at com.jfinal.server.JettyServer.start(JettyServer.java:70)

at com.jfinal.core.JFinal.start(JFinal.java:159)

at com.mcdc.common.config.MainConfig.main(MainConfig.java:98)

Caused by: 

java.sql.SQLException: validateConnection false

at com.alibaba.druid.pool.DruidAbstractDataSource.validateConnection(DruidAbstractDataSource.java:1199)

at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1422)

at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:602)

at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:876)

at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:872)

at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:97)

at com.jfinal.plugin.activerecord.TableBuilder.build(TableBuilder.java:38)

at com.jfinal.plugin.activerecord.ActiveRecordPlugin.start(ActiveRecordPlugin.java:209)

at com.jfinal.core.Config.startPlugins(Config.java:107)

at com.jfinal.core.Config.configJFinal(Config.java:53)

at com.jfinal.core.JFinal.init(JFinal.java:63)

at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:49)

at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:119)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:724)

at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)

at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)

at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706)

at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)

at org.eclipse.jetty.server.Server.doStart(Server.java:277)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at com.jfinal.server.JettyServer.doStart(JettyServer.java:131)

at com.jfinal.server.JettyServer.start(JettyServer.java:70)

at com.jfinal.core.JFinal.start(JFinal.java:159)

at com.mcdc.common.config.MainConfig.main(MainConfig.java:98)

2017-03-20 12:55:14.969:WARN:oejuc.AbstractLifeCycle:FAILED o.e.j.w.WebAppContext{/,file:/E:/Users/Administrator/workspace/mcdc04/WebRoot/}: java.lang.RuntimeException: Plugin start error: com.jfinal.plugin.activerecord.ActiveRecordPlugin. |java.sql.SQLException: validateConnection false

java.lang.RuntimeException: Plugin start error: com.jfinal.plugin.activerecord.ActiveRecordPlugin. |java.sql.SQLException: validateConnection false

at com.jfinal.core.Config.startPlugins(Config.java:116)

at com.jfinal.core.Config.configJFinal(Config.java:53)

at com.jfinal.core.JFinal.init(JFinal.java:63)

at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:49)

at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:119)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:724)

at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)

at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)

at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706)

at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)

at org.eclipse.jetty.server.Server.doStart(Server.java:277)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at com.jfinal.server.JettyServer.doStart(JettyServer.java:131)

at com.jfinal.server.JettyServer.start(JettyServer.java:70)

at com.jfinal.core.JFinal.start(JFinal.java:159)

at com.mcdc.common.config.MainConfig.main(MainConfig.java:98)

Caused by: 

com.jfinal.plugin.activerecord.ActiveRecordException: java.sql.SQLException: validateConnection false

at com.jfinal.plugin.activerecord.TableBuilder.build(TableBuilder.java:50)

at com.jfinal.plugin.activerecord.ActiveRecordPlugin.start(ActiveRecordPlugin.java:209)

at com.jfinal.core.Config.startPlugins(Config.java:107)

at com.jfinal.core.Config.configJFinal(Config.java:53)

at com.jfinal.core.JFinal.init(JFinal.java:63)

at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:49)

at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:119)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:724)

at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)

at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)

at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706)

at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)

at org.eclipse.jetty.server.Server.doStart(Server.java:277)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at com.jfinal.server.JettyServer.doStart(JettyServer.java:131)

at com.jfinal.server.JettyServer.start(JettyServer.java:70)

at com.jfinal.core.JFinal.start(JFinal.java:159)

at com.mcdc.common.config.MainConfig.main(MainConfig.java:98)

Caused by: 

java.sql.SQLException: validateConnection false

at com.alibaba.druid.pool.DruidAbstractDataSource.validateConnection(DruidAbstractDataSource.java:1199)

at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1422)

at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:602)

at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:876)

at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:872)

at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:97)

at com.jfinal.plugin.activerecord.TableBuilder.build(TableBuilder.java:38)

at com.jfinal.plugin.activerecord.ActiveRecordPlugin.start(ActiveRecordPlugin.java:209)

at com.jfinal.core.Config.startPlugins(Config.java:107)

at com.jfinal.core.Config.configJFinal(Config.java:53)

at com.jfinal.core.JFinal.init(JFinal.java:63)

at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:49)

at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:119)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:724)

at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)

at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)

at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706)

at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)

at org.eclipse.jetty.server.Server.doStart(Server.java:277)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at com.jfinal.server.JettyServer.doStart(JettyServer.java:131)

at com.jfinal.server.JettyServer.start(JettyServer.java:70)

at com.jfinal.core.JFinal.start(JFinal.java:159)

at com.mcdc.common.config.MainConfig.main(MainConfig.java:98)

2017-03-20 12:55:14.981:WARN:oejuc.AbstractLifeCycle:FAILED org.eclipse.jetty.server.Server@40f08448: java.lang.RuntimeException: Plugin start error: com.jfinal.plugin.activerecord.ActiveRecordPlugin. |java.sql.SQLException: validateConnection false

java.lang.RuntimeException: Plugin start error: com.jfinal.plugin.activerecord.ActiveRecordPlugin. |java.sql.SQLException: validateConnection false

at com.jfinal.core.Config.startPlugins(Config.java:116)

at com.jfinal.core.Config.configJFinal(Config.java:53)

at com.jfinal.core.JFinal.init(JFinal.java:63)

at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:49)

at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:119)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:724)

at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)

at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)

at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706)

at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)

at org.eclipse.jetty.server.Server.doStart(Server.java:277)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at com.jfinal.server.JettyServer.doStart(JettyServer.java:131)

at com.jfinal.server.JettyServer.start(JettyServer.java:70)

at com.jfinal.core.JFinal.start(JFinal.java:159)

at com.mcdc.common.config.MainConfig.main(MainConfig.java:98)

Caused by: 

com.jfinal.plugin.activerecord.ActiveRecordException: java.sql.SQLException: validateConnection false

at com.jfinal.plugin.activerecord.TableBuilder.build(TableBuilder.java:50)

at com.jfinal.plugin.activerecord.ActiveRecordPlugin.start(ActiveRecordPlugin.java:209)

at com.jfinal.core.Config.startPlugins(Config.java:107)

at com.jfinal.core.Config.configJFinal(Config.java:53)

at com.jfinal.core.JFinal.init(JFinal.java:63)

at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:49)

at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:119)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:724)

at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)

at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)

at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706)

at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)

at org.eclipse.jetty.server.Server.doStart(Server.java:277)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at com.jfinal.server.JettyServer.doStart(JettyServer.java:131)

at com.jfinal.server.JettyServer.start(JettyServer.java:70)

at com.jfinal.core.JFinal.start(JFinal.java:159)

at com.mcdc.common.config.MainConfig.main(MainConfig.java:98)

Caused by: 

java.sql.SQLException: validateConnection false

at com.alibaba.druid.pool.DruidAbstractDataSource.validateConnection(DruidAbstractDataSource.java:1199)

at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1422)

at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:602)

at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:876)

at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:872)

at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:97)

at com.jfinal.plugin.activerecord.TableBuilder.build(TableBuilder.java:38)

at com.jfinal.plugin.activerecord.ActiveRecordPlugin.start(ActiveRecordPlugin.java:209)

at com.jfinal.core.Config.startPlugins(Config.java:107)

at com.jfinal.core.Config.configJFinal(Config.java:53)

at com.jfinal.core.JFinal.init(JFinal.java:63)

at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:49)

at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:119)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:724)

at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)

at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)

at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706)

at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)

at org.eclipse.jetty.server.Server.doStart(Server.java:277)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at com.jfinal.server.JettyServer.doStart(JettyServer.java:131)

at com.jfinal.server.JettyServer.start(JettyServer.java:70)

at com.jfinal.core.JFinal.start(JFinal.java:159)

at com.mcdc.common.config.MainConfig.main(MainConfig.java:98)


2017-03-20 12:55:15

[ERROR]-[Thread: main]-[com.jfinal.kit.LogKit.error()]: Plugin start error: com.jfinal.plugin.activerecord.ActiveRecordPlugin. 

java.sql.SQLException: validateConnection false

java.lang.RuntimeException: Plugin start error: com.jfinal.plugin.activerecord.ActiveRecordPlugin. 

java.sql.SQLException: validateConnection false

at com.jfinal.core.Config.startPlugins(Config.java:116)

at com.jfinal.core.Config.configJFinal(Config.java:53)

at com.jfinal.core.JFinal.init(JFinal.java:63)

at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:49)

at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:119)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:724)

at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)

at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)

at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706)

at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)

at org.eclipse.jetty.server.Server.doStart(Server.java:277)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at com.jfinal.server.JettyServer.doStart(JettyServer.java:131)

at com.jfinal.server.JettyServer.start(JettyServer.java:70)

at com.jfinal.core.JFinal.start(JFinal.java:159)

at com.mcdc.common.config.MainConfig.main(MainConfig.java:98)

Caused by: com.jfinal.plugin.activerecord.ActiveRecordException: java.sql.SQLException: validateConnection false

at com.jfinal.plugin.activerecord.TableBuilder.build(TableBuilder.java:50)

at com.jfinal.plugin.activerecord.ActiveRecordPlugin.start(ActiveRecordPlugin.java:209)

at com.jfinal.core.Config.startPlugins(Config.java:107)

... 18 more

Caused by: java.sql.SQLException: validateConnection false

at com.alibaba.druid.pool.DruidAbstractDataSource.validateConnection(DruidAbstractDataSource.java:1199)

at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1422)

at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:602)

at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:876)

at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:872)

at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:97)

at com.jfinal.plugin.activerecord.TableBuilder.build(TableBuilder.java:38)

... 20 more


评论区

JFinal

2017-03-22 14:53

很明显是配置有问题,你连配置都没给出来,谁能猜中是什么错误?

暖暖的阳光

2017-03-22 21:14

@JFinal 已经补上了配置

JFinal

2017-03-22 22:19

应该是配置有问题,看一下这篇文章,根据你的 sql server 版本选择不同的配置方式:https://zhidao.baidu.com/question/2121360839637045147.html

JFinal

2017-03-22 22:20

此外 druid 之下应该是不需要配置 driverClass 的,所以去掉一下 setDriverClass(...) 这一行代码,以免出问题

暖暖的阳光

2017-03-23 09:42

@JFinal好的,我再试试 ,谢谢波总。

暖暖的阳光

2017-03-24 12:28

@JFinal 还是不行啊

暖暖的阳光

2017-03-24 14:27

可以运行了,用jtds作为驱动包,就可以跑起来了,但是又遇到了新的问题。

热门反馈

扫码入社