对hibernate关系映射求解(双向1-N)

youc 发布于 2012/02/26 22:28
阅读 1K+
收藏 0

运行时出错如下:

run:

log4j:WARN No appenders could be found for logger (org.hibernate.cfg.annotations.Version).

log4j:WARN Please initialize the log4j system properly.

Initial SessionFactory creation failed.org.hibernate.MappingException: invalid configuration

Exception in thread "main" java.lang.ExceptionInInitializerError

at cn.micblog.utils.HibernateUtil.<clinit>(HibernateUtil.java:28)

at cn.micblog.test.DBTest.main(DBTest.java:20)

Caused by: org.hibernate.MappingException: invalid configuration

at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1521)

at org.hibernate.cfg.AnnotationConfiguration.doConfigure(AnnotationConfiguration.java:1035)

at org.hibernate.cfg.AnnotationConfiguration.doConfigure(AnnotationConfiguration.java:64)

at org.hibernate.cfg.Configuration.configure(Configuration.java:1462)

at org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:1017)

at org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:64)

at org.hibernate.cfg.Configuration.configure(Configuration.java:1448)

at org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:1011)

at cn.micblog.utils.HibernateUtil.<clinit>(HibernateUtil.java:24)

... 1 more

Caused by: org.xml.sax.SAXParseException: The content of element type "session-factory" must match "(property*,mapping*,(class-cache|collection-cache)*,event*,listener*)".

at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)

at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)

at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)

at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)

at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValidator.java:2017)

at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator.java:901)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1782)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2938)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)

at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)

at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)

at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)

at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)

at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)

at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)

at org.dom4j.io.SAXReader.read(SAXReader.java:465)

at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1518)

... 9 more

Java Result: 1

成功生成(总时间:2 秒)

这是我的两个配置文件 请高手帮忙看看

 这是1-N中代表1的那端
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE hibernate-mapping PUBLIC
  "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
  "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
    <class name="cn.micblog.domain.UserBean" table="userbean" catalog="kd_micro_blogging">
        <!-- 主键的设置-->
        <id name="id" type="String" >
            <column name="id" ></column>
            <generator class="native"></generator>
        </id>
        <property name="user_id" cloumn="user_id" type="String" ></property>
        <property name="stu_num" cloumn="stu_num" type="String" ></property>
        <property name="photo" cloumn="photo" type="blob" ></property>
        <property name="age" cloumn="age" type="String" ></property>
        <property name="sex" cloumn="sex" type="String" ></property>
        <property name="R_date" cloumn="R_date" type="Date" ></property>
        <property name="location" cloumn="location" type="String" ></property>
        <property name="B_id" cloumn="B_id" type="String" ></property>
        <property name="C_id" cloumn="C_id" type="String" ></property>
        <set name= "messagebean" >
            <key column="M_id"></key>
            <one-to-many  class = "MessageBean"  unique="true"></one-to-many>
        </set>
    </class>
</hibernate-mapping>


这是1-N中代表N的那端

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE hibernate-mapping PUBLIC
  "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
  "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
    <class name="cn.micblog.domain.MessageBean" table="messagebean" catalog="kd_micro_blogging">
        <!-- 主键的设置-->
        <id name="m_id" type="String" >
            <column name="m_id" ></column>
            <generator class="native"></generator>
        </id>
        <property name="contents" cloumn="contents" type="String" ></property>
        <property name="id" cloumn="id" type="String" ></property>
        <property name="Re_num" cloumn="Re_num" type="int" ></property>
        <property name="Col_num" cloumn="Col_num" type="int" ></property>
        <property name="M_date" cloumn="M_date" type="String" ></property>
    </class>
</hibernate-mapping>


加载中
0
youc
youc
也可以QQ我:357649479 小弟刚开始玩hibernate  多谢高手们的指点!!!!
0
youc
youc
上面的QQ错了  是357649470
0
Midnight
Midnight

引用来自“youc”的答案

上面的QQ错了  是357649470

0
黄龍
黄龍

The content of element type "session-factory" must match "(property*,mapping*,(class-cache|collection-cache)*,event*,listener*)"

发你的hibernate.cfg.xml配置文件出来看看吧!

0
youc
youc

这次能找到了 谢谢 报新错误了

log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).

log4j:WARN Please initialize the log4j system properly.

Exception in thread "main" java.lang.ExceptionInInitializerError

at cn.micblog.test.DBTest.main(DBTest.java:22)

Caused by: org.hibernate.MappingException: Association references unmapped class: MessageBean

at org.hibernate.cfg.HbmBinder.bindCollectionSecondPass(HbmBinder.java:2399)

at org.hibernate.cfg.HbmBinder$CollectionSecondPass.secondPass(HbmBinder.java:2678)

at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:66)

at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1177)

at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1333)

at cn.micblog.utils.HibernateUtil.<clinit>(HibernateUtil.java:20)

... 1 more


0
youc
youc

引用来自“HL_Simon”的答案

The content of element type "session-factory" must match "(property*,mapping*,(class-cache|collection-cache)*,event*,listener*)"

发你的hibernate.cfg.xml配置文件出来看看吧!

[2012-02-27 20:03:40] INFO  org.hibernate.cfg.Environment - Hibernate 3.3.2.GA
[2012-02-27 20:03:40] INFO  org.hibernate.cfg.Environment - hibernate.properties not found
[2012-02-27 20:03:40] INFO  org.hibernate.cfg.Environment - Bytecode provider name : javassist
[2012-02-27 20:03:40] INFO  org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
[2012-02-27 20:03:40] INFO  org.hibernate.cfg.Configuration - configuring from resource: hibernate.cfg.xml
[2012-02-27 20:03:40] INFO  org.hibernate.cfg.Configuration - Configuration resource: hibernate.cfg.xml
[2012-02-27 20:03:40] DEBUG org.hibernate.util.DTDEntityResolver - trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd]
[2012-02-27 20:03:40] DEBUG org.hibernate.util.DTDEntityResolver - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
[2012-02-27 20:03:40] DEBUG org.hibernate.util.DTDEntityResolver - located [http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd] in classpath
[2012-02-27 20:03:40] DEBUG org.hibernate.cfg.Configuration - hibernate.dialect=org.hibernate.dialect.MySQLDialect
[2012-02-27 20:03:40] DEBUG org.hibernate.cfg.Configuration - hibernate.connection.driver_class=com.mysql.jdbc.Driver
[2012-02-27 20:03:40] DEBUG org.hibernate.cfg.Configuration - hibernate.connection.url=jdbc:mysql://localhost:3306/kd_micro_blogging
[2012-02-27 20:03:40] DEBUG org.hibernate.cfg.Configuration - hibernate.connection.username=root
[2012-02-27 20:03:40] DEBUG org.hibernate.cfg.Configuration - hibernate.connection.password=youc
[2012-02-27 20:03:40] DEBUG org.hibernate.cfg.Configuration - hbm2ddl.auto=update
[2012-02-27 20:03:40] DEBUG org.hibernate.cfg.Configuration - current_session_context_class=thread
[2012-02-27 20:03:40] DEBUG org.hibernate.cfg.Configuration - null<-org.dom4j.tree.DefaultAttribute@2a6f16 [Attribute: name resource value "cn/micblog/domain/MessageBean.hbm.xml"]
[2012-02-27 20:03:40] INFO  org.hibernate.cfg.Configuration - Reading mappings from resource : cn/micblog/domain/MessageBean.hbm.xml
[2012-02-27 20:03:40] DEBUG org.hibernate.util.DTDEntityResolver - trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd]
[2012-02-27 20:03:40] DEBUG org.hibernate.util.DTDEntityResolver - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
[2012-02-27 20:03:40] DEBUG org.hibernate.util.DTDEntityResolver - located [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd] in classpath
[2012-02-27 20:03:40] INFO  org.hibernate.cfg.HbmBinder - Mapping class: cn.micblog.domain.MessageBean -> blog_message
[2012-02-27 20:03:40] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: messageid -> messageid
[2012-02-27 20:03:40] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: contents -> contents
[2012-02-27 20:03:40] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: createDate -> createDate
[2012-02-27 20:03:40] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: user -> userid
[2012-02-27 20:03:40] DEBUG org.hibernate.cfg.Configuration - null<-org.dom4j.tree.DefaultAttribute@ac6a45 [Attribute: name resource value "cn/micblog/domain/UserBean.hbm.xml"]
[2012-02-27 20:03:40] INFO  org.hibernate.cfg.Configuration - Reading mappings from resource : cn/micblog/domain/UserBean.hbm.xml
[2012-02-27 20:03:40] DEBUG org.hibernate.util.DTDEntityResolver - trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd]
[2012-02-27 20:03:40] DEBUG org.hibernate.util.DTDEntityResolver - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
[2012-02-27 20:03:40] DEBUG org.hibernate.util.DTDEntityResolver - located [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd] in classpath
[2012-02-27 20:03:40] INFO  org.hibernate.cfg.HbmBinder - Mapping class: cn.micblog.domain.UserBean -> blog_user
[2012-02-27 20:03:40] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: userid -> userid
[2012-02-27 20:03:40] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: name -> name
[2012-02-27 20:03:40] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: nickname -> nickname
[2012-02-27 20:03:40] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: stu_num -> stu_num
[2012-02-27 20:03:40] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: photo -> photo
[2012-02-27 20:03:40] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: age -> age
[2012-02-27 20:03:40] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: sex -> sex
[2012-02-27 20:03:40] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: R_date -> R_date
[2012-02-27 20:03:40] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: location -> location
[2012-02-27 20:03:40] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: B_id -> B_id
[2012-02-27 20:03:40] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: C_id -> C_id
[2012-02-27 20:03:40] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: messages
[2012-02-27 20:03:40] INFO  org.hibernate.cfg.Configuration - Configured SessionFactory: null
[2012-02-27 20:03:40] DEBUG org.hibernate.cfg.Configuration - properties: {hibernate.connection.password=youc, java.runtime.name=Java(TM) SE Runtime Environment, sun.boot.library.path=D:\jdk1.6.0_23\jre\bin, java.vm.version=19.0-b09, hibernate.connection.username=root, java.vm.vendor=Sun Microsystems Inc., java.vendor.url=http://java.sun.com/, path.separator=;, java.vm.name=Java HotSpot(TM) Client VM, file.encoding.pkg=sun.io, user.country=CN, sun.java.launcher=SUN_STANDARD, sun.os.patch.level=Service Pack 1, java.vm.specification.name=Java Virtual Machine Specification, user.dir=D:\work\kd_Micro-blogging, java.runtime.version=1.6.0_23-b05, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, hbm2ddl.auto=update, hibernate.current_session_context_class=thread, java.endorsed.dirs=D:\jdk1.6.0_23\jre\lib\endorsed, os.arch=x86, java.io.tmpdir=C:\Users\youc\AppData\Local\Temp\, line.separator=
, java.vm.specification.vendor=Sun Microsystems Inc., user.variant=, os.name=Windows 7, sun.jnu.encoding=GBK, java.library.path=D:\jdk1.6.0_23\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;D:/jdk1.6.0_23/bin/../jre/bin/client;D:/jdk1.6.0_23/bin/../jre/bin;D:/jdk1.6.0_23/bin/../jre/lib/i386;D:\jdk1.6.0_23\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;d:\Program Files\Tencent\QQPCMgr\6.6.2156.401;D:\Program Files\MySQL\MySQL Server 5.1\bin;d:\Program Files\Tencent\QQPCMgr\6.6.2156.401;D:\eclipse;, java.specification.name=Java Platform API Specification, java.class.version=50.0, sun.management.compiler=HotSpot Client Compiler, os.version=6.1, user.home=C:\Users\youc, user.timezone=Asia/Shanghai, java.awt.printerjob=sun.awt.windows.WPrinterJob, file.encoding=UTF-8, java.specification.version=1.6, hibernate.connection.driver_class=com.mysql.jdbc.Driver, user.name=youc, java.class.path=D:\work\kd_Micro-blogging\WebContent\WEB-INF\classes;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\antlr-2.7.6.jar;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\commons-collections-3.1.jar;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\commons-logging.jar;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\dom4j-1.6.1.jar;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\ehcache-1.2.3.jar;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\ejb3-persistence.jar;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\hibernate-annotations.jar;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\hibernate-cglib-repack-2.1_3.jar;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\hibernate-commons-annotations.jar;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\hibernate-entitymanager.jar;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\hibernate3.jar;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\javassist-3.4.GA.jar;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\jta-1.1.jar;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\log4j.jar;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\slf4j-api-1.5.2.jar;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\slf4j-log4j12.jar;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\derbyclient.jar;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\classes12.jar;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\mysql-connector-java-5.1.14-bin.jar, hibernate.bytecode.use_reflection_optimizer=false, current_session_context_class=thread, java.vm.specification.version=1.0, java.home=D:\jdk1.6.0_23\jre, sun.arch.data.model=32, hibernate.connection.url=jdbc:mysql://localhost:3306/kd_micro_blogging, hibernate.dialect=org.hibernate.dialect.MySQLDialect, user.language=zh, java.specification.vendor=Sun Microsystems Inc., awt.toolkit=sun.awt.windows.WToolkit, java.vm.info=mixed mode, java.version=1.6.0_23, java.ext.dirs=D:\jdk1.6.0_23\jre\lib\ext;C:\Windows\Sun\Java\lib\ext, sun.boot.class.path=D:\jdk1.6.0_23\jre\lib\resources.jar;D:\jdk1.6.0_23\jre\lib\rt.jar;D:\jdk1.6.0_23\jre\lib\sunrsasign.jar;D:\jdk1.6.0_23\jre\lib\jsse.jar;D:\jdk1.6.0_23\jre\lib\jce.jar;D:\jdk1.6.0_23\jre\lib\charsets.jar;D:\jdk1.6.0_23\jre\lib\modules\jdk.boot.jar;D:\jdk1.6.0_23\jre\classes, java.vendor=Sun Microsystems Inc., file.separator=\, hibernate.hbm2ddl.auto=update, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, sun.io.unicode.encoding=UnicodeLittle, sun.cpu.endian=little, sun.desktop=windows, sun.cpu.isalist=pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86}
[2012-02-27 20:03:40] DEBUG org.hibernate.cfg.Configuration - Preparing to build session factory with filters : {}
[2012-02-27 20:03:40] DEBUG org.hibernate.cfg.Configuration - processing extends queue
[2012-02-27 20:03:40] DEBUG org.hibernate.cfg.Configuration - processing collection mappings
[2012-02-27 20:03:40] DEBUG org.hibernate.cfg.CollectionSecondPass - Second pass for collection: cn.micblog.domain.UserBean.messages
[2012-02-27 20:03:40] INFO  org.hibernate.cfg.HbmBinder - Mapping collection: cn.micblog.domain.UserBean.messages -> blog_message
[2012-02-27 20:03:40] DEBUG org.hibernate.cfg.CollectionSecondPass - Mapped collection key: userid, one-to-many: cn.micblog.domain.MessageBean
[2012-02-27 20:03:40] DEBUG org.hibernate.cfg.Configuration - processing native query and ResultSetMapping mappings
[2012-02-27 20:03:40] DEBUG org.hibernate.cfg.Configuration - processing association property references
[2012-02-27 20:03:40] DEBUG org.hibernate.cfg.Configuration - processing foreign key constraints
[2012-02-27 20:03:40] DEBUG org.hibernate.cfg.Configuration - resolving reference to class: cn.micblog.domain.UserBean
[2012-02-27 20:03:40] INFO  org.hibernate.connection.DriverManagerConnectionProvider - Using Hibernate built-in connection pool (not for production use!)
[2012-02-27 20:03:40] INFO  org.hibernate.connection.DriverManagerConnectionProvider - Hibernate connection pool size: 20
[2012-02-27 20:03:40] INFO  org.hibernate.connection.DriverManagerConnectionProvider - autocommit mode: false
[2012-02-27 20:03:40] INFO  org.hibernate.connection.DriverManagerConnectionProvider - using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost:3306/kd_micro_blogging
[2012-02-27 20:03:40] INFO  org.hibernate.connection.DriverManagerConnectionProvider - connection properties: {user=root, password=youc}
[2012-02-27 20:03:40] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - opening new JDBC connection
[2012-02-27 20:03:41] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - created connection to: jdbc:mysql://localhost:3306/kd_micro_blogging, Isolation Level: 4
[2012-02-27 20:03:41] INFO  org.hibernate.cfg.SettingsFactory - RDBMS: MySQL, version: 5.1.54-community
[2012-02-27 20:03:41] INFO  org.hibernate.cfg.SettingsFactory - JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.1.14 ( Revision: ${bzr.revision-id} )
[2012-02-27 20:03:41] INFO  org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.MySQLDialect
[2012-02-27 20:03:41] INFO  org.hibernate.transaction.TransactionFactoryFactory - Using default transaction strategy (direct JDBC transactions)
[2012-02-27 20:03:41] INFO  org.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
[2012-02-27 20:03:41] INFO  org.hibernate.cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled
[2012-02-27 20:03:41] INFO  org.hibernate.cfg.SettingsFactory - Automatic session close at end of transaction: disabled
[2012-02-27 20:03:41] INFO  org.hibernate.cfg.SettingsFactory - JDBC batch size: 15
[2012-02-27 20:03:41] INFO  org.hibernate.cfg.SettingsFactory - JDBC batch updates for versioned data: disabled
[2012-02-27 20:03:41] INFO  org.hibernate.cfg.SettingsFactory - Scrollable result sets: enabled
[2012-02-27 20:03:41] DEBUG org.hibernate.cfg.SettingsFactory - Wrap result sets: disabled
[2012-02-27 20:03:41] INFO  org.hibernate.cfg.SettingsFactory - JDBC3 getGeneratedKeys(): enabled
[2012-02-27 20:03:41] INFO  org.hibernate.cfg.SettingsFactory - Connection release mode: auto
[2012-02-27 20:03:41] INFO  org.hibernate.cfg.SettingsFactory - Maximum outer join fetch depth: 2
[2012-02-27 20:03:41] INFO  org.hibernate.cfg.SettingsFactory - Default batch fetch size: 1
[2012-02-27 20:03:41] INFO  org.hibernate.cfg.SettingsFactory - Generate SQL with comments: disabled
[2012-02-27 20:03:41] INFO  org.hibernate.cfg.SettingsFactory - Order SQL updates by primary key: disabled
[2012-02-27 20:03:41] INFO  org.hibernate.cfg.SettingsFactory - Order SQL inserts for batching: disabled
[2012-02-27 20:03:41] INFO  org.hibernate.cfg.SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
[2012-02-27 20:03:41] INFO  org.hibernate.hql.ast.ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory
[2012-02-27 20:03:41] INFO  org.hibernate.cfg.SettingsFactory - Query language substitutions: {}
[2012-02-27 20:03:41] INFO  org.hibernate.cfg.SettingsFactory - JPA-QL strict compliance: disabled
[2012-02-27 20:03:41] INFO  org.hibernate.cfg.SettingsFactory - Second-level cache: enabled
[2012-02-27 20:03:41] INFO  org.hibernate.cfg.SettingsFactory - Query cache: disabled
[2012-02-27 20:03:41] INFO  org.hibernate.cfg.SettingsFactory - Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory
[2012-02-27 20:03:41] INFO  org.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: disabled
[2012-02-27 20:03:41] INFO  org.hibernate.cfg.SettingsFactory - Structured second-level cache entries: disabled
[2012-02-27 20:03:41] INFO  org.hibernate.cfg.SettingsFactory - Statistics: disabled
[2012-02-27 20:03:41] INFO  org.hibernate.cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled
[2012-02-27 20:03:41] INFO  org.hibernate.cfg.SettingsFactory - Default entity-mode: pojo
[2012-02-27 20:03:41] INFO  org.hibernate.cfg.SettingsFactory - Named query checking : enabled
[2012-02-27 20:03:41] INFO  org.hibernate.impl.SessionFactoryImpl - building session factory
[2012-02-27 20:03:41] DEBUG org.hibernate.impl.SessionFactoryImpl - Session factory constructed with filter configurations : {}
[2012-02-27 20:03:41] DEBUG org.hibernate.impl.SessionFactoryImpl - instantiating session factory with properties: {java.runtime.name=Java(TM) SE Runtime Environment, hibernate.connection.password=youc, sun.boot.library.path=D:\jdk1.6.0_23\jre\bin, java.vm.version=19.0-b09, hibernate.connection.username=root, java.vm.vendor=Sun Microsystems Inc., java.vendor.url=http://java.sun.com/, path.separator=;, java.vm.name=Java HotSpot(TM) Client VM, file.encoding.pkg=sun.io, user.country=CN, sun.java.launcher=SUN_STANDARD, sun.os.patch.level=Service Pack 1, java.vm.specification.name=Java Virtual Machine Specification, user.dir=D:\work\kd_Micro-blogging, java.runtime.version=1.6.0_23-b05, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, hbm2ddl.auto=update, hibernate.current_session_context_class=thread, java.endorsed.dirs=D:\jdk1.6.0_23\jre\lib\endorsed, os.arch=x86, java.io.tmpdir=C:\Users\youc\AppData\Local\Temp\, line.separator=
, java.vm.specification.vendor=Sun Microsystems Inc., user.variant=, os.name=Windows 7, sun.jnu.encoding=GBK, java.library.path=D:\jdk1.6.0_23\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;D:/jdk1.6.0_23/bin/../jre/bin/client;D:/jdk1.6.0_23/bin/../jre/bin;D:/jdk1.6.0_23/bin/../jre/lib/i386;D:\jdk1.6.0_23\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;d:\Program Files\Tencent\QQPCMgr\6.6.2156.401;D:\Program Files\MySQL\MySQL Server 5.1\bin;d:\Program Files\Tencent\QQPCMgr\6.6.2156.401;D:\eclipse;, java.specification.name=Java Platform API Specification, java.class.version=50.0, sun.management.compiler=HotSpot Client Compiler, os.version=6.1, user.home=C:\Users\youc, user.timezone=Asia/Shanghai, java.awt.printerjob=sun.awt.windows.WPrinterJob, java.specification.version=1.6, file.encoding=UTF-8, hibernate.connection.driver_class=com.mysql.jdbc.Driver, java.class.path=D:\work\kd_Micro-blogging\WebContent\WEB-INF\classes;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\antlr-2.7.6.jar;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\commons-collections-3.1.jar;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\commons-logging.jar;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\dom4j-1.6.1.jar;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\ehcache-1.2.3.jar;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\ejb3-persistence.jar;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\hibernate-annotations.jar;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\hibernate-cglib-repack-2.1_3.jar;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\hibernate-commons-annotations.jar;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\hibernate-entitymanager.jar;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\hibernate3.jar;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\javassist-3.4.GA.jar;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\jta-1.1.jar;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\log4j.jar;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\slf4j-api-1.5.2.jar;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\slf4j-log4j12.jar;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\derbyclient.jar;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\classes12.jar;D:\work\kd_Micro-blogging\WebContent\WEB-INF\lib\mysql-connector-java-5.1.14-bin.jar, user.name=youc, hibernate.bytecode.use_reflection_optimizer=false, current_session_context_class=thread, java.vm.specification.version=1.0, sun.arch.data.model=32, java.home=D:\jdk1.6.0_23\jre, hibernate.dialect=org.hibernate.dialect.MySQLDialect, hibernate.connection.url=jdbc:mysql://localhost:3306/kd_micro_blogging, java.specification.vendor=Sun Microsystems Inc., user.language=zh, awt.toolkit=sun.awt.windows.WToolkit, java.vm.info=mixed mode, java.version=1.6.0_23, java.ext.dirs=D:\jdk1.6.0_23\jre\lib\ext;C:\Windows\Sun\Java\lib\ext, sun.boot.class.path=D:\jdk1.6.0_23\jre\lib\resources.jar;D:\jdk1.6.0_23\jre\lib\rt.jar;D:\jdk1.6.0_23\jre\lib\sunrsasign.jar;D:\jdk1.6.0_23\jre\lib\jsse.jar;D:\jdk1.6.0_23\jre\lib\jce.jar;D:\jdk1.6.0_23\jre\lib\charsets.jar;D:\jdk1.6.0_23\jre\lib\modules\jdk.boot.jar;D:\jdk1.6.0_23\jre\classes, java.vendor=Sun Microsystems Inc., file.separator=\, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, hibernate.hbm2ddl.auto=update, sun.cpu.endian=little, sun.io.unicode.encoding=UnicodeLittle, sun.desktop=windows, sun.cpu.isalist=pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86}
[2012-02-27 20:03:41] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Static SQL for entity: cn.micblog.domain.UserBean
[2012-02-27 20:03:41] DEBUG org.hibernate.persister.entity.AbstractEntityPersister -  Version select: select userid from blog_user where userid =?
[2012-02-27 20:03:41] DEBUG org.hibernate.persister.entity.AbstractEntityPersister -  Snapshot select: select userbean_.userid, userbean_.name as name1_, userbean_.nickname as nickname1_, userbean_.stu_num as stu4_1_, userbean_.photo as photo1_, userbean_.age as age1_, userbean_.sex as sex1_, userbean_.R_date as R8_1_, userbean_.location as location1_, userbean_.B_id as B10_1_, userbean_.C_id as C11_1_ from blog_user userbean_ where userbean_.userid=?
[2012-02-27 20:03:41] DEBUG org.hibernate.persister.entity.AbstractEntityPersister -  Insert 0: insert into blog_user (name, nickname, stu_num, photo, age, sex, R_date, location, B_id, C_id, userid) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
[2012-02-27 20:03:41] DEBUG org.hibernate.persister.entity.AbstractEntityPersister -  Update 0: update blog_user set name=?, nickname=?, stu_num=?, photo=?, age=?, sex=?, R_date=?, location=?, B_id=?, C_id=? where userid=?
[2012-02-27 20:03:41] DEBUG org.hibernate.persister.entity.AbstractEntityPersister -  Delete 0: delete from blog_user where userid=?
[2012-02-27 20:03:41] DEBUG org.hibernate.persister.entity.AbstractEntityPersister -  Identity insert: insert into blog_user (name, nickname, stu_num, photo, age, sex, R_date, location, B_id, C_id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
[2012-02-27 20:03:41] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Static SQL for entity: cn.micblog.domain.MessageBean
[2012-02-27 20:03:41] DEBUG org.hibernate.persister.entity.AbstractEntityPersister -  Version select: select messageid from blog_message where messageid =?
[2012-02-27 20:03:41] DEBUG org.hibernate.persister.entity.AbstractEntityPersister -  Snapshot select: select messagebea_.messageid, messagebea_.contents as contents0_, messagebea_.createDate as createDate0_, messagebea_.userid as userid0_ from blog_message messagebea_ where messagebea_.messageid=?
[2012-02-27 20:03:41] DEBUG org.hibernate.persister.entity.AbstractEntityPersister -  Insert 0: insert into blog_message (contents, createDate, userid, messageid) values (?, ?, ?, ?)
[2012-02-27 20:03:41] DEBUG org.hibernate.persister.entity.AbstractEntityPersister -  Update 0: update blog_message set contents=?, createDate=?, userid=? where messageid=?
[2012-02-27 20:03:41] DEBUG org.hibernate.persister.entity.AbstractEntityPersister -  Delete 0: delete from blog_message where messageid=?
[2012-02-27 20:03:41] DEBUG org.hibernate.persister.entity.AbstractEntityPersister -  Identity insert: insert into blog_message (contents, createDate, userid) values (?, ?, ?)
[2012-02-27 20:03:41] DEBUG org.hibernate.persister.collection.AbstractCollectionPersister - Static SQL for collection: cn.micblog.domain.UserBean.messages
[2012-02-27 20:03:41] DEBUG org.hibernate.persister.collection.AbstractCollectionPersister -  Row insert: update blog_message set userid=? where messageid=?
[2012-02-27 20:03:41] DEBUG org.hibernate.persister.collection.AbstractCollectionPersister -  Row delete: update blog_message set userid=null where userid=? and messageid=?
[2012-02-27 20:03:41] DEBUG org.hibernate.persister.collection.AbstractCollectionPersister -  One-shot delete: update blog_message set userid=null where userid=?
[2012-02-27 20:03:41] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity cn.micblog.domain.UserBean: select userbean0_.userid as userid1_0_, userbean0_.name as name1_0_, userbean0_.nickname as nickname1_0_, userbean0_.stu_num as stu4_1_0_, userbean0_.photo as photo1_0_, userbean0_.age as age1_0_, userbean0_.sex as sex1_0_, userbean0_.R_date as R8_1_0_, userbean0_.location as location1_0_, userbean0_.B_id as B10_1_0_, userbean0_.C_id as C11_1_0_ from blog_user userbean0_ where userbean0_.userid=?
[2012-02-27 20:03:41] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity cn.micblog.domain.UserBean: select userbean0_.userid as userid1_0_, userbean0_.name as name1_0_, userbean0_.nickname as nickname1_0_, userbean0_.stu_num as stu4_1_0_, userbean0_.photo as photo1_0_, userbean0_.age as age1_0_, userbean0_.sex as sex1_0_, userbean0_.R_date as R8_1_0_, userbean0_.location as location1_0_, userbean0_.B_id as B10_1_0_, userbean0_.C_id as C11_1_0_ from blog_user userbean0_ where userbean0_.userid=?
[2012-02-27 20:03:41] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity cn.micblog.domain.UserBean: select userbean0_.userid as userid1_0_, userbean0_.name as name1_0_, userbean0_.nickname as nickname1_0_, userbean0_.stu_num as stu4_1_0_, userbean0_.photo as photo1_0_, userbean0_.age as age1_0_, userbean0_.sex as sex1_0_, userbean0_.R_date as R8_1_0_, userbean0_.location as location1_0_, userbean0_.B_id as B10_1_0_, userbean0_.C_id as C11_1_0_ from blog_user userbean0_ where userbean0_.userid=? for update
[2012-02-27 20:03:41] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity cn.micblog.domain.UserBean: select userbean0_.userid as userid1_0_, userbean0_.name as name1_0_, userbean0_.nickname as nickname1_0_, userbean0_.stu_num as stu4_1_0_, userbean0_.photo as photo1_0_, userbean0_.age as age1_0_, userbean0_.sex as sex1_0_, userbean0_.R_date as R8_1_0_, userbean0_.location as location1_0_, userbean0_.B_id as B10_1_0_, userbean0_.C_id as C11_1_0_ from blog_user userbean0_ where userbean0_.userid=? for update
[2012-02-27 20:03:41] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity cn.micblog.domain.UserBean: select userbean0_.userid as userid1_0_, userbean0_.name as name1_0_, userbean0_.nickname as nickname1_0_, userbean0_.stu_num as stu4_1_0_, userbean0_.photo as photo1_0_, userbean0_.age as age1_0_, userbean0_.sex as sex1_0_, userbean0_.R_date as R8_1_0_, userbean0_.location as location1_0_, userbean0_.B_id as B10_1_0_, userbean0_.C_id as C11_1_0_ from blog_user userbean0_ where userbean0_.userid=? for update
[2012-02-27 20:03:41] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for action ACTION_MERGE on entity cn.micblog.domain.UserBean: select userbean0_.userid as userid1_0_, userbean0_.name as name1_0_, userbean0_.nickname as nickname1_0_, userbean0_.stu_num as stu4_1_0_, userbean0_.photo as photo1_0_, userbean0_.age as age1_0_, userbean0_.sex as sex1_0_, userbean0_.R_date as R8_1_0_, userbean0_.location as location1_0_, userbean0_.B_id as B10_1_0_, userbean0_.C_id as C11_1_0_ from blog_user userbean0_ where userbean0_.userid=?
[2012-02-27 20:03:41] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for action ACTION_REFRESH on entity cn.micblog.domain.UserBean: select userbean0_.userid as userid1_0_, userbean0_.name as name1_0_, userbean0_.nickname as nickname1_0_, userbean0_.stu_num as stu4_1_0_, userbean0_.photo as photo1_0_, userbean0_.age as age1_0_, userbean0_.sex as sex1_0_, userbean0_.R_date as R8_1_0_, userbean0_.location as location1_0_, userbean0_.B_id as B10_1_0_, userbean0_.C_id as C11_1_0_ from blog_user userbean0_ where userbean0_.userid=?
[2012-02-27 20:03:41] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity cn.micblog.domain.MessageBean: select messagebea0_.messageid as messageid0_0_, messagebea0_.contents as contents0_0_, messagebea0_.createDate as createDate0_0_, messagebea0_.userid as userid0_0_ from blog_message messagebea0_ where messagebea0_.messageid=?
[2012-02-27 20:03:41] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity cn.micblog.domain.MessageBean: select messagebea0_.messageid as messageid0_0_, messagebea0_.contents as contents0_0_, messagebea0_.createDate as createDate0_0_, messagebea0_.userid as userid0_0_ from blog_message messagebea0_ where messagebea0_.messageid=?
[2012-02-27 20:03:41] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity cn.micblog.domain.MessageBean: select messagebea0_.messageid as messageid0_0_, messagebea0_.contents as contents0_0_, messagebea0_.createDate as createDate0_0_, messagebea0_.userid as userid0_0_ from blog_message messagebea0_ where messagebea0_.messageid=? for update
[2012-02-27 20:03:41] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity cn.micblog.domain.MessageBean: select messagebea0_.messageid as messageid0_0_, messagebea0_.contents as contents0_0_, messagebea0_.createDate as createDate0_0_, messagebea0_.userid as userid0_0_ from blog_message messagebea0_ where messagebea0_.messageid=? for update
[2012-02-27 20:03:41] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity cn.micblog.domain.MessageBean: select messagebea0_.messageid as messageid0_0_, messagebea0_.contents as contents0_0_, messagebea0_.createDate as createDate0_0_, messagebea0_.userid as userid0_0_ from blog_message messagebea0_ where messagebea0_.messageid=? for update
[2012-02-27 20:03:41] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for action ACTION_MERGE on entity cn.micblog.domain.MessageBean: select messagebea0_.messageid as messageid0_0_, messagebea0_.contents as contents0_0_, messagebea0_.createDate as createDate0_0_, messagebea0_.userid as userid0_0_ from blog_message messagebea0_ where messagebea0_.messageid=?
[2012-02-27 20:03:41] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for action ACTION_REFRESH on entity cn.micblog.domain.MessageBean: select messagebea0_.messageid as messageid0_0_, messagebea0_.contents as contents0_0_, messagebea0_.createDate as createDate0_0_, messagebea0_.userid as userid0_0_ from blog_message messagebea0_ where messagebea0_.messageid=?
[2012-02-27 20:03:41] DEBUG org.hibernate.loader.collection.OneToManyLoader - Static select for one-to-many cn.micblog.domain.UserBean.messages: select messages0_.userid as userid1_, messages0_.messageid as messageid1_, messages0_.messageid as messageid0_0_, messages0_.contents as contents0_0_, messages0_.createDate as createDate0_0_, messages0_.userid as userid0_0_ from blog_message messages0_ where messages0_.userid=?
[2012-02-27 20:03:41] DEBUG org.hibernate.impl.SessionFactoryObjectFactory - initializing class SessionFactoryObjectFactory
[2012-02-27 20:03:41] DEBUG org.hibernate.impl.SessionFactoryObjectFactory - registered: 297e03d035beb1da0135beb1dbc30000 (unnamed)
[2012-02-27 20:03:41] INFO  org.hibernate.impl.SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured
[2012-02-27 20:03:41] DEBUG org.hibernate.impl.SessionFactoryImpl - instantiated session factory
[2012-02-27 20:03:41] INFO  org.hibernate.tool.hbm2ddl.SchemaUpdate - Running hbm2ddl schema update
[2012-02-27 20:03:41] INFO  org.hibernate.tool.hbm2ddl.SchemaUpdate - fetching database metadata
[2012-02-27 20:03:41] INFO  org.hibernate.tool.hbm2ddl.SchemaUpdate - updating schema
[2012-02-27 20:03:41] DEBUG org.hibernate.cfg.Configuration - processing extends queue
[2012-02-27 20:03:41] DEBUG org.hibernate.cfg.Configuration - processing collection mappings
[2012-02-27 20:03:41] DEBUG org.hibernate.cfg.Configuration - processing native query and ResultSetMapping mappings
[2012-02-27 20:03:41] DEBUG org.hibernate.cfg.Configuration - processing association property references
[2012-02-27 20:03:41] DEBUG org.hibernate.cfg.Configuration - processing foreign key constraints
[2012-02-27 20:03:41] DEBUG org.hibernate.cfg.Configuration - resolving reference to class: cn.micblog.domain.UserBean
[2012-02-27 20:03:41] INFO  org.hibernate.tool.hbm2ddl.DatabaseMetadata - table not found: blog_message
[2012-02-27 20:03:41] INFO  org.hibernate.tool.hbm2ddl.DatabaseMetadata - table not found: blog_user
[2012-02-27 20:03:41] INFO  org.hibernate.tool.hbm2ddl.DatabaseMetadata - table not found: blog_message
[2012-02-27 20:03:41] INFO  org.hibernate.tool.hbm2ddl.DatabaseMetadata - table not found: blog_user
[2012-02-27 20:03:41] DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate - create table blog_message (messageid varchar(255) not null auto_increment, contents varchar(255), createDate varchar(255), userid varchar(255), primary key (messageid))
[2012-02-27 20:03:41] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - Unsuccessful: create table blog_message (messageid varchar(255) not null auto_increment, contents varchar(255), createDate varchar(255), userid varchar(255), primary key (messageid))
[2012-02-27 20:03:41] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - Incorrect column specifier for column 'messageid'
[2012-02-27 20:03:41] DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate - create table blog_user (userid varchar(255) not null auto_increment, name varchar(255), nickname varchar(255), stu_num varchar(255), photo longblob, age varchar(255), sex varchar(255), R_date datetime, location varchar(255), B_id varchar(255), C_id varchar(255), primary key (userid))
[2012-02-27 20:03:41] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - Unsuccessful: create table blog_user (userid varchar(255) not null auto_increment, name varchar(255), nickname varchar(255), stu_num varchar(255), photo longblob, age varchar(255), sex varchar(255), R_date datetime, location varchar(255), B_id varchar(255), C_id varchar(255), primary key (userid))
[2012-02-27 20:03:41] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - Incorrect column specifier for column 'userid'
[2012-02-27 20:03:41] DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate - alter table blog_message add index FK1B58146A7939443 (userid), add constraint FK1B58146A7939443 foreign key (userid) references blog_user (userid)
[2012-02-27 20:03:41] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - Unsuccessful: alter table blog_message add index FK1B58146A7939443 (userid), add constraint FK1B58146A7939443 foreign key (userid) references blog_user (userid)
[2012-02-27 20:03:41] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - Table 'kd_micro_blogging.blog_message' doesn't exist
[2012-02-27 20:03:41] INFO  org.hibernate.tool.hbm2ddl.SchemaUpdate - schema update complete
[2012-02-27 20:03:41] DEBUG org.hibernate.impl.SessionFactoryImpl - Checking 0 named HQL queries
[2012-02-27 20:03:41] DEBUG org.hibernate.impl.SessionFactoryImpl - Checking 0 named SQL queries
[2012-02-27 20:03:41] DEBUG org.hibernate.impl.SessionImpl - opened session at timestamp: 13303442216
[2012-02-27 20:03:41] DEBUG org.hibernate.transaction.JDBCTransaction - begin
[2012-02-27 20:03:41] DEBUG org.hibernate.jdbc.ConnectionManager - opening JDBC connection
[2012-02-27 20:03:41] DEBUG org.hibernate.transaction.JDBCTransaction - current autocommit status: false
[2012-02-27 20:03:41] DEBUG org.hibernate.event.def.AbstractSaveEventListener - executing identity-insert immediately
[2012-02-27 20:03:41] DEBUG org.hibernate.jdbc.AbstractBatcher - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
[2012-02-27 20:03:41] DEBUG org.hibernate.SQL - insert into blog_message (contents, createDate, userid) values (?, ?, ?)
[2012-02-27 20:03:41] DEBUG org.hibernate.jdbc.AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
[2012-02-27 20:03:41] DEBUG org.hibernate.util.JDBCExceptionReporter - could not insert: [cn.micblog.domain.MessageBean] [insert into blog_message (contents, createDate, userid) values (?, ?, ?)]
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'kd_micro_blogging.blog_message' doesn't exist
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
at com.mysql.jdbc.Util.getInstance(Util.java:382)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3593)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3525)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1986)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2626)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2111)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2407)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2325)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2310)
at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:94)
at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:57)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2176)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2656)
at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:321)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:130)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:56)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:50)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:563)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:551)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:547)
at cn.micblog.test.DBTest.main(DBTest.java:50)
[2012-02-27 20:03:41] WARN  org.hibernate.util.JDBCExceptionReporter - SQL Error: 1146, SQLState: 42S02
[2012-02-27 20:03:41] ERROR org.hibernate.util.JDBCExceptionReporter - Table 'kd_micro_blogging.blog_message' doesn't exist
[2012-02-27 20:03:41] DEBUG org.hibernate.transaction.JDBCTransaction - rollback
[2012-02-27 20:03:41] DEBUG org.hibernate.transaction.JDBCTransaction - rolled back JDBC Connection
[2012-02-27 20:03:41] DEBUG org.hibernate.jdbc.ConnectionManager - aggressively releasing JDBC connection
[2012-02-27 20:03:41] DEBUG org.hibernate.jdbc.ConnectionManager - releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
user id:null
message1 id:null
message2 id:null

0
黄龍
黄龍

- -! 这么多.........你还是自己把上面的ERROR信息看一遍找提示吧~例如:

[2012-02-27 20:03:41] ERROR org.hibernate.util.JDBCExceptionReporter - Table 'kd_micro_blogging.blog_message' doesn't exist 
DBTest.java:第50行代码干什么的?
返回顶部
顶部