-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: [Hibernate3-Annotation-Spring] hbm2ddl not working :(
PostPosted: Wed Jun 27, 2007 4:04 pm 
Newbie

Joined: Wed Jun 27, 2007 11:30 am
Posts: 12
Hi !
How are you guyz ? I'd like to know if someone had seen the problem below. But before you answer 'Google more' or 'Search that', be sure I've done all search I can.

I dev a webapp with Spring and Hibernate3, deployed on simple Tomcat 5.5.17. The problem is when I use Model.java/Model.hbm.xml, it's allright, MySQL mapping with InnoDB is okay by hbm2ddl. BUT, when I use the same Model.java with "annotations", nothing happens ! No Table is created !


Here is my SessionConfig :

Code:
<bean id="sessionFactory"
      class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
      <property name="dataSource">
         <ref bean="dataSource" />
      </property>
     
      <property name="configurationClass">
         <value>org.hibernate.cfg.AnnotationConfiguration</value>
      </property>

      <property name="configLocation">
         <value>classpath:org/config/hibernate.cfg.xml</value>
      </property>

      <property name="hibernateProperties">
         <props>
            <prop key="hibernate.dialect">
               org.hibernate.dialect.MySQLInnoDBDialect
            </prop>
            <prop key="hibernate.show_sql">true</prop>
            <prop key="hibernate.cglib.use_reflection_optimizer">
               true
            </prop>
            <prop key="hibernate.cache.provider_class">
               org.hibernate.cache.EhCacheProvider
            </prop>
            <prop key="hibernate.cache.use_query_cache">true</prop>
            <prop key="hibernate.cache.use_second_level_cache">
               true
            </prop>
            <prop key="hibernate.hbm2ddl.auto">create-drop</prop>
         </props>
      </property>
   </bean>



hibernate.cfg.xml

Code:
<?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 resource="org/model/Model.hbm.xml" /> //this work
      <mapping class="org.model.Message" />                   //this doesn’t
   </session-factory>

</hibernate-configuration>


My class Message
Code:
package org.model;

import java.util.Date;

import javax.persistence.Id;

import org.hibernate.annotations.Entity;

@Entity
public class Message{

   private long id;

   private String auteur;

   private Date date;

   private String titre;

   private String text;

   @Id
   public long getId() {
      return id;
   }

   public void setId(long id) {
      this.id = id;
   }

   public String getAuteur() {
      return auteur;
   }

   public void setAuteur(String auteur) {
      this.auteur = auteur;
   }

   public Date getDate() {
      return date;
   }

   public void setDate(Date date) {
      this.date = date;
   }

   public String getText() {
      return text;
   }

   public void setText(String text) {
      this.text = text;
   }

   public String getTitre() {
      return titre;
   }

   public void setTitre(String titre) {
      this.titre = titre;
   }

}


And my log4j

Code:
2007-06-27 17:16:07,387 INFO [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/My_ServiceProvider]] - <Initializing Spring root WebApplicationContext>
2007-06-27 17:16:07,389 INFO [org.springframework.web.context.ContextLoader] - <Root WebApplicationContext: initialization started>
2007-06-27 17:16:07,456 INFO [org.springframework.web.context.support.XmlWebApplicationContext] - <Refreshing org.springframework.web.context.support.XmlWebApplicationContext@c3c315: display name [Root WebApplicationContext]; startup date [Wed Jun 27 17:16:07 CEST 2007]; root of context hierarchy>
2007-06-27 17:16:07,651 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - <Loading XML bean definitions from ServletContext resource [/WEB-INF/classes/org/config/applicationContext.xml]>
2007-06-27 17:16:07,818 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - <Loading XML bean definitions from class path resource [org/codehaus/xfire/spring/xfire.xml]>
2007-06-27 17:16:07,842 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - <Loading XML bean definitions from class path resource [org/codehaus/xfire/spring/customEditors.xml]>
2007-06-27 17:16:07,882 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - <Loading XML bean definitions from ServletContext resource [/WEB-INF/classes/org/config/dao.xml]>
2007-06-27 17:16:07,900 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - <Loading XML bean definitions from ServletContext resource [/WEB-INF/classes/org/config/domain.xml]>
2007-06-27 17:16:07,912 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - <Loading XML bean definitions from ServletContext resource [/WEB-INF/classes/org/config/ws.xml]>
2007-06-27 17:16:07,924 INFO [org.springframework.web.context.support.XmlWebApplicationContext] - <Bean factory for application context [org.springframework.web.context.support.XmlWebApplicationContext@c3c315]: org.springframework.beans.factory.support.DefaultListableBeanFactory@8b8a47>
2007-06-27 17:16:08,086 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@8b8a47: defining beans [xfire.customEditorConfigurer,xfire.serviceRegistry,xfire.transportManager,xfire,xfire.typeMappingRegistry,xfire.aegisBindingProvider,xfire.serviceFactory,xfire.servletController,xfire.messageServiceFactory,xfire.messageBindingProvider,dataSource,sessionFactory,transactionManager,jdbcExceptionTranslator,hibernateTemplate,jdbcTemplate,txProxyTemplate,webAnnotations,handlerMapping,org.springframework.web.servlet.handler.SimpleUrlHandlerMapping]; root of factory hierarchy>
2007-06-27 17:16:08,295 INFO [org.springframework.jdbc.datasource.DriverManagerDataSource] - <Loaded JDBC driver: com.mysql.jdbc.Driver>
2007-06-27 17:16:08,361 INFO [org.hibernate.cfg.annotations.Version] - <Hibernate Annotations 3.3.0.GA>
2007-06-27 17:16:08,388 INFO [org.hibernate.cfg.Environment] - <Hibernate 3.2.4>
2007-06-27 17:16:08,396 INFO [org.hibernate.cfg.Environment] - <hibernate.properties not found>
2007-06-27 17:16:08,401 INFO [org.hibernate.cfg.Environment] - <Bytecode provider name : cglib>
2007-06-27 17:16:08,408 INFO [org.hibernate.cfg.Environment] - <using JDK 1.4 java.sql.Timestamp handling>
2007-06-27 17:16:08,549 INFO [org.hibernate.cfg.Configuration] - <configuring from url: file:/home/icare/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/webapps/My_ServiceProvider/WEB-INF/classes/org/config/hibernate.cfg.xml>
2007-06-27 17:16:08,615 DEBUG [org.hibernate.util.DTDEntityResolver] - <trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd]>
2007-06-27 17:16:08,616 DEBUG [org.hibernate.util.DTDEntityResolver] - <recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/>
2007-06-27 17:16:08,617 DEBUG [org.hibernate.util.DTDEntityResolver] - <located [http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd] in classpath>
2007-06-27 17:16:08,652 DEBUG [org.hibernate.cfg.AnnotationConfiguration] - <null<-org.dom4j.tree.DefaultAttribute@12b19c5 [Attribute: name resource value "org/model/Model.hbm.xml"]>
2007-06-27 17:16:08,653 INFO [org.hibernate.cfg.Configuration] - <Reading mappings from resource : org/model/Model.hbm.xml>
2007-06-27 17:16:08,711 DEBUG [org.hibernate.util.DTDEntityResolver] - <trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd]>
2007-06-27 17:16:08,712 DEBUG [org.hibernate.util.DTDEntityResolver] - <recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/>
2007-06-27 17:16:08,713 DEBUG [org.hibernate.util.DTDEntityResolver] - <located [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd] in classpath>
2007-06-27 17:16:08,779 DEBUG [org.hibernate.cfg.AnnotationConfiguration] - <null<-org.dom4j.tree.DefaultAttribute@14c28db [Attribute: name class value "org.model.Message"]>
2007-06-27 17:16:08,805 INFO [org.hibernate.cfg.Configuration] - <Configured SessionFactory: null>
2007-06-27 17:16:08,806 DEBUG [org.hibernate.cfg.Configuration] - <properties: {java.runtime.name=Java(TM) SE Runtime Environment, sun.boot.library.path=/usr/java/jdk/jre/lib/i386, java.vm.version=1.6.0-b105, shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar, java.vm.vendor=Sun Microsystems Inc., java.vendor.url=http://java.sun.com/, path.separator=:, java.vm.name=Java HotSpot(TM) Server VM, tomcat.util.buf.StringCache.byte.enabled=true, file.encoding.pkg=sun.io, user.country=FR, sun.java.launcher=SUN_STANDARD, sun.os.patch.level=unknown, java.vm.specification.name=Java Virtual Machine Specification, user.dir=/home/icare, java.runtime.version=1.6.0-b105, java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment, java.endorsed.dirs=/usr/local/web-icare1/common/endorsed, os.arch=i386, java.io.tmpdir=/tmp, webapp.root=/home/icare/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/webapps/My_ServiceProvider/, line.separator=
, java.vm.specification.vendor=Sun Microsystems Inc., java.naming.factory.url.pkgs=org.apache.naming, os.name=Linux, sun.jnu.encoding=UTF-8, java.library.path=/usr/java/jdk/jre/lib/i386/server:/usr/java/jdk/jre/lib/i386:/usr/java/jdk/jre/../lib/i386:/usr/java/jdk1.6.0_01/jre/lib/i386/server:/usr/java/jdk1.6.0_01/jre/lib/i386:/usr/java/jdk1.6.0_01/jre/../lib/i386:/usr/lib/firefox-1.5.0.10:/usr/java/packages/lib/i386:/lib:/usr/lib, java.specification.name=Java Platform API Specification, java.class.version=50.0, sun.management.compiler=HotSpot Server Compiler, os.version=2.6.20-1.2948.fc6, user.home=/root, user.timezone=Europe/Paris, catalina.useNaming=true, hibernate.connection.release_mode=on_close, java.awt.printerjob=sun.print.PSPrinterJob, file.encoding=UTF-8, java.specification.version=1.6, catalina.home=/usr/local/web-icare1, java.class.path=/usr/local/web-icare1/bin/bootstrap.jar:/usr/java/jdk/lib/tools.jar, user.name=root, hibernate.bytecode.use_reflection_optimizer=false, java.naming.factory.initial=org.apache.naming.java.javaURLContextFactory, package.definition=sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper., java.vm.specification.version=1.0, java.home=/usr/java/jdk/jre, sun.arch.data.model=32, user.language=fr, java.specification.vendor=Sun Microsystems Inc., java.vm.info=mixed mode, java.version=1.6.0, java.ext.dirs=/usr/java/jdk/jre/lib/ext:/usr/java/packages/lib/ext, sun.boot.class.path=/usr/local/web-icare1/common/endorsed/jutf7.jar:/usr/local/web-icare1/common/endorsed/xercesImpl.jar:/usr/java/jdk/jre/lib/resources.jar:/usr/java/jdk/jre/lib/rt.jar:/usr/java/jdk/jre/lib/sunrsasign.jar:/usr/java/jdk/jre/lib/jsse.jar:/usr/java/jdk/jre/lib/jce.jar:/usr/java/jdk/jre/lib/charsets.jar:/usr/java/jdk/jre/classes, server.loader=${catalina.home}/server/classes,${catalina.home}/server/lib/*.jar, java.vendor=Sun Microsystems Inc., catalina.base=/home/icare/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0, file.separator=/, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, common.loader=${catalina.home}/common/classes,${catalina.home}/common/i18n/*.jar,${catalina.home}/common/endorsed/*.jar,${catalina.home}/common/lib/*.jar, sun.io.unicode.encoding=UnicodeLittle, sun.cpu.endian=little, package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.,sun.beans., sun.desktop=gnome, sun.cpu.isalist=}>
2007-06-27 17:16:08,812 INFO [org.springframework.orm.hibernate3.LocalSessionFactoryBean] - <Building new Hibernate SessionFactory>
2007-06-27 17:16:08,822 DEBUG [org.hibernate.cfg.AnnotationConfiguration] - <Search not present in classpath, ignoring event listener registration>
2007-06-27 17:16:08,822 DEBUG [org.hibernate.cfg.Configuration] - <Preparing to build session factory with filters : {}>
2007-06-27 17:16:08,822 DEBUG [org.hibernate.cfg.AnnotationConfiguration] - <Execute first pass mapping processing>
2007-06-27 17:16:08,919 DEBUG [org.hibernate.cfg.AnnotationConfiguration] - <Process hbm files>
2007-06-27 17:16:08,963 INFO [org.hibernate.cfg.HbmBinder] - <Mapping class: org.model.Model -> Model_items>
2007-06-27 17:16:08,971 DEBUG [org.hibernate.cfg.HbmBinder] - <Mapped property: itemId -> itemId>
2007-06-27 17:16:08,984 DEBUG [org.hibernate.cfg.HbmBinder] - <Mapped property: userId -> userId>
2007-06-27 17:16:08,984 DEBUG [org.hibernate.cfg.HbmBinder] - <Mapped property: pubDate -> pubDate>
2007-06-27 17:16:08,984 DEBUG [org.hibernate.cfg.HbmBinder] - <Mapped property: title -> title>
2007-06-27 17:16:08,984 DEBUG [org.hibernate.cfg.HbmBinder] - <Mapped property: description -> description>
2007-06-27 17:16:08,985 DEBUG [org.hibernate.cfg.HbmBinder] - <Mapped property: link -> link>
2007-06-27 17:16:08,985 DEBUG [org.hibernate.cfg.HbmBinder] - <Mapped property: latitude -> latitude>
2007-06-27 17:16:08,985 DEBUG [org.hibernate.cfg.HbmBinder] - <Mapped property: longitude -> longitude>
2007-06-27 17:16:08,985 DEBUG [org.hibernate.cfg.AnnotationConfiguration] - <Process annotated classes>
2007-06-27 17:16:08,985 DEBUG [org.hibernate.cfg.AnnotationConfiguration] - <processing manytoone fk mappings>
2007-06-27 17:16:08,987 DEBUG [org.hibernate.cfg.Configuration] - <processing extends queue>
2007-06-27 17:16:08,987 DEBUG [org.hibernate.cfg.Configuration] - <processing collection mappings>
2007-06-27 17:16:08,987 DEBUG [org.hibernate.cfg.Configuration] - <processing native query and ResultSetMapping mappings>
2007-06-27 17:16:08,987 DEBUG [org.hibernate.cfg.Configuration] - <processing association property references>
2007-06-27 17:16:08,987 DEBUG [org.hibernate.cfg.Configuration] - <processing foreign key constraints>
2007-06-27 17:16:08,996 INFO [org.hibernate.validator.Version] - <Hibernate Validator 3.0.0.GA>
2007-06-27 17:16:09,001 DEBUG [org.hibernate.validator.ClassValidator] - <ResourceBundle ValidatorMessages not found in thread context classloader>
2007-06-27 17:16:09,001 DEBUG [org.hibernate.validator.ClassValidator] - <ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages>
2007-06-27 17:16:09,123 WARN [org.hibernate.cfg.Environment] - <Property [hibernate.cglib.use_reflection_optimizer] has been renamed to [hibernate.bytecode.use_reflection_optimizer]; update your properties appropriately>
2007-06-27 17:16:09,128 INFO [org.hibernate.connection.ConnectionProviderFactory] - <Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider>
2007-06-27 17:16:09,350 INFO [org.hibernate.cfg.SettingsFactory] - <RDBMS: MySQL, version: 5.0.27>
2007-06-27 17:16:09,350 INFO [org.hibernate.cfg.SettingsFactory] - <JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.0.5 ( $Date: 2007-03-01 00:01:06 +0100 (Thu, 01 Mar 2007) $, $Revision: 6329 $ )>
2007-06-27 17:16:09,374 INFO [org.hibernate.dialect.Dialect] - <Using dialect: org.hibernate.dialect.MySQLInnoDBDialect>
2007-06-27 17:16:09,381 INFO [org.hibernate.transaction.TransactionFactoryFactory] - <Using default transaction strategy (direct JDBC transactions)>
2007-06-27 17:16:09,384 INFO [org.hibernate.transaction.TransactionManagerLookupFactory] - <No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)>
2007-06-27 17:16:09,384 INFO [org.hibernate.cfg.SettingsFactory] - <Automatic flush during beforeCompletion(): disabled>
2007-06-27 17:16:09,384 INFO [org.hibernate.cfg.SettingsFactory] - <Automatic session close at end of transaction: disabled>
2007-06-27 17:16:09,384 INFO [org.hibernate.cfg.SettingsFactory] - <JDBC batch size: 15>
2007-06-27 17:16:09,385 INFO [org.hibernate.cfg.SettingsFactory] - <JDBC batch updates for versioned data: disabled>
2007-06-27 17:16:09,386 INFO [org.hibernate.cfg.SettingsFactory] - <Scrollable result sets: enabled>
2007-06-27 17:16:09,386 DEBUG [org.hibernate.cfg.SettingsFactory] - <Wrap result sets: disabled>
2007-06-27 17:16:09,386 INFO [org.hibernate.cfg.SettingsFactory] - <JDBC3 getGeneratedKeys(): enabled>
2007-06-27 17:16:09,386 INFO [org.hibernate.cfg.SettingsFactory] - <Connection release mode: on_close>
2007-06-27 17:16:09,386 INFO [org.hibernate.cfg.SettingsFactory] - <Maximum outer join fetch depth: 2>
2007-06-27 17:16:09,386 INFO [org.hibernate.cfg.SettingsFactory] - <Default batch fetch size: 1>
2007-06-27 17:16:09,386 INFO [org.hibernate.cfg.SettingsFactory] - <Generate SQL with comments: disabled>
2007-06-27 17:16:09,387 INFO [org.hibernate.cfg.SettingsFactory] - <Order SQL updates by primary key: disabled>
2007-06-27 17:16:09,387 INFO [org.hibernate.cfg.SettingsFactory] - <Order SQL inserts for batching: disabled>
2007-06-27 17:16:09,387 INFO [org.hibernate.cfg.SettingsFactory] - <Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory>
2007-06-27 17:16:09,390 INFO [org.hibernate.hql.ast.ASTQueryTranslatorFactory] - <Using ASTQueryTranslatorFactory>
2007-06-27 17:16:09,390 INFO [org.hibernate.cfg.SettingsFactory] - <Query language substitutions: {}>
2007-06-27 17:16:09,390 INFO [org.hibernate.cfg.SettingsFactory] - <JPA-QL strict compliance: disabled>
2007-06-27 17:16:09,391 INFO [org.hibernate.cfg.SettingsFactory] - <Second-level cache: enabled>
2007-06-27 17:16:09,391 INFO [org.hibernate.cfg.SettingsFactory] - <Query cache: enabled>
2007-06-27 17:16:09,391 INFO [org.hibernate.cfg.SettingsFactory] - <Cache provider: org.hibernate.cache.EhCacheProvider>
2007-06-27 17:16:09,395 INFO [org.hibernate.cfg.SettingsFactory] - <Optimize cache for minimal puts: disabled>
2007-06-27 17:16:09,395 INFO [org.hibernate.cfg.SettingsFactory] - <Structured second-level cache entries: disabled>
2007-06-27 17:16:09,395 INFO [org.hibernate.cfg.SettingsFactory] - <Query cache factory: org.hibernate.cache.StandardQueryCacheFactory>
2007-06-27 17:16:09,400 DEBUG [org.hibernate.exception.SQLExceptionConverterFactory] - <Using dialect defined converter>
2007-06-27 17:16:09,407 INFO [org.hibernate.cfg.SettingsFactory] - <Echoing all SQL to stdout>
2007-06-27 17:16:09,407 INFO [org.hibernate.cfg.SettingsFactory] - <Statistics: disabled>
2007-06-27 17:16:09,407 INFO [org.hibernate.cfg.SettingsFactory] - <Deleted entity synthetic identifier rollback: disabled>
2007-06-27 17:16:09,407 INFO [org.hibernate.cfg.SettingsFactory] - <Default entity-mode: pojo>
2007-06-27 17:16:09,407 INFO [org.hibernate.cfg.SettingsFactory] - <Named query checking : enabled>
2007-06-27 17:16:09,433 DEBUG [org.hibernate.validator.ClassValidator] - <ResourceBundle ValidatorMessages not found in thread context classloader>
2007-06-27 17:16:09,433 DEBUG [org.hibernate.validator.ClassValidator] - <ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages>
2007-06-27 17:16:09,454 INFO [org.hibernate.impl.SessionFactoryImpl] - <building session factory>
2007-06-27 17:16:09,457 DEBUG [org.hibernate.impl.SessionFactoryImpl] - <Session factory constructed with filter configurations : {}>
2007-06-27 17:16:09,457 DEBUG [org.hibernate.impl.SessionFactoryImpl] - <instantiating session factory with properties: {java.vendor=Sun Microsystems Inc., sun.java.launcher=SUN_STANDARD, catalina.base=/home/icare/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0, sun.management.compiler=HotSpot Server Compiler, catalina.useNaming=true, os.name=Linux, sun.boot.class.path=/usr/local/web-icare1/common/endorsed/jutf7.jar:/usr/local/web-icare1/common/endorsed/xercesImpl.jar:/usr/java/jdk/jre/lib/resources.jar:/usr/java/jdk/jre/lib/rt.jar:/usr/java/jdk/jre/lib/sunrsasign.jar:/usr/java/jdk/jre/lib/jsse.jar:/usr/java/jdk/jre/lib/jce.jar:/usr/java/jdk/jre/lib/charsets.jar:/usr/java/jdk/jre/classes, sun.desktop=gnome, java.vm.specification.vendor=Sun Microsystems Inc., java.runtime.version=1.6.0-b105, hibernate.cache.provider_class=org.hibernate.cache.EhCacheProvider, user.name=root, shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar, tomcat.util.buf.StringCache.byte.enabled=true, hibernate.connection.release_mode=on_close, user.language=fr, java.naming.factory.initial=org.apache.naming.java.javaURLContextFactory, sun.boot.library.path=/usr/java/jdk/jre/lib/i386, webapp.root=/home/icare/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/webapps/My_ServiceProvider/, java.version=1.6.0, user.timezone=Europe/Paris, sun.arch.data.model=32, java.endorsed.dirs=/usr/local/web-icare1/common/endorsed, sun.cpu.isalist=, sun.jnu.encoding=UTF-8, file.encoding.pkg=sun.io, package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.,sun.beans., file.separator=/, java.specification.name=Java Platform API Specification, hibernate.cglib.use_reflection_optimizer=true, java.class.version=50.0, user.country=FR, java.home=/usr/java/jdk/jre, java.vm.info=mixed mode, os.version=2.6.20-1.2948.fc6, path.separator=:, java.vm.version=1.6.0-b105, java.awt.printerjob=sun.print.PSPrinterJob, sun.io.unicode.encoding=UnicodeLittle, package.definition=sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper., java.naming.factory.url.pkgs=org.apache.naming, user.home=/root, java.specification.vendor=Sun Microsystems Inc., hibernate.hbm2ddl.auto=create-drop, java.library.path=/usr/java/jdk/jre/lib/i386/server:/usr/java/jdk/jre/lib/i386:/usr/java/jdk/jre/../lib/i386:/usr/java/jdk1.6.0_01/jre/lib/i386/server:/usr/java/jdk1.6.0_01/jre/lib/i386:/usr/java/jdk1.6.0_01/jre/../lib/i386:/usr/lib/firefox-1.5.0.10:/usr/java/packages/lib/i386:/lib:/usr/lib, java.vendor.url=http://java.sun.com/, java.vm.vendor=Sun Microsystems Inc., hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect, common.loader=${catalina.home}/common/classes,${catalina.home}/common/i18n/*.jar,${catalina.home}/common/endorsed/*.jar,${catalina.home}/common/lib/*.jar, java.runtime.name=Java(TM) SE Runtime Environment, java.class.path=/usr/local/web-icare1/bin/bootstrap.jar:/usr/java/jdk/lib/tools.jar, hibernate.bytecode.use_reflection_optimizer=false, java.vm.specification.name=Java Virtual Machine Specification, java.vm.specification.version=1.0, catalina.home=/usr/local/web-icare1, sun.cpu.endian=little, sun.os.patch.level=unknown, hibernate.cache.use_query_cache=true, hibernate.connection.provider_class=org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider, java.io.tmpdir=/tmp, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, server.loader=${catalina.home}/server/classes,${catalina.home}/server/lib/*.jar, os.arch=i386, java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment, java.ext.dirs=/usr/java/jdk/jre/lib/ext:/usr/java/packages/lib/ext, user.dir=/home/icare, line.separator=
, java.vm.name=Java HotSpot(TM) Server VM, hibernate.cache.use_second_level_cache=true, file.encoding=UTF-8, java.specification.version=1.6, hibernate.show_sql=true}>
2007-06-27 17:16:09,480 WARN [net.sf.ehcache.config.ConfigurationFactory] - <No configuration found. Configuring ehcache from ehcache-failsafe.xml  found in the classpath: jar:file:/home/icare/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/webapps/My_ServiceProvider/WEB-INF/lib/ehcache-1.3-beta2.jar!/ehcache-failsafe.xml>
2007-06-27 17:16:09,562 DEBUG [org.hibernate.cache.CacheFactory] - <instantiating cache region: org.model.Model usage strategy: read-write>
2007-06-27 17:16:09,566 WARN [org.hibernate.cache.EhCacheProvider] - <Could not find configuration [org.model.Model]; using defaults.>
2007-06-27 17:16:09,591 DEBUG [org.hibernate.cache.EhCacheProvider] - <started EHCache region: org.model.Model>
2007-06-27 17:16:09,919 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - <Static SQL for entity: org.model.Model>
2007-06-27 17:16:09,919 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - < Version select: select itemId from Model_items where itemId =?>
2007-06-27 17:16:09,919 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - < Snapshot select: select Model_.itemId, Model_.userId as userId0_, Model_.pubDate as pubDate0_, Model_.title as title0_, Model_.description as descript5_0_, Model_.link as link0_, Model_.latitude as latitude0_, Model_.longitude as longitude0_ from Model_items Model_ where Model_.itemId=?>
2007-06-27 17:16:09,919 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - < Insert 0: insert into Model_items (userId, pubDate, title, description, link, latitude, longitude, itemId) values (?, ?, ?, ?, ?, ?, ?, ?)>
2007-06-27 17:16:09,919 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - < Update 0: update Model_items set userId=?, pubDate=?, title=?, description=?, link=?, latitude=?, longitude=? where itemId=?>
2007-06-27 17:16:09,920 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - < Delete 0: delete from Model_items where itemId=?>
2007-06-27 17:16:09,949 DEBUG [org.hibernate.loader.entity.EntityLoader] - <Static select for entity org.model.Model: select Model0_.itemId as itemId0_0_, Model0_.userId as userId0_0_, Model0_.pubDate as pubDate0_0_, Model0_.title as title0_0_, Model0_.description as descript5_0_0_, Model0_.link as link0_0_, Model0_.latitude as latitude0_0_, Model0_.longitude as longitude0_0_ from Model_items Model0_ where Model0_.itemId=?>
2007-06-27 17:16:09,949 DEBUG [org.hibernate.loader.entity.EntityLoader] - <Static select for entity org.model.Model: select Model0_.itemId as itemId0_0_, Model0_.userId as userId0_0_, Model0_.pubDate as pubDate0_0_, Model0_.title as title0_0_, Model0_.description as descript5_0_0_, Model0_.link as link0_0_, Model0_.latitude as latitude0_0_, Model0_.longitude as longitude0_0_ from Model_items Model0_ where Model0_.itemId=?>
2007-06-27 17:16:09,950 DEBUG [org.hibernate.loader.entity.EntityLoader] - <Static select for entity org.model.Model: select Model0_.itemId as itemId0_0_, Model0_.userId as userId0_0_, Model0_.pubDate as pubDate0_0_, Model0_.title as title0_0_, Model0_.description as descript5_0_0_, Model0_.link as link0_0_, Model0_.latitude as latitude0_0_, Model0_.longitude as longitude0_0_ from Model_items Model0_ where Model0_.itemId=? for update>
2007-06-27 17:16:09,950 DEBUG [org.hibernate.loader.entity.EntityLoader] - <Static select for entity org.model.Model: select Model0_.itemId as itemId0_0_, Model0_.userId as userId0_0_, Model0_.pubDate as pubDate0_0_, Model0_.title as title0_0_, Model0_.description as descript5_0_0_, Model0_.link as link0_0_, Model0_.latitude as latitude0_0_, Model0_.longitude as longitude0_0_ from Model_items Model0_ where Model0_.itemId=? for update>
2007-06-27 17:16:09,950 DEBUG [org.hibernate.loader.entity.EntityLoader] - <Static select for entity org.model.Model: select Model0_.itemId as itemId0_0_, Model0_.userId as userId0_0_, Model0_.pubDate as pubDate0_0_, Model0_.title as title0_0_, Model0_.description as descript5_0_0_, Model0_.link as link0_0_, Model0_.latitude as latitude0_0_, Model0_.longitude as longitude0_0_ from Model_items Model0_ where Model0_.itemId=? for update>
2007-06-27 17:16:09,963 DEBUG [org.hibernate.loader.entity.EntityLoader] - <Static select for action ACTION_MERGE on entity org.model.Model: select Model0_.itemId as itemId0_0_, Model0_.userId as userId0_0_, Model0_.pubDate as pubDate0_0_, Model0_.title as title0_0_, Model0_.description as descript5_0_0_, Model0_.link as link0_0_, Model0_.latitude as latitude0_0_, Model0_.longitude as longitude0_0_ from Model_items Model0_ where Model0_.itemId=?>
2007-06-27 17:16:09,963 DEBUG [org.hibernate.loader.entity.EntityLoader] - <Static select for action ACTION_REFRESH on entity org.model.Model: select Model0_.itemId as itemId0_0_, Model0_.userId as userId0_0_, Model0_.pubDate as pubDate0_0_, Model0_.title as title0_0_, Model0_.description as descript5_0_0_, Model0_.link as link0_0_, Model0_.latitude as latitude0_0_, Model0_.longitude as longitude0_0_ from Model_items Model0_ where Model0_.itemId=?>
2007-06-27 17:16:09,965 DEBUG [org.hibernate.impl.SessionFactoryObjectFactory] - <initializing class SessionFactoryObjectFactory>
2007-06-27 17:16:09,968 DEBUG [org.hibernate.impl.SessionFactoryObjectFactory] - <registered: ff808081136dc0f801136dc0fa6b0000 (unnamed)>
2007-06-27 17:16:09,969 INFO [org.hibernate.impl.SessionFactoryObjectFactory] - <Not binding factory to JNDI, no JNDI name configured>
2007-06-27 17:16:09,969 DEBUG [org.hibernate.impl.SessionFactoryImpl] - <instantiated session factory>
2007-06-27 17:16:09,976 DEBUG [org.hibernate.cfg.AnnotationConfiguration] - <Execute first pass mapping processing>
2007-06-27 17:16:09,976 DEBUG [org.hibernate.cfg.AnnotationConfiguration] - <Process hbm files>
2007-06-27 17:16:09,976 DEBUG [org.hibernate.cfg.AnnotationConfiguration] - <Process annotated classes>
2007-06-27 17:16:09,976 DEBUG [org.hibernate.cfg.AnnotationConfiguration] - <processing manytoone fk mappings>
2007-06-27 17:16:09,976 DEBUG [org.hibernate.cfg.Configuration] - <processing extends queue>
2007-06-27 17:16:09,976 DEBUG [org.hibernate.cfg.Configuration] - <processing collection mappings>
2007-06-27 17:16:09,976 DEBUG [org.hibernate.cfg.Configuration] - <processing native query and ResultSetMapping mappings>
2007-06-27 17:16:09,977 DEBUG [org.hibernate.cfg.Configuration] - <processing association property references>
2007-06-27 17:16:09,977 DEBUG [org.hibernate.cfg.Configuration] - <processing foreign key constraints>
2007-06-27 17:16:09,977 DEBUG [org.hibernate.validator.ClassValidator] - <ResourceBundle ValidatorMessages not found in thread context classloader>
2007-06-27 17:16:09,977 DEBUG [org.hibernate.validator.ClassValidator] - <ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages>
2007-06-27 17:16:09,979 DEBUG [org.hibernate.cfg.AnnotationConfiguration] - <Execute first pass mapping processing>
2007-06-27 17:16:09,979 DEBUG [org.hibernate.cfg.AnnotationConfiguration] - <Process hbm files>
2007-06-27 17:16:09,979 DEBUG [org.hibernate.cfg.AnnotationConfiguration] - <Process annotated classes>
2007-06-27 17:16:09,979 DEBUG [org.hibernate.cfg.AnnotationConfiguration] - <processing manytoone fk mappings>
2007-06-27 17:16:09,979 DEBUG [org.hibernate.cfg.Configuration] - <processing extends queue>
2007-06-27 17:16:09,979 DEBUG [org.hibernate.cfg.Configuration] - <processing collection mappings>
2007-06-27 17:16:09,980 DEBUG [org.hibernate.cfg.Configuration] - <processing native query and ResultSetMapping mappings>
2007-06-27 17:16:09,980 DEBUG [org.hibernate.cfg.Configuration] - <processing association property references>
2007-06-27 17:16:09,980 DEBUG [org.hibernate.cfg.Configuration] - <processing foreign key constraints>
2007-06-27 17:16:09,980 DEBUG [org.hibernate.validator.ClassValidator] - <ResourceBundle ValidatorMessages not found in thread context classloader>
2007-06-27 17:16:09,980 DEBUG [org.hibernate.validator.ClassValidator] - <ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages>
2007-06-27 17:16:09,984 INFO [org.hibernate.tool.hbm2ddl.SchemaExport] - <Running hbm2ddl schema export>
2007-06-27 17:16:09,991 DEBUG [org.hibernate.tool.hbm2ddl.SchemaExport] - <import file not found: /import.sql>
2007-06-27 17:16:09,991 INFO [org.hibernate.tool.hbm2ddl.SchemaExport] - <exporting generated schema to database>
2007-06-27 17:16:10,013 DEBUG [org.hibernate.tool.hbm2ddl.SchemaExport] - <drop table if exists Model_items>
2007-06-27 17:16:10,083 DEBUG [org.hibernate.tool.hbm2ddl.SchemaExport] - <create table Model_items (itemId varchar(255) not null, userId varchar(75) not null, pubDate date, title varchar(120), description varchar(250), link varchar(250), latitude varchar(20), longitude varchar(20), primary key (itemId)) type=InnoDB>
2007-06-27 17:16:10,106 INFO [org.hibernate.tool.hbm2ddl.SchemaExport] - <schema export complete>
2007-06-27 17:16:10,107 DEBUG [org.hibernate.cfg.AnnotationConfiguration] - <Execute first pass mapping processing>
2007-06-27 17:16:10,107 DEBUG [org.hibernate.cfg.AnnotationConfiguration] - <Process hbm files>
2007-06-27 17:16:10,107 DEBUG [org.hibernate.cfg.AnnotationConfiguration] - <Process annotated classes>
2007-06-27 17:16:10,107 DEBUG [org.hibernate.cfg.AnnotationConfiguration] - <processing manytoone fk mappings>
2007-06-27 17:16:10,107 DEBUG [org.hibernate.cfg.Configuration] - <processing extends queue>
2007-06-27 17:16:10,107 DEBUG [org.hibernate.cfg.Configuration] - <processing collection mappings>
2007-06-27 17:16:10,107 DEBUG [org.hibernate.cfg.Configuration] - <processing native query and ResultSetMapping mappings>
2007-06-27 17:16:10,107 DEBUG [org.hibernate.cfg.Configuration] - <processing association property references>
2007-06-27 17:16:10,107 DEBUG [org.hibernate.cfg.Configuration] - <processing foreign key constraints>
2007-06-27 17:16:10,108 DEBUG [org.hibernate.validator.ClassValidator] - <ResourceBundle ValidatorMessages not found in thread context classloader>
2007-06-27 17:16:10,108 DEBUG [org.hibernate.validator.ClassValidator] - <ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages>
2007-06-27 17:16:10,108 DEBUG [org.hibernate.cfg.AnnotationConfiguration] - <Execute first pass mapping processing>
2007-06-27 17:16:10,109 DEBUG [org.hibernate.cfg.AnnotationConfiguration] - <Process hbm files>
2007-06-27 17:16:10,109 DEBUG [org.hibernate.cfg.AnnotationConfiguration] - <Process annotated classes>
2007-06-27 17:16:10,109 DEBUG [org.hibernate.cfg.AnnotationConfiguration] - <processing manytoone fk mappings>
2007-06-27 17:16:10,109 DEBUG [org.hibernate.cfg.Configuration] - <processing extends queue>
2007-06-27 17:16:10,109 DEBUG [org.hibernate.cfg.Configuration] - <processing collection mappings>
2007-06-27 17:16:10,109 DEBUG [org.hibernate.cfg.Configuration] - <processing native query and ResultSetMapping mappings>
2007-06-27 17:16:10,109 DEBUG [org.hibernate.cfg.Configuration] - <processing association property references>
2007-06-27 17:16:10,109 DEBUG [org.hibernate.cfg.Configuration] - <processing foreign key constraints>
2007-06-27 17:16:10,109 DEBUG [org.hibernate.validator.ClassValidator] - <ResourceBundle ValidatorMessages not found in thread context classloader>
2007-06-27 17:16:10,110 DEBUG [org.hibernate.validator.ClassValidator] - <ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages>
2007-06-27 17:16:10,112 INFO [org.hibernate.cache.UpdateTimestampsCache] - <starting update timestamps cache at region: org.hibernate.cache.UpdateTimestampsCache>
2007-06-27 17:16:10,112 WARN [org.hibernate.cache.EhCacheProvider] - <Could not find configuration [org.hibernate.cache.UpdateTimestampsCache]; using defaults.>
2007-06-27 17:16:10,113 DEBUG [org.hibernate.cache.EhCacheProvider] - <started EHCache region: org.hibernate.cache.UpdateTimestampsCache>
2007-06-27 17:16:10,115 INFO [org.hibernate.cache.StandardQueryCache] - <starting query cache at region: org.hibernate.cache.StandardQueryCache>
2007-06-27 17:16:10,115 WARN [org.hibernate.cache.EhCacheProvider] - <Could not find configuration [org.hibernate.cache.StandardQueryCache]; using defaults.>
2007-06-27 17:16:10,116 DEBUG [org.hibernate.cache.EhCacheProvider] - <started EHCache region: org.hibernate.cache.StandardQueryCache>
2007-06-27 17:16:10,116 DEBUG [org.hibernate.impl.SessionFactoryImpl] - <Checking 0 named HQL queries>
2007-06-27 17:16:10,116 DEBUG [org.hibernate.impl.SessionFactoryImpl] - <Checking 0 named SQL queries>
2007-06-27 17:16:10,230 INFO [org.springframework.orm.hibernate3.HibernateTransactionManager] - <Using DataSource [org.springframework.jdbc.datasource.DriverManagerDataSource@1533c8] of Hibernate SessionFactory for HibernateTransactionManager>
2007-06-27 17:16:10,250 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - <Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]>
2007-06-27 17:16:10,287 INFO [org.springframework.jdbc.support.SQLErrorCodesFactory] - <SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase]>
2007-06-27 17:16:10,424 INFO [org.springframework.web.context.ContextLoader] - <Root WebApplicationContext: initialization completed in 3035 ms>



Thx you very very very much for the time you can spend on this noobie issue. Love you and see you soon !


Last edited by pred on Thu Jun 28, 2007 3:06 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 27, 2007 11:53 pm 
Senior
Senior

Joined: Sat Aug 19, 2006 6:31 pm
Posts: 139
Try adding @Table for your annotated class.

So

@Entity
@Table
public class Message
...

_________________
Don't forget to rate the reply if it helps..:)

Budyanto


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 28, 2007 2:52 am 
Newbie

Joined: Wed Jun 27, 2007 11:30 am
Posts: 12
Thanks for your input :)

Unfortunnaly, i have tried your solution without success :(


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 28, 2007 3:44 am 
Newbie

Joined: Wed Jun 27, 2007 11:30 am
Posts: 12
I 'm finding quite strange thie situation, the two maps seem to be loaded ( hbm is readed after loading )

Code:
2007-06-27 17:16:08,652 DEBUG [org.hibernate.cfg.AnnotationConfiguration] - <null<-org.dom4j.tree.DefaultAttribute@12b19c5 [Attribute: name resource value "org/model/Model.hbm.xml"]>
2007-06-27 17:16:08,653 INFO [org.hibernate.cfg.Configuration] - <Reading mappings from resource : org/model/Model.hbm.xml>
2007-06-27 17:16:08,711 DEBUG [org.hibernate.util.DTDEntityResolver] - <trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd]>
2007-06-27 17:16:08,712 DEBUG [org.hibernate.util.DTDEntityResolver] - <recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/>
2007-06-27 17:16:08,713 DEBUG [org.hibernate.util.DTDEntityResolver] - <located [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd] in classpath>
2007-06-27 17:16:08,779 DEBUG [org.hibernate.cfg.AnnotationConfiguration] - <null<-org.dom4j.tree.DefaultAttribute@14c28db [Attribute: name class value "org.model.Message"]>


but [org.hibernate.cfg.HbmBinder] show that only Model is mapped properly.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 28, 2007 3:45 am 
Newbie

Joined: Wed Jun 27, 2007 11:30 am
Posts: 12
I 'm finding quite strange thie situation, the two maps seem to be loaded ( hbm is readed after loading )

Code:
2007-06-27 17:16:08,652 DEBUG [org.hibernate.cfg.AnnotationConfiguration] - <null<-org.dom4j.tree.DefaultAttribute@12b19c5 [Attribute: name resource value "org/model/Model.hbm.xml"]>
2007-06-27 17:16:08,653 INFO [org.hibernate.cfg.Configuration] - <Reading mappings from resource : org/model/Model.hbm.xml>
2007-06-27 17:16:08,711 DEBUG [org.hibernate.util.DTDEntityResolver] - <trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd]>
2007-06-27 17:16:08,712 DEBUG [org.hibernate.util.DTDEntityResolver] - <recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/>
2007-06-27 17:16:08,713 DEBUG [org.hibernate.util.DTDEntityResolver] - <located [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd] in classpath>
2007-06-27 17:16:08,779 DEBUG [org.hibernate.cfg.AnnotationConfiguration] - <null<-org.dom4j.tree.DefaultAttribute@14c28db [Attribute: name class value "org.model.Message"]>


but [org.hibernate.cfg.HbmBinder] show that only Model is mapped properly.
[org.hibernate.loader.entity.EntityLoader] doesn't look at Message.java ( the annotated class )

Erf sorry double post and can't delete ( hibernate forum lags a bit from my location )


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 28, 2007 5:19 am 
Newbie

Joined: Wed Jun 27, 2007 11:30 am
Posts: 12
PROBLEM RESOLVED...

I used
Code:
<prop key="hibernate.cglib.use_reflection_optimizer">
               true
            </prop>


instead of

Code:
<prop key="hibernate.bytecode.use_reflection_optimizer">
               true
            </prop>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.