`

黑马程序员:hibernate测试异常的解决:Hibernate Validator bean-validator-3.0-JBoss-4.0.2

 
阅读更多
------- android培训 java培训、期待与您交流!-------


hibernate.cfg.xml配置文件如下:
 
<hibernate-configuration>

    <session-factory>

       <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
        <!-- 数据库连接 -->
        <property name="connection.url">jdbc:mysql://localhost:3306/db_database14</property>
        <!-- 数据库连接用户名 -->
        <property name="connection.username">root</property>
        <!-- 数据库连接密码 -->
        <property name="connection.password">root</property>
        <!-- 数据库驱动 -->
        <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
        <!-- 打印SQL语句 -->
        <property name="show_sql">true</property>
        <!-- 自动建表 -->

        <!-- Drop and re-create the database schema on startup -->
        <property name="hbm2ddl.auto">create</property>

        <mapping resource="org/hibernate/tutorial/hbm/Event.hbm.xml"/>

    </session-factory>

</hibernate-configuration>


测试的时候包以下异常:
引用
2012-5-23 23:01:53 org.hibernate.annotations.common.Version <clinit>
信息: Hibernate Commons Annotations 3.2.0.Final
2012-5-23 23:01:53 org.hibernate.cfg.Environment <clinit>
信息: Hibernate 3.6.10.Final
2012-5-23 23:01:53 org.hibernate.cfg.Environment <clinit>
信息: hibernate.properties not found
2012-5-23 23:01:53 org.hibernate.cfg.Environment buildBytecodeProvider
信息: Bytecode provider name : javassist
2012-5-23 23:01:53 org.hibernate.cfg.Environment <clinit>
信息: using JDK 1.4 java.sql.Timestamp handling
2012-5-23 23:01:53 org.hibernate.cfg.Configuration configure
信息: configuring from resource: /hibernate.cfg.xml
2012-5-23 23:01:53 org.hibernate.cfg.Configuration getConfigurationInputStream
信息: Configuration resource: /hibernate.cfg.xml
2012-5-23 23:01:53 org.hibernate.cfg.Configuration addResource
信息: Reading mappings from resource : org/hibernate/tutorial/hbm/Event.hbm.xml
2012-5-23 23:01:53 org.hibernate.cfg.Configuration doConfigure
信息: Configured SessionFactory: null
2012-5-23 23:01:53 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
信息: Mapping class: org.hibernate.tutorial.hbm.Event -> EVENTS
2012-5-23 23:01:53 org.hibernate.cfg.Configuration applyHibernateValidatorLegacyConstraintsOnDDL
信息: Hibernate Validator not found: ignoring
2012-5-23 23:01:53 org.hibernate.validator.util.Version <clinit>
信息: Hibernate Validator bean-validator-3.0-JBoss-4.0.2


解决方案,在配置文件中加上下面一句既可:
<property name="javax.persistence.validation.mode">none</property>  


------- android培训 java培训、期待与您交流!-------


详细请查看:http://edu.csdn.net/heima -------
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics