title: org.hibernate.MappingException: Unknown entity - though my entity has all it needs
body: <p>I'm trying to add some Hibernate functionality to a Spring web application. This is my first time when I use the Hibernate Session Factory to be somehow independent from Spring (I used Hibernate Template and worked fine). Now I'm getting these exception <code>org.hibernate.MappingException: Unknown entity</code> , though I think the components are well connected. But enough talk, let's show you the code:</p>
  
  <p>Entity Class:</p>
  
  <pre><code>    @Entity // javax.persistence.Entity;
  @Table(name = "CreazioneV49_Users")
  public class User implements Serializable {
  
      private long id;
      private String name;
      private String sessionId;
  
      @Id
      @GeneratedValue
      @Column(name = "USER_ID")
      public long getId() {
          return id;
      }
  
      public void setId(long id) {
          this.id = id;
      }
  
      @Column(name = "USER_NAME")
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
      @Column(name = "USER_SESSIONID")
      public String getSessionId() {
          return sessionId;
      }
  
      public void setSessionId(String sessionId) {
          this.sessionId = sessionId;
      }
  }
  </code></pre>
  
  <p>Repository Class:</p>
  
  <pre><code>@Repository
  @Transactional
  public class DBUtil implements DBUtilInterface {
  
      @Autowired
      @Qualifier("mySessionFactory")
      private SessionFactory sessionFactory;
  
      private Session currentSession() {
          return sessionFactory.getCurrentSession();
      }
  
      public void addUser(User user){
          currentSession().save(user);
      }
  }
  </code></pre>
  
  <p>Spring Bean Component:</p>
  
  <pre><code>@Component
  @Scope(value = "session")
  public class CreateV49 implements Serializable {
  
      @Autowired
      private DBUtilInterface dbUtil;
  
      public DBUtilInterface getDbUtil() {
          return dbUtil;
      }
  
      public void setDbUtil(DBUtil dbUtil) {
          this.dbUtil = dbUtil;
      }
  
      public void persistData(){
      User user = new User();
      user.setName("Gigel");
      user.setSessionId("1545645645646");
      dbUtil.addUser(user);
      System.out.println("GOOOD");
  }
  </code></pre>
  
  <p>Part of applicationContext.xml</p>
  
  <pre><code>&lt;bean id="myDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"&gt;
          &lt;property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/&gt;
          &lt;property name="url" value="jdbc:oracle:thin:@//172.28.233.107:1521/SLRFORM"/&gt;
          &lt;property name="username" value="selir"/&gt;
          &lt;property name="password" value="selir1"/&gt;
          &lt;property name="maxActive" value="10" /&gt;
          &lt;property name="initialSize" value="5" /&gt;
  
      &lt;/bean&gt;
  
      &lt;bean id="mySessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"&gt;
          &lt;property name="dataSource" ref="myDataSource" /&gt;
          &lt;property name="annotatedPackages"&gt;
              &lt;list&gt;
                  &lt;value&gt;creazione.persistence&lt;/value&gt;
              &lt;/list&gt;
          &lt;/property&gt;
          &lt;property name="hibernateProperties"&gt;
              &lt;props&gt;
                  &lt;prop key="hibernate.dialect"&gt;org.hibernate.dialect.HSQLDialect&lt;/prop&gt;
                  &lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt;
                  &lt;prop key="hibernate.hbm2ddl.auto"&gt;create&lt;/prop&gt;
              &lt;/props&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;bean id="txManager"
      class="org.springframework.orm.hibernate3.HibernateTransactionManager"&gt;
          &lt;property name="sessionFactory"&gt;
              &lt;ref local="mySessionFactory" /&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
      &lt;tx:annotation-driven transaction-manager="txManager"/&gt;
  
      &lt;aop:aspectj-autoproxy/&gt;
  </code></pre>
  
  <p>Is it possible that this error to be thrown if the table isn't found in DB?</p>
  
  <p>UPDATE: STACKTRACE</p>
  
  <pre><code>    SEVERE: org.hibernate.MappingException: Unknown entity: creazione.persistence.User
  javax.faces.el.EvaluationException: org.hibernate.MappingException: Unknown entity: creazione.persistence.User
          at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)
          at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
          at javax.faces.component.UICommand.broadcast(UICommand.java:315)
          at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:787)
          at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1252)
          at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
          at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
          at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
          at javax.faces.webapp.FacesServlet.service(FacesServlet.java:508)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:83)
          at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at creazione.exception.MyFilter.doFilter(MyFilter.java:50)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
          at com.googlecode.psiprobe.Tomcat60AgentValve.invoke(Tomcat60AgentValve.java:30)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
          at java.lang.Thread.run(Thread.java:619)
  Caused by: org.hibernate.MappingException: Unknown entity: creazione.persistence.User
          at org.hibernate.impl.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:550)
          at org.hibernate.impl.SessionImpl.getEntityPersister(SessionImpl.java:1338)
          at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:98)
          at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)
          at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
          at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
          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:535)
          at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
          at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
          at creazione.persistence.DBUtil.addUser(DBUtil.java:27)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
          at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
          at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
          at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
          at $Proxy49.addUser(Unknown Source)
          at creazione.components.CreateV49.persistData(CreateV49.java:254)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at org.apache.el.parser.AstValue.invoke(AstValue.java:191)
          at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
          at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
          at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
          ... 31 more
  Nov 16, 2011 10:32:36 AM com.sun.faces.lifecycle.InvokeApplicationPhase execute
  WARNING: #{createV49.persistData}: org.hibernate.MappingException: Unknown entity: creazione.persistence.User
  javax.faces.FacesException: #{createV49.persistData}: org.hibernate.MappingException: Unknown entity: creazione.persistence.User
          at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118)
          at javax.faces.component.UICommand.broadcast(UICommand.java:315)
  javax.faces.FacesException: #{createV49.persistData}: org.hibernate.MappingException: Unknown entity: creazione.persistence.User
          at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:787)
          at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:89)
          at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1252)
          at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
          at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
          at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
          at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
          at javax.faces.webapp.FacesServlet.service(FacesServlet.java:508)
          at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
          at javax.faces.webapp.FacesServlet.service(FacesServlet.java:508)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
          at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:83)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
          at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:83)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          at creazione.exception.MyFilter.doFilter(MyFilter.java:50)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          at creazione.exception.MyFilter.doFilter(MyFilter.java:50)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
          at com.googlecode.psiprobe.Tomcat60AgentValve.invoke(Tomcat60AgentValve.java:30)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
          at com.googlecode.psiprobe.Tomcat60AgentValve.invoke(Tomcat60AgentValve.java:30)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
          at java.lang.Thread.run(Thread.java:619)
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
  Caused by: javax.faces.FacesException: #{createV49.persistData}: org.hibernate.MappingException: Unknown entity: creazione.persistence.User
          at java.lang.Thread.run(Thread.java:619)
          at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118)
  Caused by: javax.faces.el.EvaluationException: org.hibernate.MappingException: Unknown entity: creazione.persistence.User
          at javax.faces.component.UICommand.broadcast(UICommand.java:315)
          at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)
          at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:787)
          at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
          at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1252)
          ... 30 more
          at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
  Caused by: org.hibernate.MappingException: Unknown entity: creazione.persistence.User
          ... 26 more
          at org.hibernate.impl.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:550)
  Caused by: javax.faces.el.EvaluationException: org.hibernate.MappingException: Unknown entity: creazione.persistence.User
          at org.hibernate.impl.SessionImpl.getEntityPersister(SessionImpl.java:1338)
          at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)
          at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:98)
          at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
          at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)
          ... 30 more
          at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
  Caused by: org.hibernate.MappingException: Unknown entity: creazione.persistence.User
          at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
          at org.hibernate.impl.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:550)
          at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
          at org.hibernate.impl.SessionImpl.getEntityPersister(SessionImpl.java:1338)
          at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
          at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:98)
          at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535)
          at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)
          at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
          at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
          at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
          at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
          at creazione.persistence.DBUtil.addUser(DBUtil.java:27)
          at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
          at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
          at creazione.persistence.DBUtil.addUser(DBUtil.java:27)
          at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
          at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
          at $Proxy49.addUser(Unknown Source)
          at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
          at creazione.components.CreateV49.persistData(CreateV49.java:254)
          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at $Proxy49.addUser(Unknown Source)
          at org.apache.el.parser.AstValue.invoke(AstValue.java:191)
          at creazione.components.CreateV49.persistData(CreateV49.java:254)
          at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          ... 31 more
          at java.lang.reflect.Method.invoke(Method.java:597)
  </code></pre>
  
  <p>I'm going to try now with <code>&lt;property name="annotatedClasses"&gt;</code> instead of packages... Though it would be weird to work. </p>
  
  <p>It seems that with annotatedClasses works... The User beans is recognized but I'm getting a strange error though my ID is auto-generated: </p>
  
  <pre><code>Hibernate: insert into CreazioneV49_Users (USER_ID, USER_NAME, USER_SESSIONID) values (null, ?, ?)
  Nov 16, 2011 10:44:21 AM org.hibernate.util.JDBCExceptionReporter logExceptions
  WARNING: SQL Error: 1400, SQLState: 23000
  Nov 16, 2011 10:44:21 AM org.hibernate.util.JDBCExceptionReporter logExceptions
  SEVERE: ORA-01400: cannot insert NULL into ("SELIR"."CREAZIONEV49_USERS"."USER_ID")
  </code></pre>
  
  <p>I'm using Oracle so I've added a Sequence Generator to my ID in User bean but with no success:</p>
  
  <pre><code>@Id
  @SequenceGenerator(name = "my-creazioneV49Seq", sequenceName = "creazioneV49Seq")
  @GeneratedValue(strategy = GenerationType.AUTO, generator = "my-creazioneV49Seq")
  @Column(name = "USER_ID")
  public long getId() {
      return id;
  }
  </code></pre>
  
  <p>SOLVED: UPGRADED TO HIBERNATE 3.6.8 AND CHANGED THE DIALECT TO ORACLE!</p>