浏览 5079 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2004-08-17
在tomcat4.1 下一切正常 程序如下: essionFactory sessionFactory=null; Configuration conf = null; Session ses; conf = new Configuration(); conf=conf.configure(); sessionFactory = conf.buildSessionFactory(); ses = sessionFactory.openSession(); Transaction tran = ses.beginTransaction(); String sql = "from Person as person "; Query query = ses.createQuery(sql); Iterator it= query.iterate(); while(it.hasNext()) { Person per = (Person)it.next(); out.println(per.getAddress()); } tran.commit(); ses.close(); 但到了tomcat 5.0下 出现的以下的错误: description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: Could not find datasource: Name jdbc is not bound in this Context org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:867) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:800) org.apache.jsp.test_jsp._jspService(test_jsp.java:152) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) root cause net.sf.hibernate.HibernateException: Could not find datasource: Name jdbc is not bound in this Context net.sf.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:48) net.sf.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:75) net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:146) net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:594) org.apache.jsp.test_jsp._jspService(test_jsp.java:60) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) 请各位指教 谢谢! 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |
发表时间:2004-08-17
你是不是XX阿?
javax.servlet.ServletException: Could not find datasource: Name jdbc is not bound in this Context Name jdbc is not bound in this Context |
|
返回顶楼 | |
发表时间:2004-08-17
楼上的 我数据源配置了 并测试了可以连接
但是用hibernate 之后就不行了 |
|
返回顶楼 | |
发表时间:2004-08-17
好好差差,肯定是少加了一些包。在webapp中。
|
|
返回顶楼 | |
发表时间:2004-08-17
tomcat4.0和tomcat5.0以上版本配置数量源的方法不同了,重配一下吧。
|
|
返回顶楼 | |
发表时间:2004-08-17
谢谢大家的关注,是因为hibernate包的问题,现已经解决
|
|
返回顶楼 | |
发表时间:2004-08-19
数据原配置乐吗?
|
|
返回顶楼 | |