配置HibernateMappingFile的时候出现的错误

ivan_fang 2008-06-15 07:35:14
当配置HibernateMappingFile的时候 (点击Refresh),显示错误如下:This is mostly due to URL not matching the expected value by JDBC driver 。
...全文
180 25 打赏 收藏 转发到动态 举报
写回复
用AI写文章
25 条回复
切换为时间正序
请发表友善的回复…
发表回复
cccyyyfff411024 2009-05-26
  • 打赏
  • 举报
回复
破天荒的遇到了同样的问题
youngsun1983 2008-06-15
  • 打赏
  • 举报
回复
呵呵,客气了
ivan_fang 2008-06-15
  • 打赏
  • 举报
回复
youngsun1983 非常感谢!!!
yami251139 2008-06-15
  • 打赏
  • 举报
回复
其实me里面连数据库也只是测试而已
你用工具不能连并不代表代码也不能连
你写个jdbc试试看能不能连不就好了
hibernate就算不用工具也是可以连的
youngsun1983 2008-06-15
  • 打赏
  • 举报
回复
jdbc:mysql://localhost:3306/sampledb
少个冒号
ivan_fang 2008-06-15
  • 打赏
  • 举报
回复
谁碰到过这个问题啊,指导一下
ivan_fang 2008-06-15
  • 打赏
  • 举报
回复
以前没碰到过这个问题啊,我选了MYSQL驱动了,但不知道是否还有其他地方也需要选择
yami251139 2008-06-15
  • 打赏
  • 举报
回复
那个是生成的。。。没什么用
==============================
你是不是别的什么地方
数据库连接的那个东西没有选或选的不对?
他说你database connection 没有输入(@#%@&¥%(&@很奇怪饿。。
还说你输入的url和驱动不适合。。。
你仔细查下这两块看看?
ivan_fang 2008-06-15
  • 打赏
  • 举报
回复
hibernate.lib=hibernate3.jar
hibernate.ignorecheck=true

ant.lib=ant-1.6.5.jar
ant.version=1.6.5
ant.name=Ant core
ant.when=buildtime

ant-antlr.lib=ant-antlr-1.6.5.jar
ant-antlr.version=1.6.5
ant-antlr.name=Ant antlr support
ant-antlr.when=buildtime

ant-junit.lib=ant-junit-1.6.5.jar
ant-junit.version=1.6.5
ant-junit.name=Ant junit support
ant-junit.when=buildtime

ant-launcher.lib=ant-launcher-1.6.5.jar
ant-launcher.version=1.6.5
ant-launcher.name=Ant launcher
ant-launcher.when=buildtime

ant-swing.lib=ant-swing-1.6.5.jar
ant-swing.version=1.6.5
ant-swing.name=Ant swing support
ant-swing.when=buildtime

junit.lib=junit-3.8.1.jar
junit.version=3.8.1
junit.name=JUnit test framework
junit.when=buildtime

checkstyle.lib=checkstyle-all.jar
checkstyle.name=Checkstyle
checkstyle.when=buildtime

cleanimports.lib=cleanimports.jar
cleanimports.name=cleanimports
cleanimports.when=buildtime
hibernate.version=3.0
hibernate.name=Hibernate core
hibernate.when=runtime, required

versioncheck.lib=versioncheck.jar
versioncheck.version=1.0
versioncheck.name=version checker
versioncheck.when=buildtime

syndiag.lib=syndiag2.jar
syndiag.version=2.0
syndiag.name=antlr to bnf image generator
syndiag.when=buildtime

cglib.lib=cglib-2.1.3.jar
cglib.version=2.1.3
cglib.name=CGLIB bytecode generator
cglib.when=runtime, required

asm.lib=asm.jar
asm.name=ASM bytecode library
asm.when=runtime, required

asm-attrs.lib=asm-attrs.jar
asm-attrs.name=ASM bytecode library
asm-attrs.when=runtime, required

commons-collections.lib=commons-collections-2.1.1.jar
commons-collections.version=2.1.1
commons-collections.name=Commons Collections
commons-collections.when=runtime, required

commons-logging.lib=commons-logging-1.0.4.jar
commons-logging.version=1.0.4
commons-logging.name=Commons Logging
commons-logging.when=runtime, required

antlr.lib=antlr-2.7.6rc1.jar
antlr.version=2.7.6rc1
antlr.name=ANother Tool for Language Recognition
antlr.when=runtime, required

## xml/xslt handling

dom4j.lib=dom4j-1.6.1.jar
dom4j.version=1.6.1
dom4j.name=XML configuration & mapping parser
dom4j.when=runtime, required

jaxen.lib=jaxen-1.1-beta-7.jar
jaxen.version=1.1-beta-7
jaxen.name=Jaxen - universal java xpath engine
jaxen.when=runtime, required if you want to deserialize a Configuration to improve startup performance

xerces.lib=xerces-2.6.2.jar
xerces.version=2.6.2
xerces.name=SAX parser
xerces.when=runtime, required for JDK < 1.4

xml-apis.lib=xml-apis.jar
xml-apis.name=Standard JAXP API
xml-apis.when=runtime, some SAX parser is required

## j2ee related

jdbc-stdext.lib=jdbc2_0-stdext.jar
jdbc-stdext.version=2.0
jdbc-stdext.name=Standard Extension JDBC APIs
jdbc-stdext.when=runtime, required for standalone operation (outside application server)

jta.lib=jta.jar
jta.name=Standard JTA API
jta.when=runtime, required for standalone operation (outside application server)

connector.lib=connector.jar
connector.name=Standard JCA API
connector.when=runtime, optional

jaas.lib=jaas.jar
jaas.name=Standard JAAS API
jaas.when=runtime, optional (required by JCA)

log4j.lib=log4j-1.2.11.jar
log4j.version=1.2.11
log4j.name=Log4j Library
log4j.when=runtime, optional

## Treecache

jboss-cache.lib=jboss-cache.jar
jboss-cache.version=1.2.2 alpha
jboss-cache.name=TreeCache clustered cache
jboss-cache.when=runtime, optional

concurrent.lib=concurrent-1.3.2.jar
concurrent.version=1.3.2
concurrent.when=runtime, optional (required by TreeCache)

jboss-common.lib=jboss-common.jar
jboss-common.when=runtime, optional (required by TreeCache)

jboss-jmx.lib=jboss-jmx.jar
jboss-jmx.when=runtime, optional (required by TreeCache)

jboss-system.lib=jboss-system.jar
jboss-system.when=runtime, optional (required by TreeCache)

## Replication

jgroups.lib=jgroups-2.2.8.jar
jgroups.version=2.2.8
jgroups.name=JGroups multicast library
jgroups.when=runtime, optional (required by replicated caches)

## cache providers

ehcache.lib=ehcache-1.1.jar
ehcache.version=1.1
ehcache.name=EHCache cache
ehcache.when=runtime, optional (required if no other cache provider is set)

oscache.lib=oscache-2.1.jar
oscache.version=2.1
oscache.name=OpenSymphony OSCache
oscache.when=runtime, optional

swarmcache.lib=swarmcache-1.0rc2.jar
swarmcache.version=1.0rc2
swarmcache.name=runtime, optional
swarmcache.when=runtime, optional

## connection pool

c3p0.lib=c3p0-0.9.0.jar
c3p0.version=0.9.0
c3p0.name=C3P0 JDBC connection pool
c3p0.when=runtime, optional

proxool.lib=proxool-0.8.3.jar
proxool.version=0.8.3
proxool.name=Proxool JDBC connection pool
proxool.when=runtime, optional


jacc.lib=jacc-1_0-fr.jar
jacc.version=1.0-fr
jacc.name=JACC Library
jacc.when=runtime, optional

yami251139 2008-06-15
  • 打赏
  • 举报
回复
你打开他看下
里面有没有path之类的东西?
或者里面东西发上来看下。。。
ivan_fang 2008-06-15
  • 打赏
  • 举报
回复
JAR都加了,但是version.properties我不知道放哪?
yami251139 2008-06-15
  • 打赏
  • 举报
回复
[Quote=引用 8 楼 yami251139 的回复:]
不是还有个properties么
里面是什么?填了么?
[/Quote]
顺便问下,你的jar加了么?
ivan_fang 2008-06-15
  • 打赏
  • 举报
回复
我本地的hibernate.cfg.xml里面密码也写了的
yami251139 2008-06-15
  • 打赏
  • 举报
回复
hibernate.cfg.xml里面
ivan_fang 2008-06-15
  • 打赏
  • 举报
回复
填了的,和那个对话框里的一样的
yami251139 2008-06-15
  • 打赏
  • 举报
回复
password没填?
ivan_fang 2008-06-15
  • 打赏
  • 举报
回复
你说的是hibernate.cfg.xml吗,

代码如下:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
<session-factory >

<!-- local connection properties -->
<property name="hibernate.connection.url">jdbc:mysql//localhost:3306/sampledb</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password"></property>
<!-- property name="hibernate.connection.pool_size"></property -->

<!-- dialect for MySQL -->
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>

<property name="hibernate.show_sql">false</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
</session-factory>
</hibernate-configuration>
yami251139 2008-06-15
  • 打赏
  • 举报
回复
不是还有个properties么
里面是什么?填了么?
ivan_fang 2008-06-15
  • 打赏
  • 举报
回复
我已经把MYSQL的驱动包加到类库了,而且换过2个版本的MYSQL包,都是这个错误
Shine_Panda 2008-06-15
  • 打赏
  • 举报
回复
没有连过MySQL不晓得有不要什么驱动包之类的。
加载更多回复(5)

67,538

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧