已有258人关注
编Java时遇到的错误(其实是Java从入门到精通(第2版)(实例版)的,只是没找到)
发表在Java答疑区 2019-03-07 悬赏:50 学分
是否精华
版块置顶:

我编Java最后的酒店管理系统时,总会出现以下错误:

java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver

at java.net.URLClassLoader.findClass(URLClassLoader.java:382)

at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)

at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:264)

at com.mwq.dao.JDBC.<clinit>(JDBC.java:18)

at com.mwq.dao.BaseDao.selectSomeValue(BaseDao.java:61)

at com.mwq.dao.Dao.sUserNameOfNotFreeze(Dao.java:23)

at com.mwq.frame.LandFrame.<init>(LandFrame.java:148)

at com.mwq.DrinkeryManage.<init>(DrinkeryManage.java:16)

at com.mwq.DrinkeryManage$1.run(DrinkeryManage.java:37)

at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)

at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)

at java.awt.EventQueue.access$500(EventQueue.java:97)

at java.awt.EventQueue$3.run(EventQueue.java:709)

at java.awt.EventQueue$3.run(EventQueue.java:703)

at java.security.AccessController.doPrivileged(Native Method)

at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)

at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)

at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)

at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

java.sql.SQLException: No suitable driver found for jdbc:sqlserver://baiweiming:1433;DatabaseName=db_DrinkeryManage1

at java.sql.DriverManager.getConnection(DriverManager.java:689)

at java.sql.DriverManager.getConnection(DriverManager.java:247)

at com.mwq.dao.JDBC.getConnection(JDBC.java:28)

at com.mwq.dao.BaseDao.selectSomeValue(BaseDao.java:61)

at com.mwq.dao.Dao.sUserNameOfNotFreeze(Dao.java:23)

at com.mwq.frame.LandFrame.<init>(LandFrame.java:148)

at com.mwq.DrinkeryManage.<init>(DrinkeryManage.java:16)

at com.mwq.DrinkeryManage$1.run(DrinkeryManage.java:37)

at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)

at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)

at java.awt.EventQueue.access$500(EventQueue.java:97)

at java.awt.EventQueue$3.run(EventQueue.java:709)

at java.awt.EventQueue$3.run(EventQueue.java:703)

at java.security.AccessController.doPrivileged(Native Method)

at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)

at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)

at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)

at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException

at com.mwq.dao.BaseDao.selectSomeValue(BaseDao.java:63)

at com.mwq.dao.Dao.sUserNameOfNotFreeze(Dao.java:23)

at com.mwq.frame.LandFrame.<init>(LandFrame.java:148)

at com.mwq.DrinkeryManage.<init>(DrinkeryManage.java:16)

at com.mwq.DrinkeryManage$1.run(DrinkeryManage.java:37)

at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)

at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)

at java.awt.EventQueue.access$500(EventQueue.java:97)

at java.awt.EventQueue$3.run(EventQueue.java:709)

at java.awt.EventQueue$3.run(EventQueue.java:703)

at java.security.AccessController.doPrivileged(Native Method)

at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)

at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)

at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)

at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

下面的是debug之后添加的两行:

ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2

JDWP exit error AGENT_ERROR_NO_JNI_ENV(183):  [util.c:840]

怎么办?

而且每一回只要程序中加入了一张图片就不能运行,总是超级多的错误。

求帮助!

2019-03-07 12:47:18编辑
分享到:
精彩评论 1
根号申
学分:4736 LV12
TA的每日心情
2021-07-16 23:48:46
2019-03-08
沙发

java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver

没导入驱动包

首页上一页 1 下一页尾页 1 条记录 1/1页
手机同步功能介绍
友情提示:以下图书配套资源能够实现手机同步功能
明日微信公众号
明日之星 明日之星编程特训营
客服热线(每日9:00-17:00)
400 675 1066
mingrisoft@mingrisoft.com
吉林省明日科技有限公司Copyright ©2007-2022,mingrisoft.com, All Rights Reserved长春市北湖科技开发区盛北大街3333号长春北湖科技园项目一期A10号楼四、五层
吉ICP备10002740号-2吉公网安备22010202000132经营性网站备案信息 营业执照