Hibernate: Criando a base(RESOLVIDO)

1 resposta
rogercafe

Estou com um probleminha na hora de criar minha base em MySQL com hibernate.

minha classe hibernate util
public class HibernateUtil {
[color=red]	private static SessionFactory factory;
	private static AnnotationConfiguration cfg;
	
	static{
		cfg	=	new AnnotationConfiguration();
		cfg.configure();
		factory	=	cfg.buildSessionFactory();
	}
	
	public static Session getSession(){
		return factory.openSession();
	}
	
	public static void create(){
		new SchemaExport(cfg).create(true, true);
	}
	
	public static void close(){
		factory.close();
	}

Mas quando eu chamo hibernateUtil.create; na minha classe exportSchema dá um pequenho probleminha

2006-07-27 11:31:41,359 INFO cfg.annotations.Version -> Hibernate Annotations 3.2.0.CR1 2006-07-27 11:31:41,390 INFO hibernate.cfg.Environment -> Hibernate 3.1.3 2006-07-27 11:31:41,390 INFO hibernate.cfg.Environment -> loaded properties from resource hibernate.properties: {hibernate.connection.username=root, hibernate.connection.password=****, hibernate.cglib.use_reflection_optimizer=true, hibernate.dialect=org.hibernate.dialect.MySQL5Dialect, hibernate.connection.url=jdbc:mysql://localhost:3306/medidas, hibernate.connection.driver_class=org.gjt.mm.mysql.Driver} 2006-07-27 11:31:41,390 INFO hibernate.cfg.Environment -> using CGLIB reflection optimizer 2006-07-27 11:31:41,390 INFO hibernate.cfg.Environment -> using JDK 1.4 java.sql.Timestamp handling 2006-07-27 11:31:41,484 INFO hibernate.cfg.Configuration -> configuring from resource: /hibernate.cfg.xml 2006-07-27 11:31:41,484 INFO hibernate.cfg.Configuration -> Configuration resource: /hibernate.cfg.xml 2006-07-27 11:31:41,765 DEBUG hibernate.util.DTDEntityResolver -> trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd] 2006-07-27 11:31:41,765 DEBUG hibernate.util.DTDEntityResolver -> recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/ 2006-07-27 11:31:41,765 DEBUG hibernate.util.DTDEntityResolver -> located [http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd] in classpath 2006-07-27 11:31:41,812 DEBUG hibernate.cfg.AnnotationConfiguration -> null<-org.dom4j.tree.DefaultAttribute@9ced8e [Attribute: name class value "com.eel.Activity"] 2006-07-27 11:31:41,875 DEBUG hibernate.cfg.AnnotationConfiguration -> null<-org.dom4j.tree.DefaultAttribute@ce2187 [Attribute: name class value "com.eel.ActivityType"] 2006-07-27 11:31:41,890 DEBUG hibernate.cfg.AnnotationConfiguration -> null<-org.dom4j.tree.DefaultAttribute@1fddc31 [Attribute: name class value "com.eel.AgreementType"] 2006-07-27 11:31:41,890 DEBUG hibernate.cfg.AnnotationConfiguration -> null<-org.dom4j.tree.DefaultAttribute@1d225a7 [Attribute: name class value "com.eel.Artifact"] 2006-07-27 11:31:41,890 DEBUG hibernate.cfg.AnnotationConfiguration -> null<-org.dom4j.tree.DefaultAttribute@141b571 [Attribute: name class value "com.eel.ArtifactType"] 2006-07-27 11:31:41,890 DEBUG hibernate.cfg.AnnotationConfiguration -> null<-org.dom4j.tree.DefaultAttribute@e32802 [Attribute: name class value "com.eel.Issue"] 2006-07-27 11:31:41,890 DEBUG hibernate.cfg.AnnotationConfiguration -> null<-org.dom4j.tree.DefaultAttribute@f4f44a [Attribute: name class value "com.eel.Project"] 2006-07-27 11:31:41,890 DEBUG hibernate.cfg.AnnotationConfiguration -> null<-org.dom4j.tree.DefaultAttribute@6ac461 [Attribute: name class value "com.eel.User"] 2006-07-27 11:31:41,890 INFO hibernate.cfg.Configuration -> Configured SessionFactory: null 2006-07-27 11:31:41,890 DEBUG hibernate.cfg.Configuration -> properties: {java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, hibernate.connection.password=salmaco, sun.boot.library.path=C:\Sun\AppServer\jdk\jre\bin, java.vm.version=1.5.0_06-b05, 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=BR, sun.os.patch.level=Service Pack 2, java.vm.specification.name=Java Virtual Machine Specification, user.dir=C:\Documents and Settings\Roger.EEL\workspace\Medidas, java.runtime.version=1.5.0_06-b05, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.endorsed.dirs=C:\Sun\AppServer\jdk\jre\lib\endorsed, os.arch=x86, java.io.tmpdir=C:\DOCUME~1\Roger.EEL\CONFIG~1\Temp\, line.separator= , java.vm.specification.vendor=Sun Microsystems Inc., user.variant=, os.name=Windows XP, sun.jnu.encoding=Cp1252, java.library.path=C:\Sun\AppServer\jdk\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\;C:\Arquivos de programas\Borland\BDS\4.0\Bin;"C:\Arquivos de programas\Microsoft DirectX SDK (February 2006)\Utilities\Bin\x86";C:\Inprise\vbroker\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Arquivos de programas\Microsoft SQL Server\80\Tools\Binn\;c:\program files\borland\StarTeam SDK 2005 R2\Lib;c:\program files\borland\StarTeam SDK 2005 R2\Bin;C:\Arquivos de programas\QuickTime\QTSystem\;C:\Sun\AppServer\bin;C:\Documents and Settings\Roger.EEL\Meus documentos\Borland Studio Projects\Bpl, java.specification.name=Java Platform API Specification, java.class.version=49.0, sun.management.compiler=HotSpot Client Compiler, os.version=5.1, user.home=C:\Documents and Settings\Roger.EEL, user.timezone=GMT-03:00, java.awt.printerjob=sun.awt.windows.WPrinterJob, file.encoding=Cp1252, java.specification.version=1.5, hibernate.connection.driver_class=org.gjt.mm.mysql.Driver, java.class.path=C:\Documents and Settings\Roger.EEL\workspace\Medidas\build\classes;C:\Documents and Settings\Roger.EEL\workspace\Medidas\WebContent\WEB-INF\lib\hibernate-annotations.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\WebContent\WEB-INF\lib\hibernate3.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\WebContent\WEB-INF\lib\log4j-1.2.11.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\WebContent\WEB-INF\lib\mysql-connector-java-3.1.13-bin.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\WebContent\WEB-INF\lib\vraptor-2.0.5.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\WebContent\WEB-INF\lib\xstream-1.1.3.jar;C:\Arquivos de programas\Apache Software Foundation\Tomcat 5.5\common\lib\servlet-api.jar;C:\Arquivos de programas\Apache Software Foundation\Tomcat 5.5\common\lib\jsp-api.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\ant-1.6.5.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\ant-antlr-1.6.5.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\ant-junit-1.6.5.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\ant-launcher-1.6.5.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\antlr-2.7.6rc1.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\ant-swing-1.6.5.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\asm.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\asm-attrs.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\c3p0-0.9.0.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\cglib-2.1.3.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\cleanimports.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\commons-collections-2.1.1.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\commons-logging-1.0.4.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\concurrent-1.3.2.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\connector.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\dom4j-1.6.1.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\ehcache-1.1.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\ejb3-persistence.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\jaas.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\jacc-1_0-fr.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\jaxen-1.1-beta-7.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\jdbc2_0-stdext.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\jgroups-2.2.8.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\jta.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\junit-3.8.1.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\oscache-2.1.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\proxool-0.8.3.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\swarmcache-1.0rc2.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\syndiag2.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\versioncheck.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\xerces-2.6.2.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\xml-apis.jar, user.name=Roger, java.vm.specification.version=1.0, java.home=C:\Sun\AppServer\jdk\jre, sun.arch.data.model=32, hibernate.dialect=org.hibernate.dialect.MySQL5Dialect, hibernate.connection.url=jdbc:mysql://localhost:3306/medidas, user.language=pt, java.specification.vendor=Sun Microsystems Inc., awt.toolkit=sun.awt.windows.WToolkit, hibernate.cglib.use_reflection_optimizer=true, java.vm.info=mixed mode, java.version=1.5.0_06, java.ext.dirs=C:\Sun\AppServer\jdk\jre\lib\ext, sun.boot.class.path=C:\Sun\AppServer\jdk\jre\lib\rt.jar;C:\Sun\AppServer\jdk\jre\lib\i18n.jar;C:\Sun\AppServer\jdk\jre\lib\sunrsasign.jar;C:\Sun\AppServer\jdk\jre\lib\jsse.jar;C:\Sun\AppServer\jdk\jre\lib\jce.jar;C:\Sun\AppServer\jdk\jre\lib\charsets.jar;C:\Sun\AppServer\jdk\jre\classes, java.vendor=Sun Microsystems Inc., file.separator=\, 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=} 2006-07-27 11:31:41,890 DEBUG hibernate.cfg.Configuration -> Preparing to build session factory with filters : {} 2006-07-27 11:31:41,890 DEBUG hibernate.cfg.AnnotationConfiguration -> Execute first pass mapping processing 2006-07-27 11:31:41,984 DEBUG hibernate.cfg.AnnotationConfiguration -> Process hbm files 2006-07-27 11:31:41,984 DEBUG hibernate.cfg.AnnotationConfiguration -> Process annotated classes 2006-07-27 11:31:41,984 DEBUG hibernate.cfg.AnnotationConfiguration -> processing manytoone fk mappings 2006-07-27 11:31:41,984 DEBUG hibernate.cfg.Configuration -> processing extends queue 2006-07-27 11:31:41,984 DEBUG hibernate.cfg.Configuration -> processing collection mappings 2006-07-27 11:31:41,984 DEBUG hibernate.cfg.Configuration -> processing native query and ResultSetMapping mappings 2006-07-27 11:31:41,984 DEBUG hibernate.cfg.Configuration -> processing association property references 2006-07-27 11:31:41,984 DEBUG hibernate.cfg.Configuration -> processing foreign key constraints 2006-07-27 11:31:41,984 INFO hibernate.connection.DriverManagerConnectionProvider -> Using Hibernate built-in connection pool (not for production use!) 2006-07-27 11:31:41,984 INFO hibernate.connection.DriverManagerConnectionProvider -> Hibernate connection pool size: 20 2006-07-27 11:31:41,984 INFO hibernate.connection.DriverManagerConnectionProvider -> autocommit mode: false 2006-07-27 11:31:42,000 INFO hibernate.connection.DriverManagerConnectionProvider -> using driver: org.gjt.mm.mysql.Driver at URL: jdbc:mysql://localhost:3306/medidas 2006-07-27 11:31:42,000 INFO hibernate.connection.DriverManagerConnectionProvider -> connection properties: {user=root, password=salmaco} 2006-07-27 11:31:42,000 DEBUG hibernate.connection.DriverManagerConnectionProvider -> total checked-out connections: 0 2006-07-27 11:31:42,000 DEBUG hibernate.connection.DriverManagerConnectionProvider -> opening new JDBC connection 2006-07-27 11:31:42,359 DEBUG hibernate.connection.DriverManagerConnectionProvider -> created connection to: jdbc:mysql://localhost:3306/medidas, Isolation Level: 4 2006-07-27 11:31:42,359 INFO hibernate.cfg.SettingsFactory -> RDBMS: MySQL, version: 5.0.22-community-nt 2006-07-27 11:31:42,359 INFO hibernate.cfg.SettingsFactory -> JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-3.1.13 ( $Date: 2005-11-17 15:53:48 +0100 (Thu, 17 Nov 2005) $, $Revision$ ) 2006-07-27 11:31:42,359 DEBUG hibernate.connection.DriverManagerConnectionProvider -> returning connection to pool, pool size: 1 2006-07-27 11:31:42,375 INFO hibernate.dialect.Dialect -> Using dialect: org.hibernate.dialect.MySQL5Dialect 2006-07-27 11:31:42,421 INFO hibernate.transaction.TransactionFactoryFactory -> Using default transaction strategy (direct JDBC transactions) 2006-07-27 11:31:42,421 INFO hibernate.transaction.TransactionManagerLookupFactory -> No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended) 2006-07-27 11:31:42,421 INFO hibernate.cfg.SettingsFactory -> Automatic flush during beforeCompletion(): disabled 2006-07-27 11:31:42,421 INFO hibernate.cfg.SettingsFactory -> Automatic session close at end of transaction: disabled 2006-07-27 11:31:42,421 INFO hibernate.cfg.SettingsFactory -> JDBC batch size: 15 2006-07-27 11:31:42,421 INFO hibernate.cfg.SettingsFactory -> JDBC batch updates for versioned data: disabled 2006-07-27 11:31:42,421 INFO hibernate.cfg.SettingsFactory -> Scrollable result sets: enabled 2006-07-27 11:31:42,421 DEBUG hibernate.cfg.SettingsFactory -> Wrap result sets: disabled 2006-07-27 11:31:42,421 INFO hibernate.cfg.SettingsFactory -> JDBC3 getGeneratedKeys(): enabled 2006-07-27 11:31:42,421 INFO hibernate.cfg.SettingsFactory -> Connection release mode: auto 2006-07-27 11:31:42,421 INFO hibernate.cfg.SettingsFactory -> Maximum outer join fetch depth: 2 2006-07-27 11:31:42,421 INFO hibernate.cfg.SettingsFactory -> Default batch fetch size: 1 2006-07-27 11:31:42,421 INFO hibernate.cfg.SettingsFactory -> Generate SQL with comments: disabled 2006-07-27 11:31:42,421 INFO hibernate.cfg.SettingsFactory -> Order SQL updates by primary key: disabled 2006-07-27 11:31:42,421 INFO hibernate.cfg.SettingsFactory -> Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory 2006-07-27 11:31:42,421 INFO hql.ast.ASTQueryTranslatorFactory -> Using ASTQueryTranslatorFactory 2006-07-27 11:31:42,421 INFO hibernate.cfg.SettingsFactory -> Query language substitutions: {} 2006-07-27 11:31:42,421 INFO hibernate.cfg.SettingsFactory -> Second-level cache: enabled 2006-07-27 11:31:42,421 INFO hibernate.cfg.SettingsFactory -> Query cache: disabled 2006-07-27 11:31:42,421 INFO hibernate.cfg.SettingsFactory -> Cache provider: org.hibernate.cache.EhCacheProvider 2006-07-27 11:31:42,437 INFO hibernate.cfg.SettingsFactory -> Optimize cache for minimal puts: disabled 2006-07-27 11:31:42,437 INFO hibernate.cfg.SettingsFactory -> Structured second-level cache entries: disabled 2006-07-27 11:31:42,437 DEBUG hibernate.exception.SQLExceptionConverterFactory -> Using dialect defined converter 2006-07-27 11:31:42,437 INFO hibernate.cfg.SettingsFactory -> Statistics: disabled 2006-07-27 11:31:42,437 INFO hibernate.cfg.SettingsFactory -> Deleted entity synthetic identifier rollback: disabled 2006-07-27 11:31:42,437 INFO hibernate.cfg.SettingsFactory -> Default entity-mode: pojo 2006-07-27 11:31:42,484 INFO hibernate.impl.SessionFactoryImpl -> building session factory 2006-07-27 11:31:42,484 DEBUG hibernate.impl.SessionFactoryImpl -> Session factory constructed with filter configurations : {} 2006-07-27 11:31:42,484 DEBUG hibernate.impl.SessionFactoryImpl -> instantiating session factory with properties: {java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, hibernate.connection.password=salmaco, sun.boot.library.path=C:\Sun\AppServer\jdk\jre\bin, java.vm.version=1.5.0_06-b05, 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=BR, sun.os.patch.level=Service Pack 2, java.vm.specification.name=Java Virtual Machine Specification, user.dir=C:\Documents and Settings\Roger.EEL\workspace\Medidas, java.runtime.version=1.5.0_06-b05, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.endorsed.dirs=C:\Sun\AppServer\jdk\jre\lib\endorsed, os.arch=x86, java.io.tmpdir=C:\DOCUME~1\Roger.EEL\CONFIG~1\Temp\, line.separator= , java.vm.specification.vendor=Sun Microsystems Inc., user.variant=, os.name=Windows XP, sun.jnu.encoding=Cp1252, java.library.path=C:\Sun\AppServer\jdk\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\;C:\Arquivos de programas\Borland\BDS\4.0\Bin;"C:\Arquivos de programas\Microsoft DirectX SDK (February 2006)\Utilities\Bin\x86";C:\Inprise\vbroker\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Arquivos de programas\Microsoft SQL Server\80\Tools\Binn\;c:\program files\borland\StarTeam SDK 2005 R2\Lib;c:\program files\borland\StarTeam SDK 2005 R2\Bin;C:\Arquivos de programas\QuickTime\QTSystem\;C:\Sun\AppServer\bin;C:\Documents and Settings\Roger.EEL\Meus documentos\Borland Studio Projects\Bpl, java.specification.name=Java Platform API Specification, java.class.version=49.0, sun.management.compiler=HotSpot Client Compiler, os.version=5.1, user.home=C:\Documents and Settings\Roger.EEL, user.timezone=GMT-03:00, java.awt.printerjob=sun.awt.windows.WPrinterJob, file.encoding=Cp1252, java.specification.version=1.5, hibernate.connection.driver_class=org.gjt.mm.mysql.Driver, user.name=Roger, java.class.path=C:\Documents and Settings\Roger.EEL\workspace\Medidas\build\classes;C:\Documents and Settings\Roger.EEL\workspace\Medidas\WebContent\WEB-INF\lib\hibernate-annotations.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\WebContent\WEB-INF\lib\hibernate3.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\WebContent\WEB-INF\lib\log4j-1.2.11.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\WebContent\WEB-INF\lib\mysql-connector-java-3.1.13-bin.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\WebContent\WEB-INF\lib\vraptor-2.0.5.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\WebContent\WEB-INF\lib\xstream-1.1.3.jar;C:\Arquivos de programas\Apache Software Foundation\Tomcat 5.5\common\lib\servlet-api.jar;C:\Arquivos de programas\Apache Software Foundation\Tomcat 5.5\common\lib\jsp-api.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\ant-1.6.5.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\ant-antlr-1.6.5.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\ant-junit-1.6.5.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\ant-launcher-1.6.5.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\antlr-2.7.6rc1.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\ant-swing-1.6.5.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\asm.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\asm-attrs.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\c3p0-0.9.0.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\cglib-2.1.3.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\cleanimports.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\commons-collections-2.1.1.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\commons-logging-1.0.4.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\concurrent-1.3.2.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\connector.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\dom4j-1.6.1.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\ehcache-1.1.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\ejb3-persistence.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\jaas.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\jacc-1_0-fr.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\jaxen-1.1-beta-7.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\jdbc2_0-stdext.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\jgroups-2.2.8.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\jta.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\junit-3.8.1.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\oscache-2.1.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\proxool-0.8.3.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\swarmcache-1.0rc2.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\syndiag2.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\versioncheck.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\xerces-2.6.2.jar;C:\Documents and Settings\Roger.EEL\workspace\Medidas\xml-apis.jar, java.vm.specification.version=1.0, sun.arch.data.model=32, java.home=C:\Sun\AppServer\jdk\jre, hibernate.connection.url=jdbc:mysql://localhost:3306/medidas, hibernate.dialect=org.hibernate.dialect.MySQL5Dialect, java.specification.vendor=Sun Microsystems Inc., user.language=pt, awt.toolkit=sun.awt.windows.WToolkit, java.vm.info=mixed mode, hibernate.cglib.use_reflection_optimizer=true, java.version=1.5.0_06, java.ext.dirs=C:\Sun\AppServer\jdk\jre\lib\ext, sun.boot.class.path=C:\Sun\AppServer\jdk\jre\lib\rt.jar;C:\Sun\AppServer\jdk\jre\lib\i18n.jar;C:\Sun\AppServer\jdk\jre\lib\sunrsasign.jar;C:\Sun\AppServer\jdk\jre\lib\jsse.jar;C:\Sun\AppServer\jdk\jre\lib\jce.jar;C:\Sun\AppServer\jdk\jre\lib\charsets.jar;C:\Sun\AppServer\jdk\jre\classes, java.vendor=Sun Microsystems Inc., file.separator=\, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, sun.cpu.endian=little, sun.io.unicode.encoding=UnicodeLittle, sun.desktop=windows, sun.cpu.isalist=} 2006-07-27 11:31:42,484 DEBUG sf.ehcache.CacheManager -> Creating new CacheManager with default config 2006-07-27 11:31:42,500 DEBUG sf.ehcache.CacheManager -> Configuring ehcache from classpath. 2006-07-27 11:31:42,500 WARN ehcache.config.Configurator -> No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/C:/Documents%20and%20Settings/Roger.EEL/workspace/Medidas/ehcache-1.1.jar!/ehcache-failsafe.xml 2006-07-27 11:31:42,515 DEBUG ehcache.config.Configuration$DiskStore -> Disk Store Path: C:\DOCUME~1\Roger.EEL\CONFIG~1\Temp\ 2006-07-27 11:31:42,515 DEBUG hibernate.impl.SessionFactoryObjectFactory -> initializing class SessionFactoryObjectFactory 2006-07-27 11:31:42,531 DEBUG hibernate.impl.SessionFactoryObjectFactory -> registered: 402880a80cb065e2010cb065e2b30000 (unnamed) 2006-07-27 11:31:42,531 INFO hibernate.impl.SessionFactoryObjectFactory -> Not binding factory to JNDI, no JNDI name configured 2006-07-27 11:31:42,531 DEBUG hibernate.impl.SessionFactoryImpl -> instantiated session factory 2006-07-27 11:31:42,531 DEBUG hibernate.impl.SessionFactoryImpl -> Checking 0 named HQL queries 2006-07-27 11:31:42,531 DEBUG hibernate.impl.SessionFactoryImpl -> Checking 0 named SQL queries 2006-07-27 11:31:42,531 INFO hibernate.dialect.Dialect -> Using dialect: org.hibernate.dialect.MySQL5Dialect 2006-07-27 11:31:42,531 DEBUG hibernate.cfg.AnnotationConfiguration -> Execute first pass mapping processing 2006-07-27 11:31:42,531 DEBUG hibernate.cfg.AnnotationConfiguration -> Process hbm files 2006-07-27 11:31:42,531 DEBUG hibernate.cfg.AnnotationConfiguration -> Process annotated classes 2006-07-27 11:31:42,531 DEBUG hibernate.cfg.AnnotationConfiguration -> processing manytoone fk mappings 2006-07-27 11:31:42,531 DEBUG hibernate.cfg.Configuration -> processing extends queue 2006-07-27 11:31:42,531 DEBUG hibernate.cfg.Configuration -> processing collection mappings 2006-07-27 11:31:42,531 DEBUG hibernate.cfg.Configuration -> processing native query and ResultSetMapping mappings 2006-07-27 11:31:42,531 DEBUG hibernate.cfg.Configuration -> processing association property references 2006-07-27 11:31:42,531 DEBUG hibernate.cfg.Configuration -> processing foreign key constraints 2006-07-27 11:31:42,546 DEBUG hibernate.cfg.AnnotationConfiguration -> Execute first pass mapping processing 2006-07-27 11:31:42,546 DEBUG hibernate.cfg.AnnotationConfiguration -> Process hbm files 2006-07-27 11:31:42,546 DEBUG hibernate.cfg.AnnotationConfiguration -> Process annotated classes 2006-07-27 11:31:42,546 DEBUG hibernate.cfg.AnnotationConfiguration -> processing manytoone fk mappings 2006-07-27 11:31:42,546 DEBUG hibernate.cfg.Configuration -> processing extends queue 2006-07-27 11:31:42,546 DEBUG hibernate.cfg.Configuration -> processing collection mappings 2006-07-27 11:31:42,546 DEBUG hibernate.cfg.Configuration -> processing native query and ResultSetMapping mappings 2006-07-27 11:31:42,546 DEBUG hibernate.cfg.Configuration -> processing association property references 2006-07-27 11:31:42,546 DEBUG hibernate.cfg.Configuration -> processing foreign key constraints 2006-07-27 11:31:42,546 INFO tool.hbm2ddl.SchemaExport -> Running hbm2ddl schema export 2006-07-27 11:31:42,546 DEBUG tool.hbm2ddl.SchemaExport -> import file not found: /import.sql 2006-07-27 11:31:42,546 INFO tool.hbm2ddl.SchemaExport -> exporting generated schema to database 2006-07-27 11:31:42,546 INFO hibernate.connection.DriverManagerConnectionProvider -> Using Hibernate built-in connection pool (not for production use!) 2006-07-27 11:31:42,546 INFO hibernate.connection.DriverManagerConnectionProvider -> Hibernate connection pool size: 20 2006-07-27 11:31:42,546 INFO hibernate.connection.DriverManagerConnectionProvider -> autocommit mode: false 2006-07-27 11:31:42,546 INFO hibernate.connection.DriverManagerConnectionProvider -> using driver: org.gjt.mm.mysql.Driver at URL: jdbc:mysql://localhost:3306/medidas 2006-07-27 11:31:42,546 INFO hibernate.connection.DriverManagerConnectionProvider -> connection properties: {user=root, password=salmaco} 2006-07-27 11:31:42,546 DEBUG hibernate.connection.DriverManagerConnectionProvider -> total checked-out connections: 0 2006-07-27 11:31:42,546 DEBUG hibernate.connection.DriverManagerConnectionProvider -> opening new JDBC connection 2006-07-27 11:31:42,593 DEBUG hibernate.connection.DriverManagerConnectionProvider -> created connection to: jdbc:mysql://localhost:3306/medidas, Isolation Level: 4 2006-07-27 11:31:42,593 INFO tool.hbm2ddl.SchemaExport -> schema export complete 2006-07-27 11:31:42,593 DEBUG hibernate.connection.DriverManagerConnectionProvider -> returning connection to pool, pool size: 1 2006-07-27 11:31:42,593 INFO hibernate.connection.DriverManagerConnectionProvider -> cleaning up connection pool: jdbc:mysql://localhost:3306/medidas 2006-07-27 11:31:42,671 DEBUG hibernate.impl.SessionImpl -> opened session at timestamp: 4726827837886464 2006-07-27 11:31:42,671 DEBUG hibernate.transaction.JDBCTransaction -> begin 2006-07-27 11:31:42,671 DEBUG hibernate.jdbc.ConnectionManager -> opening JDBC connection 2006-07-27 11:31:42,671 DEBUG hibernate.connection.DriverManagerConnectionProvider -> total checked-out connections: 0 2006-07-27 11:31:42,671 DEBUG hibernate.connection.DriverManagerConnectionProvider -> using pooled JDBC connection, pool size: 0 2006-07-27 11:31:42,671 DEBUG hibernate.transaction.JDBCTransaction -> current autocommit status: false 2006-07-27 11:31:42,671 DEBUG hibernate.jdbc.JDBCContext -> after transaction begin 2006-07-27 11:31:42,687 DEBUG event.def.DefaultSaveOrUpdateEventListener -> saving transient instance Exception in thread "main" org.hibernate.MappingException: Unknown entity: com.eel.Project at org.hibernate.impl.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:514) at org.hibernate.impl.SessionImpl.getEntityPersister(SessionImpl.java:1302) at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:89) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:186) at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:175) at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70) at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:530) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:518) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:514) at com.eel.dao.Dao.insert(Dao.java:28) at com.eel.dao.ExportEschema.main(ExportEschema.java:14)[/color]
Mas minha classe project está toda mapeada:
package com.eel;

import javax.persistence.GeneratedValue;
import javax.persistence.Id;

import org.hibernate.annotations.Entity;

/***********************************************************************
 * Module:  Project.java
 * Author:  rodrigo
 * Purpose: Defines the Class Project
 ***********************************************************************/
@Entity
public class Project
{
	@Id
	@GeneratedValue
	private Integer	id;
	private String 	name;
	
	public Integer getId() {
		return id;
	}
	public String getName() {
		return name;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public void setName(String name) {
		this.name = name;
	}

}

inclusive no meu arquivo hibernate.cfg.xml

<?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>
		<mapping class="com.eel.Activity"/>
		<mapping class="com.eel.ActivityType"/>
		<mapping class="com.eel.AgreementType"/>		
		<mapping class="com.eel.Artifact"/>
		<mapping class="com.eel.ArtifactType"/>
		<mapping class="com.eel.Issue"/>
		<mapping class="com.eel.Project"/>
		<mapping class="com.eel.User"/>
	</session-factory>
</hibernate-configuration>

a base de dados já está criada, mas não há nenhuma tabela. Sei que ele deveria criar automaticamente, mas até agora nada.
bom, aguardo ajudas.... t+

1 Resposta

rogercafe

Resolvido pessoas :smiley:
O problema era que eu estava puxando a anotação da package org.hibernate.annotations.Entity quando na verdade deveria usar:
javax.persistence.Entity
Mudei isso e foi que é uma beleza.

Gostaria de deixar uma ressalva, esse fórum é demais^^

Criado 27 de julho de 2006
Ultima resposta 27 de jul. de 2006
Respostas 1
Participantes 1