I found the problem!
It's my fault, I was using Configuration instead of AnnotationConfiguration
at my HibernateUtil class.
Now, I replaced and I have the following error:
Error Trace
Code:
15:03:27,805 INFO Version:15 - Hibernate Annotations 3.3.1.GA
15:03:27,835 INFO Environment:514 - Hibernate 3.2.6
15:03:27,845 INFO Environment:532 - loaded properties from resource hibernate.properties: {hibernate.bytecode.use_reflection_optimizer=false}
15:03:27,845 INFO Environment:681 - Bytecode provider name : cglib
15:03:27,875 INFO Environment:598 - using JDK 1.4 java.sql.Timestamp handling
15:03:27,975 INFO Configuration:1432 - configuring from resource: /hibernate.cfg.xml
15:03:27,975 INFO Configuration:1409 - Configuration resource: /hibernate.cfg.xml
15:03:28,325 DEBUG DTDEntityResolver:38 - trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd]
15:03:28,325 DEBUG DTDEntityResolver:40 - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
15:03:28,335 DEBUG DTDEntityResolver:50 - located [http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd] in classpath
15:03:28,395 DEBUG Configuration:1393 - hibernate.connection.driver_class=com.microsoft.jdbc.sqlserver.SQLServerDriver
15:03:28,395 DEBUG Configuration:1393 - hibernate.connection.password=sql
15:03:28,405 DEBUG Configuration:1393 - hibernate.connection.url=jdbc:microsoft:sqlserver://AYA-NOTEBOOK:1433
15:03:28,405 DEBUG Configuration:1393 - hibernate.connection.username=dba
15:03:28,405 DEBUG Configuration:1393 - hibernate.connection.password=sql
15:03:28,405 DEBUG Configuration:1393 - hibernate.connection.poolSize=1
15:03:28,405 DEBUG Configuration:1393 - hibernate.dialect=org.hibernate.dialect.SQLServerDialect
15:03:28,415 DEBUG Configuration:1393 - show_sql=true
15:03:28,415 DEBUG Configuration:1393 - format_sql=true
15:03:28,415 DEBUG Configuration:1393 - current_session_context_class=thread
15:03:28,415 DEBUG Configuration:1393 - cache.provider_class=org.hibernate.cache.NoCacheProvider
15:03:28,415 DEBUG AnnotationConfiguration:632 - null<-org.dom4j.tree.DefaultAttribute@1c695a6 [Attribute: name class value "com.arballon.gwt.core.server.persistent.MenuItem"]
15:03:28,485 DEBUG AnnotationConfiguration:632 - null<-org.dom4j.tree.DefaultAttribute@13bd574 [Attribute: name class value "com.arballon.gwt.core.server.persistent.MenuFolder"]
15:03:28,485 INFO Configuration:1547 - Configured SessionFactory: null
15:03:28,485 DEBUG Configuration:1548 - properties: {hibernate.connection.password=sql, java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, hibernate.cache.provider_class=org.hibernate.cache.NoCacheProvider, sun.boot.library.path=C:\jdk1.5.0_04\jre\bin, java.vm.version=1.5.0_04-b05, hibernate.connection.username=dba, 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=AR, sun.os.patch.level=Service Pack 2, java.vm.specification.name=Java Virtual Machine Specification, user.dir=C:\eclipse\workspace\ArballonGWT, java.runtime.version=1.5.0_04-b05, hibernate.connection.poolSize=1, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, hibernate.current_session_context_class=thread, java.endorsed.dirs=C:\jdk1.5.0_04\jre\lib\endorsed, os.arch=x86, java.io.tmpdir=c:\temp\, line.separator=
, java.vm.specification.vendor=Sun Microsystems Inc., cache.provider_class=org.hibernate.cache.NoCacheProvider, user.variant=, os.name=Windows XP, sun.jnu.encoding=Cp1252, java.library.path=C:\jdk1.5.0_04\bin;.;C:\WINDOWS\system32;C:\WINDOWS;c:\ruby\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Archivos de programa\ATI Technologies\ATI Control Panel;C:\Archivos de programa\Archivos comunes\Adaptec Shared\System;C:\Archivos de programa\Microsoft SQL Server\80\Tools\Binn\;c:\arballon\Server;c:\arballon\Server\Scripts;c:\arballon\Server\dlls;c:C:\jdk1.5.0_04\bin;c:\Informix\bin, 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\arballon.AYA-NOTEBOOK, user.timezone=America/Buenos_Aires, java.awt.printerjob=sun.awt.windows.WPrinterJob, file.encoding=Cp1252, java.specification.version=1.5, hibernate.format_sql=true, hibernate.connection.driver_class=com.microsoft.jdbc.sqlserver.SQLServerDriver, show_sql=true, user.name=arballon, java.class.path=C:\eclipse\workspace\ArballonGWT\build\classes;C:\eclipse\workspace\gwtde\gwtde-0.1.1.jar;C:\mygwt-0.5.0\mygwt.jar;C:\gwt-windows-1.4.61\gwt-user.jar;C:\gwt-windows-1.4.61\gwt-servlet.jar;C:\hibernate-3.2\hibernate-annotations-3.3.1.GA\lib\ejb3-persistence.jar;C:\hibernate-3.2\hibernate-annotations-3.3.1.GA\hibernate-annotations.jar;C:\hibernate-3.2\hibernate-annotations-3.3.1.GA\lib\hibernate-commons-annotations.jar, format_sql=true, hibernate.bytecode.use_reflection_optimizer=false, hibernate.show_sql=true, current_session_context_class=thread, java.vm.specification.version=1.0, java.home=C:\jdk1.5.0_04\jre, sun.arch.data.model=32, hibernate.dialect=org.hibernate.dialect.SQLServerDialect, hibernate.connection.url=jdbc:microsoft:sqlserver://AYA-NOTEBOOK:1433, user.language=es, java.specification.vendor=Sun Microsystems Inc., awt.toolkit=sun.awt.windows.WToolkit, java.vm.info=mixed mode, java.version=1.5.0_04, java.ext.dirs=C:\jdk1.5.0_04\jre\lib\ext, sun.boot.class.path=C:\hibernate-3.2\hibernate3.jar;C:\hibernate-3.2\lib\commons-collections-2.1.1.jar;C:\hibernate-3.2\lib\log4j-1.2.11.jar;C:\hibernate-3.2\lib\dom4j-1.6.1.jar;C:\hibernate-3.2\lib\jta.jar;C:\hibernate-3.2\lib\antlr-2.7.6.jar;C:\hibernate-3.2\lib\asm.jar;C:\hibernate-3.2\lib\asm-attrs.jar;C:\hibernate-3.2\lib\xml-apis.jar;C:\hibernate-3.2\lib\cglib-2.1.3.jar;C:\hibernate-3.2\lib\commons-logging-1.1.1.jar;C:\hibernate-3.2\lib\xerces-2.6.2.jar;C:\SQLServerJDBC\lib\msutil.jar;C:\SQLServerJDBC\lib\msbase.jar;C:\SQLServerJDBC\lib\mssqlserver.jar;C:\jdk1.5.0_04\jre\lib\rt.jar;C:\jdk1.5.0_04\jre\lib\i18n.jar;C:\jdk1.5.0_04\jre\lib\sunrsasign.jar;C:\jdk1.5.0_04\jre\lib\jsse.jar;C:\jdk1.5.0_04\jre\lib\jce.jar;C:\jdk1.5.0_04\jre\lib\charsets.jar;C:\jdk1.5.0_04\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=}
15:03:28,485 DEBUG AnnotationConfiguration:794 - Validator not present in classpath, ignoring event listener registration
15:03:28,485 DEBUG SearchConfiguration:56 - Search not present in classpath, ignoring event listener registration
15:03:28,485 DEBUG Configuration:1291 - Preparing to build session factory with filters : {}
15:03:28,485 DEBUG AnnotationConfiguration:253 - Execute first pass mapping processing
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.arballon.gwt.core.server.util.HibernateUtil.<clinit>(HibernateUtil.java:16)
at com.arballon.gwt.core.server.dao.HibernateDAOFactory.instantiateDAO(HibernateDAOFactory.java:14)
at com.arballon.gwt.core.server.dao.HibernateDAOFactory.getMenuItemDAO(HibernateDAOFactory.java:8)
at com.arballon.gwt.core.server.test.TestMenuItemDAO.<init>(TestMenuItemDAO.java:17)
at com.arballon.gwt.core.server.test.TestMenuItemDAO.main(TestMenuItemDAO.java:50)
Caused by: java.lang.IllegalAccessError: tried to access method org.hibernate.cfg.Mappings.<init>(Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/List;Ljava/util/List;Lorg/hibernate/cfg/NamingStrategy;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/List;Ljava/util/Map;Ljava/util/Map;)V from class org.hibernate.cfg.ExtendedMappings
at org.hibernate.cfg.ExtendedMappings.<init>(ExtendedMappings.java:69)
at org.hibernate.cfg.AnnotationConfiguration.createExtendedMappings(AnnotationConfiguration.java:182)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:272)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:859)
at com.arballon.gwt.core.server.util.HibernateUtil.<clinit>(HibernateUtil.java:14)
... 4 more
I was checking other posts and I found that this could be because of compatibility versions, but I double check this and is not the case.
I'm using Hibernate 3.2.6 core, Hibernate Annotations 3.3.1
Also Eclipse plug-in is Hibernate Tools 3.2.0
I´m not sure how to continue debuging this problem, I will thank you any help.
Daniel