我用的sql2005数据库,驱动我已经加上了,可还是有这个错
2009-4-10 14:12:11 org.apache.catalina.core.ApplicationContext log
信息: Initializing WebApplicationContext for Struts ActionServlet 'action', module ''
2009-4-10 14:12:14 org.apache.catalina.core.ApplicationContext log
严重: action: null
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: JDBC Driver class not found: com.microsoft.sqlserver.jdbc.SQLServerDriver
Caused by: org.hibernate.HibernateException: JDBC Driver class not found: com.microsoft.sqlserver.jdbc.SQLServerDriver
2009-4-10 14:12:11 org.apache.catalina.core.ApplicationContext log
信息: Initializing WebApplicationContext for Struts ActionServlet 'action', module ''
2009-4-10 14:12:14 org.apache.catalina.core.ApplicationContext log
严重: action: null
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: JDBC Driver class not found: com.microsoft.sqlserver.jdbc.SQLServerDriver
Caused by: org.hibernate.HibernateException: JDBC Driver class not found: com.microsoft.sqlserver.jdbc.SQLServerDriver
解决方案 »
- 请问Java scripts 是什么?
- 异常 空指针 貌似是 请高手救命 献上仅有的40分!急救!
- 第 1 行: ',' 附近有语法错误。
- 帮忙解决这个URL编码问题?Jsp测试页
- 只好请教:同一个jsp文件中前面调用session.getAttribute("id")还能得到值,后面就抛出异常了。。。
- 在一个聊天页面里如何实现游客计数?
- 请问session或application可以存放数组吗?
- 同一个tamcat下发布两个web项目,session共享的问题
- 求助:在windows server 2003下通过jdbc连接mssqlserve出错
- JSP+servlet+JDBC实现,数据库访问问题
- 如何能查询出java程序无法读出的字符,急在线等!
- IE不请求网站,卡在空白页,FF没出这问题。在线等答案啊!
是不是你的驱动有问题呀,版本什么的。
看看在工程目录 lib 下是否有数据库驱动包。
你是用hibernate和struts,你先在database explorer里设置一下,测试,看一下,能连接
import org.jb.common.dao.hibimpl.CommonDAOHibImpl;
import org.jb.ym.entity.SysUser;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
public class test {
public static void main(String[] args) {
// TODO Auto-generated method stub
ApplicationContext context=new FileSystemXmlApplicationContext("classpath:/applicationContext.xml");
SysUser user=new SysUser();
user.setUsrName("aa");
user.setUsrPassword("aa");
user.setUsrFlag(1);
CommonDAOHibImpl commonDAO=(CommonDAOHibImpl)context.getBean("commonDAO");
commonDAO.add(user);
}
}
但是出现错误
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jobCheckLost' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.apache.commons.collections.SetUtils.orderedSet(Ljava/util/Set;)Ljava/util/Set;
Caused by: java.lang.NoSuchMethodError: org.apache.commons.collections.SetUtils.orderedSet(Ljava/util/Set;)Ljava/util/Set;
这应该就是连接数据库的问题吧。您别笑话我啊,也许我问题问题很简单,我刚学ssh,这是别人给我的一个项目,我想通过这个项目学习一下,可就是连接不上数据库呢