您的位置:程序门 -> java -> web 开发



hibernate dialect must be explicitly set的异常


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


hibernate dialect must be explicitly set的异常[已结贴,结贴人:jj_liu]
发表于:2007-01-03 16:04:54 楼主
我的配置文件是这样
<?xml   version= '1.0 '   encoding= 'utf-8 '?>
<!doctype   hibernate-configuration   public
"-//hibernate/hibernate   configuration   dtd   3.0//en "
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd ">


<hibernate-configuration>

    <session-factory>
        <property   name= "hibernate.connection.username "> sa </property>
        <property   name= "hibernate.connection.url "> jdbc:microsoft:sqlserver://localhost:1433:pethospital </property>
        <property   name= "hibernate.dialect "> org.hibernate.dialect.sqlserverdialect </property>
        <property   name= "hibernate.connection.driver_class "> com.microsoft.jdbc.sqlserver.sqlserverdriver </property>

        <mapping   resource= "pethospital/host/hibernate/bean/hostinfo.hbm.xml "> </mapping>
        <mapping   resource= "pethospital/host/hibernate/bean/petinfo.hbm.xml "> </mapping>
    </session-factory>

</hibernate-configuration>

异常是这样
org.hibernate.hibernateexception:   hibernate   dialect   must   be   explicitly   set

at   org.hibernate.dialect.dialectfactory.determinedialect(dialectfactory.java:57)

at   org.hibernate.dialect.dialectfactory.builddialect(dialectfactory.java:39)

at   org.hibernate.cfg.settingsfactory.determinedialect(settingsfactory.java:378)

at   org.hibernate.cfg.settingsfactory.buildsettings(settingsfactory.java:110)

at   org.hibernate.cfg.configuration.buildsettings(configuration.java:1881)

at   org.hibernate.cfg.configuration.buildsessionfactory(configuration.java:1174)

at   pethospital.host.hibernate.hibernatedao. <clinit> (hibernatedao.java:16)
请问如何解决
发表于:2007-01-03 22:21:111楼 得分:20
有可能是你的hibernate配置文件找不到你的映射文件
<mapping   resource= "pethospital/host/hibernate/bean/petinfo.hbm.xml "> </mapping>
注意这句,你的包路径


快速检索

最新资讯
热门点击