发帖    主题    评论    推荐    标签    作者    订阅    查搜    注册   登陆   关注
 
面向对象 设计模式 领域驱动设计 企业架构 框架 开发教程 微服务 大数据 扩展性 并发编程 事件驱动 分布式 CQRS

hibernate配置jndi的问题

2006-05-26 13:41
赞助商链接

我在tomcat里配好了jndi,测试了一下,没有问题,但我用在hibernet里时就报错.
13:10:39,484 INFO DatasourceConnectionProvider:51 - Using datasource: java:comp/env/jdbc/TestDB
13:10:39,500 WARN SettingsFactory:103 - Could not obtain connection metadata
org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:780)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:59)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:72)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1463)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1004)
at com.lib.ygt.basic.HibernateUtil.<clinit>(HibernateUtil.java:18)
at com.lib.ygt.userlogininfo.CheckUpUserLoginInfo.findUserCLoginid(CheckUpUserLoginInfo.java:33)
at com.lib.ygt.userlogininfo.UserLoginInfo.CheckUpUserLoginInfo(UserLoginInfo.java:38)
at com.lib.ygt.userlogininfo.servlet.UserLoginInfoServlet.service(UserLoginInfoServlet.java:32)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at com.lib.ygt.util.EncodingFilter.doFilter(EncodingFilter.java:23)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at com.lib.ygt.util.PowerFilter.doFilter(PowerFilter.java:56)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Unknown Source)
Caused by: java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getDriver(Unknown Source)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:773)
... 40 more
13:10:39,578 INFO Dialect:92 - Using dialect: org.hibernate.dialect.Oracle9Dialect

hibernate.cfg.xml里的配置是这样的:
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
<!--<session-factory name="java:hibernate/SessionFactory">-->

<session-factory>

<property name="show_sql">true</property>
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="connection.datasource">java:comp/env/jdbc/TestDB</property>
<mapping resource="com/lib/ygt/database/TGwSmj.hbm.xml"/>
</session-factory>
</hibernate-configuration>
报错信息说的是驱动有问题,我查了一下应该没有问题.请大侠帮帮我

2006-05-26 13:50


<session-factory>

<property name="show_sql">true</property>
<property name=
"dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name=
"connection.datasource">java:comp/env/jdbc/TestDB</property>
<mapping resource=
"com/lib/ygt/database/TTempZf.hbm.xml"/>

</session-factory>

2006-05-26 13:53

上面是hibernate.cfg.xml的配置信息
我用的是jsp+servlet+bean+hibernate结构

赞助商链接

赞助商链接

返回顶部

移动版 关于本站 使用帮助 联系管理员 最佳分辨率1366x768
OpenSource JIVEJDON Powered by JdonFramework Code © 2002-20 jdon.com