很久没玩hibernate了,配置了一个最原始的hibernate,做完所有配置及基础类的编写工作,在导出表的时候报以下错误
00:13:37.731 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration boolean -> org.hibernate.type.BooleanType@131f71a
00:13:37.731 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration boolean -> org.hibernate.type.BooleanType@131f71a
00:13:37.731 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration java.lang.Boolean -> org.hibernate.type.BooleanType@131f71a
00:13:37.746 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration numeric_boolean -> org.hibernate.type.NumericBooleanType@defa1a
00:13:37.746 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration true_false -> org.hibernate.type.TrueFalseType@11a698a
00:13:37.746 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration yes_no -> org.hibernate.type.YesNoType@7ced01
00:13:37.746 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration byte -> org.hibernate.type.ByteType@14f8dab
00:13:37.746 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration byte -> org.hibernate.type.ByteType@14f8dab
00:13:37.746 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration java.lang.Byte -> org.hibernate.type.ByteType@14f8dab
00:13:37.746 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration character -> org.hibernate.type.CharacterType@194ca6c
00:13:37.746 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration char -> org.hibernate.type.CharacterType@194ca6c
00:13:37.746 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration java.lang.Character -> org.hibernate.type.CharacterType@194ca6c
00:13:37.746 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration short -> org.hibernate.type.ShortType@14fe5c
00:13:37.746 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration short -> org.hibernate.type.ShortType@14fe5c
00:13:37.746 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration java.lang.Short -> org.hibernate.type.ShortType@14fe5c
00:13:37.746 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration integer -> org.hibernate.type.IntegerType@2bbd86
00:13:37.746 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration int -> org.hibernate.type.IntegerType@2bbd86
00:13:37.746 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration java.lang.Integer -> org.hibernate.type.IntegerType@2bbd86
00:13:37.762 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration long -> org.hibernate.type.LongType@df6ccd
00:13:37.762 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration long -> org.hibernate.type.LongType@df6ccd
00:13:37.762 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration java.lang.Long -> org.hibernate.type.LongType@df6ccd
00:13:37.762 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration float -> org.hibernate.type.FloatType@13f5d07
00:13:37.762 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration float -> org.hibernate.type.FloatType@13f5d07
00:13:37.762 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration java.lang.Float -> org.hibernate.type.FloatType@13f5d07
00:13:37.762 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration double -> org.hibernate.type.DoubleType@1cde100
00:13:37.762 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration double -> org.hibernate.type.DoubleType@1cde100
00:13:37.762 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration java.lang.Double -> org.hibernate.type.DoubleType@1cde100
00:13:37.762 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration big_decimal -> org.hibernate.type.BigDecimalType@1372a1a
00:13:37.762 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration java.math.BigDecimal -> org.hibernate.type.BigDecimalType@1372a1a
00:13:37.762 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration big_integer -> org.hibernate.type.BigIntegerType@182f0db
00:13:37.762 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration java.math.BigInteger -> org.hibernate.type.BigIntegerType@182f0db
00:13:37.762 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration string -> org.hibernate.type.StringType@1c78e57
00:13:37.762 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration java.lang.String -> org.hibernate.type.StringType@1c78e57
00:13:37.777 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration url -> org.hibernate.type.UrlType@15ff48b
00:13:37.777 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration java.net.URL -> org.hibernate.type.UrlType@15ff48b
00:13:37.777 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration date -> org.hibernate.type.DateType@b8df17
00:13:37.777 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration java.sql.Date -> org.hibernate.type.DateType@b8df17
00:13:37.777 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration time -> org.hibernate.type.TimeType@1172e08
00:13:37.777 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration java.sql.Time -> org.hibernate.type.TimeType@1172e08
00:13:37.777 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration timestamp -> org.hibernate.type.TimestampType@19f953d
00:13:37.777 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration java.sql.Timestamp -> org.hibernate.type.TimestampType@19f953d
00:13:37.777 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration java.util.Date -> org.hibernate.type.TimestampType@19f953d
00:13:37.777 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration dbtimestamp -> org.hibernate.type.DbTimestampType@187aeca
00:13:37.777 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration calendar -> org.hibernate.type.CalendarType@1ad086a
00:13:37.777 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration java.util.Calendar -> org.hibernate.type.CalendarType@1ad086a
00:13:37.777 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration java.util.GregorianCalendar -> org.hibernate.type.CalendarType@1ad086a
00:13:37.777 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration calendar_date -> org.hibernate.type.CalendarDateType@42719c
00:13:37.793 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration locale -> org.hibernate.type.LocaleType@f72617
00:13:37.793 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration java.util.Locale -> org.hibernate.type.LocaleType@f72617
00:13:37.793 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration currency -> org.hibernate.type.CurrencyType@4f1d0d
00:13:37.793 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration java.util.Currency -> org.hibernate.type.CurrencyType@4f1d0d
00:13:37.793 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration timezone -> org.hibernate.type.TimeZoneType@1bab50a
00:13:37.793 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration java.util.TimeZone -> org.hibernate.type.TimeZoneType@1bab50a
00:13:37.793 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration class -> org.hibernate.type.ClassType@1bc4459
00:13:37.793 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration java.lang.Class -> org.hibernate.type.ClassType@1bc4459
00:13:37.793 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration uuid-binary -> org.hibernate.type.UUIDBinaryType@19189e1
00:13:37.793 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration java.util.UUID -> org.hibernate.type.UUIDBinaryType@19189e1
00:13:37.793 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration uuid-char -> org.hibernate.type.UUIDCharType@7c6768
00:13:37.793 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration pg-uuid -> org.hibernate.type.PostgresUUIDType@9931f5
00:13:37.793 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration binary -> org.hibernate.type.BinaryType@1befab0
00:13:37.793 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration byte[] -> org.hibernate.type.BinaryType@1befab0
00:13:37.793 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration [B -> org.hibernate.type.BinaryType@1befab0
00:13:37.793 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration wrapper-binary -> org.hibernate.type.WrapperBinaryType@14b7453
00:13:37.809 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration Byte[] -> org.hibernate.type.WrapperBinaryType@14b7453
00:13:37.809 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration [Ljava.lang.Byte; -> org.hibernate.type.WrapperBinaryType@14b7453
00:13:37.809 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration image -> org.hibernate.type.ImageType@c2ea3f
00:13:37.809 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration characters -> org.hibernate.type.CharArrayType@15f5897
00:13:37.809 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration char[] -> org.hibernate.type.CharArrayType@15f5897
00:13:37.809 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration [C -> org.hibernate.type.CharArrayType@15f5897
00:13:37.809 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration wrapper-characters -> org.hibernate.type.CharacterArrayType@186d4c1
00:13:37.809 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration [Ljava.lang.Character; -> org.hibernate.type.CharacterArrayType@186d4c1
00:13:37.809 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration Character[] -> org.hibernate.type.CharacterArrayType@186d4c1
00:13:37.809 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration text -> org.hibernate.type.TextType@15b7986
00:13:37.824 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration blob -> org.hibernate.type.BlobType@1a1c887
00:13:37.824 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration java.sql.Blob -> org.hibernate.type.BlobType@1a1c887
00:13:37.824 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration materialized_blob -> org.hibernate.type.MaterializedBlobType@e7b241
00:13:37.824 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration wrapper_materialized_blob -> org.hibernate.type.WrappedMaterializedBlobType@e83912
00:13:37.824 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration clob -> org.hibernate.type.ClobType@1dd7056
00:13:37.824 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration java.sql.Clob -> org.hibernate.type.ClobType@1dd7056
00:13:37.824 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration materialized_clob -> org.hibernate.type.MaterializedClobType@1de3f2d
00:13:37.824 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration wrapper_characters_clob -> org.hibernate.type.CharacterArrayClobType@1f9dc36
00:13:37.824 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration characters_clob -> org.hibernate.type.PrimitiveCharacterArrayClobType@1754ad2
00:13:37.824 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration serializable -> org.hibernate.type.SerializableType@ab95e6
00:13:37.840 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration object -> org.hibernate.type.ObjectType@56a499
00:13:37.840 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration java.lang.Object -> org.hibernate.type.ObjectType@56a499
00:13:37.840 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration imm_date -> org.hibernate.type.AdaptedImmutableType@1d99a4d
00:13:37.840 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration imm_time -> org.hibernate.type.AdaptedImmutableType@12152e6
00:13:37.840 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration imm_timestamp -> org.hibernate.type.AdaptedImmutableType@c9ba38
00:13:37.840 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration imm_dbtimestamp -> org.hibernate.type.AdaptedImmutableType@1e0be38
00:13:37.840 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration imm_calendar -> org.hibernate.type.AdaptedImmutableType@1e859c0
00:13:37.840 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration imm_calendar_date -> org.hibernate.type.AdaptedImmutableType@15c7850
00:13:37.840 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration imm_binary -> org.hibernate.type.AdaptedImmutableType@1ded0fd
00:13:37.840 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration imm_serializable -> org.hibernate.type.AdaptedImmutableType@16a9d42
00:13:37.871 [main] INFO o.h.annotations.common.Version - Hibernate Commons Annotations 3.2.0.Final
00:13:37.871 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.6.2.Final
00:13:37.871 [main] INFO org.hibernate.cfg.Environment - loaded properties from resource hibernate.properties: {hibernate.connection.driver_class=com.mysql.jdbc.Driver, hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider, hibernate.max_fetch_depth=1, hibernate.dialect=org.hibernate.dialect.MySQLMyISAMDialect, hibernate.jdbc.use_streams_for_binary=true, hibernate.format_sql=true, hibernate.query.substitutions=yes 'Y', no 'N', hibernate.proxool.pool_alias=pool1, hibernate.connection.username=root, hibernate.cache.region_prefix=hibernate.test, hibernate.connection.url=jdbc:mysql:///xcgw, hibernate.bytecode.use_reflection_optimizer=false, hibernate.connection.password=****, hibernate.jdbc.batch_versioned_data=true, hibernate.connection.pool_size=1}
00:13:37.871 [main] INFO org.hibernate.cfg.Environment - using java.io streams to persist binary types
00:13:37.887 [main] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
00:13:37.887 [main] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
00:13:37.949 [main] DEBUG o.h.i.f.DefaultIdentifierGeneratorFactory - Registering IdentifierGenerator strategy [uuid2] -> [class org.hibernate.id.UUIDGenerator]
00:13:37.949 [main] DEBUG o.h.i.f.DefaultIdentifierGeneratorFactory - Registering IdentifierGenerator strategy [guid] -> [class org.hibernate.id.GUIDGenerator]
00:13:37.949 [main] DEBUG o.h.i.f.DefaultIdentifierGeneratorFactory - Registering IdentifierGenerator strategy [uuid] -> [class org.hibernate.id.UUIDHexGenerator]
00:13:37.949 [main] DEBUG o.h.i.f.DefaultIdentifierGeneratorFactory - Registering IdentifierGenerator strategy [uuid.hex] -> [class org.hibernate.id.UUIDHexGenerator]
00:13:37.949 [main] DEBUG o.h.i.f.DefaultIdentifierGeneratorFactory - Registering IdentifierGenerator strategy [hilo] -> [class org.hibernate.id.TableHiLoGenerator]
00:13:37.965 [main] DEBUG o.h.i.f.DefaultIdentifierGeneratorFactory - Registering IdentifierGenerator strategy [assigned] -> [class org.hibernate.id.Assigned]
00:13:37.965 [main] DEBUG o.h.i.f.DefaultIdentifierGeneratorFactory - Registering IdentifierGenerator strategy [identity] -> [class org.hibernate.id.IdentityGenerator]
00:13:37.965 [main] DEBUG o.h.i.f.DefaultIdentifierGeneratorFactory - Registering IdentifierGenerator strategy [select] -> [class org.hibernate.id.SelectGenerator]
00:13:37.965 [main] DEBUG o.h.i.f.DefaultIdentifierGeneratorFactory - Registering IdentifierGenerator strategy [sequence] -> [class org.hibernate.id.SequenceGenerator]
00:13:37.965 [main] DEBUG o.h.i.f.DefaultIdentifierGeneratorFactory - Registering IdentifierGenerator strategy [seqhilo] -> [class org.hibernate.id.SequenceHiLoGenerator]
00:13:37.965 [main] DEBUG o.h.i.f.DefaultIdentifierGeneratorFactory - Registering IdentifierGenerator strategy [increment] -> [class org.hibernate.id.IncrementGenerator]
00:13:37.965 [main] DEBUG o.h.i.f.DefaultIdentifierGeneratorFactory - Registering IdentifierGenerator strategy [foreign] -> [class org.hibernate.id.ForeignGenerator]
00:13:37.965 [main] DEBUG o.h.i.f.DefaultIdentifierGeneratorFactory - Registering IdentifierGenerator strategy [sequence-identity] -> [class org.hibernate.id.SequenceIdentityGenerator]
00:13:37.965 [main] DEBUG o.h.i.f.DefaultIdentifierGeneratorFactory - Registering IdentifierGenerator strategy [enhanced-sequence] -> [class org.hibernate.id.enhanced.SequenceStyleGenerator]
00:13:37.965 [main] DEBUG o.h.i.f.DefaultIdentifierGeneratorFactory - Registering IdentifierGenerator strategy [enhanced-table] -> [class org.hibernate.id.enhanced.TableGenerator]
00:13:37.965 [main] INFO org.hibernate.cfg.Configuration - configuring from resource: /hibernate.cfg.xml
00:13:37.965 [main] INFO org.hibernate.cfg.Configuration - Configuration resource: /hibernate.cfg.xml
00:13:38.027 [main] DEBUG org.hibernate.util.DTDEntityResolver - trying to resolve system-id [http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd]
00:13:38.027 [main] DEBUG org.hibernate.util.DTDEntityResolver - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
00:13:38.027 [main] DEBUG org.hibernate.util.DTDEntityResolver - located [http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd] in classpath
00:13:38.074 [main] DEBUG org.hibernate.cfg.Configuration - connection.driver_class=org.gjt.mm.mysql.Driver
00:13:38.074 [main] DEBUG org.hibernate.cfg.Configuration - connection.url=jdbc:mysql://localhost:3360/xcgw
00:13:38.074 [main] DEBUG org.hibernate.cfg.Configuration - connection.username=root
00:13:38.074 [main] DEBUG org.hibernate.cfg.Configuration - connection.password=root
00:13:38.074 [main] DEBUG org.hibernate.cfg.Configuration - dialect=org.hibernate.dialect.MySQLDialect
00:13:38.074 [main] DEBUG org.hibernate.cfg.Configuration - cache.provider_class=org.hibernate.cache.NoCacheProvider
00:13:38.074 [main] DEBUG org.hibernate.cfg.Configuration - show_sql=true
00:13:38.074 [main] DEBUG org.hibernate.cfg.Configuration - hbm2ddl.auto=create
00:13:38.074 [main] DEBUG org.hibernate.cfg.Configuration - session-factory config [null] named resource [com/bin/entity/Enterprise.hbm.xml] for mapping
00:13:38.074 [main] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : com/bin/entity/Enterprise.hbm.xml
00:13:38.105 [main] DEBUG org.hibernate.util.DTDEntityResolver - trying to resolve system-id [http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd]
00:13:38.105 [main] DEBUG org.hibernate.util.DTDEntityResolver - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
00:13:38.105 [main] DEBUG org.hibernate.util.DTDEntityResolver - located [http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd] in classpath
00:13:38.136 [main] INFO org.hibernate.cfg.Configuration - Configured SessionFactory: null
00:13:38.136 [main] DEBUG org.hibernate.cfg.Configuration - properties: {show_sql=true, java.vendor=Sun Microsystems Inc., hibernate.jdbc.batch_versioned_data=true, sun.java.launcher=SUN_STANDARD, hibernate.connection.url=jdbc:mysql://localhost:3360/xcgw, sun.management.compiler=HotSpot Client Compiler, hbm2ddl.auto=create, os.name=Windows Vista, sun.boot.class.path=D:\JDK6\jre\lib\resources.jar;D:\JDK6\jre\lib\rt.jar;D:\JDK6\jre\lib\sunrsasign.jar;D:\JDK6\jre\lib\jsse.jar;D:\JDK6\jre\lib\jce.jar;D:\JDK6\jre\lib\charsets.jar;D:\JDK6\jre\classes, sun.desktop=windows, java.vm.specification.vendor=Sun Microsystems Inc., java.runtime.version=1.6.0_11-b03, hibernate.cache.provider_class=org.hibernate.cache.NoCacheProvider, user.name=haoyunlai, connection.driver_class=org.gjt.mm.mysql.Driver, user.language=zh, sun.boot.library.path=D:\JDK6\jre\bin, dialect=org.hibernate.dialect.MySQLDialect, java.version=1.6.0_11, user.timezone=Asia/Shanghai, sun.arch.data.model=32, java.endorsed.dirs=D:\JDK6\jre\lib\endorsed, sun.cpu.isalist=pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86, sun.jnu.encoding=GBK, file.encoding.pkg=sun.io, file.separator=\, java.specification.name=Java Platform API Specification, hibernate.format_sql=true, java.class.version=50.0, user.country=CN, connection.url=jdbc:mysql://localhost:3360/xcgw, java.home=D:\JDK6\jre, java.vm.info=mixed mode, sharing, os.version=6.1, path.separator=;, connection.password=root, java.vm.version=11.0-b16, hibernate.max_fetch_depth=1, hibernate.connection.password=root, user.variant=, java.awt.printerjob=sun.awt.windows.WPrinterJob, sun.io.unicode.encoding=UnicodeLittle, awt.toolkit=sun.awt.windows.WToolkit, hibernate.connection.username=root, hibernate.cache.region_prefix=hibernate.test, user.home=C:\Users\haoyunlai, hibernate.query.substitutions=yes 'Y', no 'N', java.specification.vendor=Sun Microsystems Inc., hibernate.hbm2ddl.auto=create, java.library.path=D:\JDK6\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;D:/JDK6/bin/../jre/bin/client;D:/JDK6/bin/../jre/bin;D:/JDK6/bin/../jre/lib/i386;E:\developjava\apache-maven-3.0.3\bin;F:\java_install\svn\svn-win32-1.5.6\bin;D:\Program Files\MySQL\MySQL Server 5.1\bin;.;D:\JDK6\;D:\JDK6\bin;D:\JDK6\jre6;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Common Files\Thunder Network\KanKan\Codecs;F:\java_package\webservice\axis2\bin;, java.vendor.url=http://java.sun.com/, hibernate.connection.driver_class=org.gjt.mm.mysql.Driver, hibernate.proxool.pool_alias=pool1, connection.username=root, java.vm.vendor=Sun Microsystems Inc., hibernate.dialect=org.hibernate.dialect.MySQLDialect, hibernate.jdbc.use_streams_for_binary=true, java.runtime.name=Java(TM) SE Runtime Environment, java.class.path=E:\developjava\projects\xcwg\build\classes;E:\developjava\projects\spring-framework-3.1.0.M1\dist\org.springframework.core-3.1.0.M1.jar;E:\developjava\projects\spring-framework-3.1.0.M1\dist\org.springframework.aop-3.1.0.M1.jar;E:\developjava\projects\spring-framework-3.1.0.M1\dist\org.springframework.test-3.1.0.M1.jar;E:\developjava\projects\spring-framework-3.1.0.M1\dist\org.springframework.aspects-3.1.0.M1.jar;E:\developjava\projects\spring-framework-3.1.0.M1\dist\org.springframework.beans-3.1.0.M1.jar;E:\developjava\projects\spring-framework-3.1.0.M1\dist\org.springframework.context.support-3.1.0.M1.jar;E:\developjava\projects\spring-framework-3.1.0.M1\dist\org.springframework.context-3.1.0.M1.jar;E:\developjava\projects\spring-framework-3.1.0.M1\dist\org.springframework.expression-3.1.0.M1.jar;E:\developjava\projects\spring-framework-3.1.0.M1\dist\org.springframework.instrument.tomcat-3.1.0.M1.jar;E:\developjava\projects\spring-framework-3.1.0.M1\dist\org.springframework.instrument-3.1.0.M1.jar;E:\developjava\projects\spring-framework-3.1.0.M1\dist\org.springframework.jdbc-3.1.0.M1.jar;E:\developjava\projects\spring-framework-3.1.0.M1\dist\org.springframework.jms-3.1.0.M1.jar;E:\developjava\projects\spring-framework-3.1.0.M1\dist\org.springframework.orm-3.1.0.M1.jar;E:\developjava\projects\spring-framework-3.1.0.M1\dist\org.springframework.oxm-3.1.0.M1.jar;E:\developjava\projects\spring-framework-3.1.0.M1\dist\org.springframework.transaction-3.1.0.M1.jar;E:\developjava\projects\spring-framework-3.1.0.M1\dist\org.springframework.web.portlet-3.1.0.M1.jar;E:\developjava\projects\spring-framework-3.1.0.M1\dist\org.springframework.web.servlet-3.1.0.M1.jar;E:\developjava\projects\spring-framework-3.1.0.M1\dist\org.springframework.web.struts-3.1.0.M1.jar;E:\developjava\projects\spring-framework-3.1.0.M1\dist\org.springframework.web-3.1.0.M1.jar;E:\developjava\projects\spring-framework-3.1.0.M1\dist\org.springframework.asm-3.1.0.M1.jar;F:\java_package\Spring\spring-framework-3.0.2.RELEASE-dependencies\org.aspectj\com.springsource.org.aspectj.weaver\1.6.8.RELEASE\com.springsource.org.aspectj.weaver-1.6.8.RELEASE.jar;F:\java_package\Spring\spring-framework-3.0.2.RELEASE-dependencies\org.aopalliance\com.springsource.org.aopalliance\1.0.0\com.springsource.org.aopalliance-1.0.0.jar;F:\java_package\Spring\spring-framework-3.0.2.RELEASE-dependencies\org.objectweb.asm\com.springsource.org.objectweb.asm\3.1.0\com.springsource.org.objectweb.asm-3.1.0.jar;E:\developjava\projects\jdbc\mysql\dist\mysql-connector-java-5.1.17-bin.jar;F:\java_package\Hibernate\hibernate-distribution-3.6.2.Final\hibernate3.jar;F:\java_package\Hibernate\hibernate-distribution-3.6.2.Final\lib\required\antlr-2.7.6.jar;F:\java_package\Hibernate\hibernate-distribution-3.6.2.Final\lib\required\commons-collections-3.1.jar;F:\java_package\Hibernate\hibernate-distribution-3.6.2.Final\lib\required\dom4j-1.6.1.jar;F:\java_package\Hibernate\hibernate-distribution-3.6.2.Final\lib\required\javassist-3.12.0.GA.jar;F:\java_package\Hibernate\hibernate-distribution-3.6.2.Final\lib\required\jta-1.1.jar;F:\java_package\Hibernate\hibernate-distribution-3.6.2.Final\lib\required\slf4j-api-1.6.1.jar;E:\developjava\projects\hibernate-distribution-3.6.2.Final\jpa_hibernate\hibernate-jpa-2.0-api-1.0.0.Final.jar;E:\developjava\projects\appache\dist\commons-logging-1.1.1.jar;E:\developjava\projects\appache\dist\log4j-1.2.15.jar;E:\developjava\projects\appache\dist\servlet-api.jar;E:\developjava\projects\logback-0.9.29\logback-classic-0.9.29.jar;E:\developjava\projects\logback-0.9.29\logback-core-0.9.29.jar, hibernate.bytecode.use_reflection_optimizer=false, java.vm.specification.name=Java Virtual Machine Specification, java.vm.specification.version=1.0, sun.cpu.endian=little, sun.os.patch.level=, java.io.tmpdir=C:\Users\HAOYUN~1\AppData\Local\Temp\, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, os.arch=x86, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.ext.dirs=D:\JDK6\jre\lib\ext;C:\Windows\Sun\Java\lib\ext, user.dir=E:\developjava\projects\xcwg, line.separator=
, java.vm.name=Java HotSpot(TM) Client VM, cache.provider_class=org.hibernate.cache.NoCacheProvider, file.encoding=GBK, java.specification.version=1.6, hibernate.show_sql=true, hibernate.connection.pool_size=1}
00:13:38.167 [main] INFO org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.MySQLDialect
00:13:38.214 [main] DEBUG org.hibernate.cfg.Configuration - Processing hbm.xml files
00:13:38.230 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: com.bin.entity.Enterprise -> T_ENTERPRISE
00:13:38.245 [main] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: entId -> ENT_ID
00:13:38.261 [main] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: entName -> ENT_NAME
00:13:38.261 [main] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: shortName -> SHORT_NAME
00:13:38.261 [main] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: spell -> SPELL
00:13:38.261 [main] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: logoUrl -> LOGO_URL
00:13:38.261 [main] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: address -> ADDRESS
00:13:38.261 [main] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: typeId -> TYPE_ID
00:13:38.261 [main] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: tradeID -> TRADE_ID
00:13:38.261 [main] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: corporation -> CORPORATION
00:13:38.261 [main] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: tel -> TEL
00:13:38.261 [main] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: mobile -> MOBILE
00:13:38.261 [main] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: email -> EMAIL
00:13:38.261 [main] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: qq -> QQ
00:13:38.261 [main] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: registerDate -> REGISTER_DATE
00:13:38.261 [main] DEBUG org.hibernate.cfg.Configuration - Process annotated classes
00:13:38.261 [main] DEBUG org.hibernate.cfg.Configuration - processing fk mappings (*ToOne and JoinedSubclass)
00:13:38.277 [main] DEBUG org.hibernate.cfg.Configuration - processing extends queue
00:13:38.277 [main] DEBUG org.hibernate.cfg.Configuration - processing extends queue
00:13:38.277 [main] DEBUG org.hibernate.cfg.Configuration - processing collection mappings
00:13:38.277 [main] DEBUG org.hibernate.cfg.Configuration - processing native query and ResultSetMapping mappings
00:13:38.277 [main] DEBUG org.hibernate.cfg.Configuration - processing association property references
00:13:38.277 [main] DEBUG org.hibernate.cfg.Configuration - processing foreign key constraints
00:13:38.277 [main] INFO org.hibernate.cfg.Configuration - Hibernate Validator not found: ignoring
00:13:38.277 [main] DEBUG o.h.i.f.DefaultIdentifierGeneratorFactory - Setting dialect [org.hibernate.dialect.MySQLDialect]
00:13:38.277 [main] DEBUG org.hibernate.cfg.Configuration - Processing hbm.xml files
00:13:38.277 [main] DEBUG org.hibernate.cfg.Configuration - Process annotated classes
00:13:38.277 [main] DEBUG org.hibernate.cfg.Configuration - processing fk mappings (*ToOne and JoinedSubclass)
00:13:38.277 [main] DEBUG org.hibernate.cfg.Configuration - processing extends queue
00:13:38.277 [main] DEBUG org.hibernate.cfg.Configuration - processing extends queue
00:13:38.277 [main] DEBUG org.hibernate.cfg.Configuration - processing collection mappings
00:13:38.277 [main] DEBUG org.hibernate.cfg.Configuration - processing native query and ResultSetMapping mappings
00:13:38.277 [main] DEBUG org.hibernate.cfg.Configuration - processing association property references
00:13:38.277 [main] DEBUG org.hibernate.cfg.Configuration - processing foreign key constraints
00:13:38.277 [main] DEBUG o.h.i.f.DefaultIdentifierGeneratorFactory - Setting dialect [org.hibernate.dialect.MySQLDialect]
00:13:38.277 [main] DEBUG o.h.i.f.DefaultIdentifierGeneratorFactory - Setting dialect [org.hibernate.dialect.MySQLDialect]
00:13:38.277 [main] INFO o.h.tool.hbm2ddl.SchemaExport - Running hbm2ddl schema export
00:13:38.292 [main] DEBUG o.h.tool.hbm2ddl.SchemaExport - import file not found: /import.sql
00:13:38.292 [main] INFO o.h.tool.hbm2ddl.SchemaExport - exporting generated schema to database
00:13:38.292 [main] INFO o.h.c.DriverManagerConnectionProvider - Using Hibernate built-in connection pool (not for production use!)
00:13:38.292 [main] INFO o.h.c.DriverManagerConnectionProvider - Hibernate connection pool size: 1
00:13:38.292 [main] INFO o.h.c.DriverManagerConnectionProvider - autocommit mode: false
00:13:38.292 [main] INFO o.h.c.DriverManagerConnectionProvider - using driver: org.gjt.mm.mysql.Driver at URL: jdbc:mysql://localhost:3360/xcgw
00:13:38.292 [main] INFO o.h.c.DriverManagerConnectionProvider - connection properties: {user=root, password=root}
00:13:38.292 [main] DEBUG o.h.c.DriverManagerConnectionProvider - opening new JDBC connection
00:13:40.507 [main] ERROR o.h.tool.hbm2ddl.SchemaExport - schema export unsuccessful
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.6.0_11]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) ~[na:1.6.0_11]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) ~[na:1.6.0_11]
at java.lang.reflect.Constructor.newInstance(Constructor.java:513) ~[na:1.6.0_11]
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) ~[mysql-connector-java-5.1.17-bin.jar:na]
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1116) ~[mysql-connector-java-5.1.17-bin.jar:na]
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:344) ~[mysql-connector-java-5.1.17-bin.jar:na]
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2333) ~[mysql-connector-java-5.1.17-bin.jar:na]
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2370) ~[mysql-connector-java-5.1.17-bin.jar:na]
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2154) ~[mysql-connector-java-5.1.17-bin.jar:na]
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:792) ~[mysql-connector-java-5.1.17-bin.jar:na]
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47) ~[mysql-connector-java-5.1.17-bin.jar:na]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.6.0_11]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) ~[na:1.6.0_11]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) ~[na:1.6.0_11]
at java.lang.reflect.Constructor.newInstance(Constructor.java:513) ~[na:1.6.0_11]
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) ~[mysql-connector-java-5.1.17-bin.jar:na]
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:381) ~[mysql-connector-java-5.1.17-bin.jar:na]
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305) ~[mysql-connector-java-5.1.17-bin.jar:na]
at java.sql.DriverManager.getConnection(DriverManager.java:582) ~[na:1.6.0_11]
at java.sql.DriverManager.getConnection(DriverManager.java:154) ~[na:1.6.0_11]
at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133) ~[hibernate3.jar:3.6.2.Final]
at org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:52) ~[hibernate3.jar:3.6.2.Final]
at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:263) [hibernate3.jar:3.6.2.Final]
at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:219) [hibernate3.jar:3.6.2.Final]
at com.bin.test.hibernate.Export.main(Export.java:11) [classes/:na]
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:1.6.0_11]
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) ~[na:1.6.0_11]
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) ~[na:1.6.0_11]
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) ~[na:1.6.0_11]
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) ~[na:1.6.0_11]
at java.net.Socket.connect(Socket.java:519) ~[na:1.6.0_11]
at java.net.Socket.connect(Socket.java:469) ~[na:1.6.0_11]
at java.net.Socket.<init>(Socket.java:366) ~[na:1.6.0_11]
at java.net.Socket.<init>(Socket.java:209) ~[na:1.6.0_11]
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:257) ~[mysql-connector-java-5.1.17-bin.jar:na]
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:294) ~[mysql-connector-java-5.1.17-bin.jar:na]
... 19 common frames omitted
配置文件如下:
hibernate.cfg.xml
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<!-- Database connection settings ?useUnicode=true&characterEncoding=utf-8 -->
<property name="connection.driver_class">org.gjt.mm.mysql.Driver</property>
<property name="connection.url">jdbc:mysql://localhost:3360/xcgw</property>
<property name="connection.username">root</property>
<property name="connection.password">root</property>
<!-- JDBC connection pool (use the built-in) -->
<!--
<property name="connection.pool_size">8</property>
-->
<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<!-- Enable Hibernate's automatic session context management -->
<!--
<property name="current_session_context_class">thread</property>
-->
<!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>
<!-- Drop and re-create the database schema on startup -->
<property name="hbm2ddl.auto">create</property>
<mapping resource="com/bin/entity/Enterprise.hbm.xml" />
</session-factory>
</hibernate-configuration>
Enterprise.hbm.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.bin.entity">
<class name="Enterprise" table="T_ENTERPRISE">
<id name="entId" column="ENT_ID">
<generator class="assigned"/>
</id>
<!-- 企业名称 -->
<property name="entName" type="string" column="ENT_NAME"/>
<!-- 企业简称 -->
<property name="shortName" type="string" column="SHORT_NAME"/>
<!-- 企业拼音首字母 -->
<property name="spell" type="string" column="SPELL"/>
<!-- 企业图标(l o g o) -->
<property name="logoUrl" type="string" column="LOGO_URL"/>
<!-- 企业地址 -->
<property name="address" type="string" column="ADDRESS"/>
<!-- 企业类型ID -->
<property name="typeId" type="string" column="TYPE_ID"/>
<!-- 企业行业ID -->
<property name="tradeID" type="string" column="TRADE_ID"/>
<!-- 法人代表 -->
<property name="corporation" type="string" column="CORPORATION"/>
<!-- 电话(座机) -->
<property name="tel" type="string" column="TEL"/>
<!-- 电话(手机) -->
<property name="mobile" type="string" column="MOBILE"/>
<!-- 电子邮箱 -->
<property name="email" type="string" column="EMAIL"/>
<!-- QQ号码 -->
<property name="qq" type="string" column="QQ"/>
<!-- 注册日期 -->
<property name="registerDate" type="timestamp" column="REGISTER_DATE"/>
</class>
</hibernate-mapping>
Enterprise.java
package com.bin.entity;
import java.util.Date;
public class Enterprise {
//企业ID
private String entId;
//企业名称
private String entName;
//企业简称
private String shortName;
//企业拼音首字母
private String spell;
//企业图标(l o g o)
private String logoUrl;
//企业地址
private String address;
//企业类型ID
private String typeId;
//企业行业ID
private String tradeID;
//法人代表
private String corporation;
//电话(座机)
private String tel;
//电话(手机)
private String mobile;
//电子邮箱
private String email;
//QQ号码
private String qq;
//注册日期
private Date registerDate;
public String getEntId() {
return entId;
}
public void setEntId(String entId) {
this.entId = entId;
}
public String getEntName() {
return entName;
}
public void setEntName(String entName) {
this.entName = entName;
}
public String getShortName() {
return shortName;
}
public void setShortName(String shortName) {
this.shortName = shortName;
}
public String getSpell() {
return spell;
}
public void setSpell(String spell) {
this.spell = spell;
}
public String getLogoUrl() {
return logoUrl;
}
public void setLogoUrl(String logoUrl) {
this.logoUrl = logoUrl;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getTypeId() {
return typeId;
}
public void setTypeId(String typeId) {
this.typeId = typeId;
}
public String getTradeID() {
return tradeID;
}
public void setTradeID(String tradeID) {
this.tradeID = tradeID;
}
public String getCorporation() {
return corporation;
}
public void setCorporation(String corporation) {
this.corporation = corporation;
}
public String getTel() {
return tel;
}
public void setTel(String tel) {
this.tel = tel;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getQq() {
return qq;
}
public void setQq(String qq) {
this.qq = qq;
}
public Date getRegisterDate() {
return registerDate;
}
public void setRegisterDate(Date registerDate) {
this.registerDate = registerDate;
}
}
Export.java
package com.bin.test.hibernate;
import org.hibernate.cfg.Configuration;
import org.hibernate.tool.hbm2ddl.SchemaExport;
public class Export {
public static void main(String[] args) {
SchemaExport exp = new SchemaExport(new Configuration().configure());
exp.create(true, true);
}
}
错误内容的意思是不能连接到数据库,网上有人说是驱动版本不对,有人说是版本不兼容,也有人说是my.ini中wait_timeout值太小,试遍了各种方法均无效,最后冷静下来分析了一下,灵光一闪,原来端口配置错误,画蛇添足了一把,居然将默认的3306写成了3360,当然连接不了数据库了。
给自己记录下这一错误原因,免得以后再犯同样的错误,也方便初学者遇到此问题时有个借鉴的资料。