@JFinal 波总,没办法,我快花了一周时间去配置jfinal连接sqlserver2008数据库了,然后我尝试用官网的demo来连接sqlserver,但是一直不行,求帮助。贴上我修改的地方。
数据库配置文件:
democonfig:
导入的jar:
然后是报错:
Starting JFinal 3.0
Starting scanner at interval of 5 seconds.
Starting web server on port: 80
2017-03-17 17:37:16
[ERROR]-[Thread: main]-[com.alibaba.druid.pool.DruidDataSource.init()]: dataSource init error
java.sql.SQLException: com.microsoft.sqlserver.jdbc.SQLServerDriver
at com.alibaba.druid.util.JdbcUtils.createDriver(JdbcUtils.java:510)
at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:563)
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.demo.common.DemoConfig.main(DemoConfig.java:38)
Caused by: java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:430)
at com.jfinal.server.JFinalClassLoader.loadClass(JFinalClassLoader.java:53)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.alibaba.druid.util.JdbcUtils.createDriver(JdbcUtils.java:508)
... 25 more
2017-03-17 17:37:16
[ERROR]-[Thread: main]-[com.jfinal.core.Config.startPlugins()]: Plugin start error: com.jfinal.plugin.activerecord.ActiveRecordPlugin.
java.sql.SQLException: com.microsoft.sqlserver.jdbc.SQLServerDriver
com.jfinal.plugin.activerecord.ActiveRecordException: java.sql.SQLException: com.microsoft.sqlserver.jdbc.SQLServerDriver
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.demo.common.DemoConfig.main(DemoConfig.java:38)
Caused by: java.sql.SQLException: com.microsoft.sqlserver.jdbc.SQLServerDriver
at com.alibaba.druid.util.JdbcUtils.createDriver(JdbcUtils.java:510)
at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:563)
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
Caused by: java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:430)
at com.jfinal.server.JFinalClassLoader.loadClass(JFinalClassLoader.java:53)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.alibaba.druid.util.JdbcUtils.createDriver(JdbcUtils.java:508)
... 25 more
2017-03-17 17:37:16.603:WARN:oejuc.AbstractLifeCycle:FAILED jfinal: java.lang.RuntimeException: Plugin start error: com.jfinal.plugin.activerecord.ActiveRecordPlugin. |java.sql.SQLException: com.microsoft.sqlserver.jdbc.SQLServerDriver
java.lang.RuntimeException: Plugin start error: com.jfinal.plugin.activerecord.ActiveRecordPlugin. |java.sql.SQLException: com.microsoft.sqlserver.jdbc.SQLServerDriver
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.demo.common.DemoConfig.main(DemoConfig.java:38)
Caused by:
如能解答,万分感激!