-->
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.  [ 4 posts ] 
Author Message
 Post subject: [DEJA VU] no persistent classes found for query class
PostPosted: Wed Mar 15, 2006 6:39 am 
Newbie

Joined: Mon Mar 13, 2006 12:03 pm
Posts: 6
Hibernate version:
Hibernate 3.1.2 / annotations 3.1beta8 / JDK 5.0 / Eclipse 3.1.1 / Win2000

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>
        <property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
        <property name="hibernate.connection.password">***</property>
        <property name="hibernate.connection.url">jdbc:oracle:thin:@123.12.12.123:1234 </property>
        <property name="hibernate.connection.username">**</property>
        <property name="hibernate.default_schema">**</property>
        <property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>
        <property name="hibernate.show_sql">true</property>
        <mapping class="test.UserProfile"/>
    </session-factory>
</hibernate-configuration>


Code between sessionFactory.openSession() and session.close():
Code:
package test;

import java.util.List;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.cfg.Configuration;

public class UserProfileManager
{
   private SessionFactory factory;

   public static void main(String[] args)
   {
      UserProfileManager test = new UserProfileManager();
      Configuration cfg = new AnnotationConfiguration().configure();
      // cfg.buildMappings();  does not change anything
      
      test.factory = cfg.buildSessionFactory();
      List<UserProfile> users = test.getUserProfileList();
       System.out.println("Nb users : " + users.size());
      test.factory.close();
   }

   public List<UserProfile> getUserProfileList()
   {
       Session session = factory.openSession();
       try
       {
          List<UserProfile> list = session.createQuery("from test.UserProfile").list();
          return list;
       }
       finally
       {
          session.close();
       }
   }
}


Code:
package test;

import java.io.Serializable;
import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Version;

import org.hibernate.annotations.Entity;
import org.hibernate.annotations.Table;

@Entity
@Table(name="user_profile")
public class UserProfile implements Serializable
{

   /**
    *
    */
   private static final long   serialVersionUID   = -6494424501698760584L;

   private String               id;
   private String               userName;
   private String               userDescription;
   private String               userEmail;
   private int                  failedLoginCount;
   private String             updatedBy;
   private String             userStatus;
   private Timestamp          updatedDate;

   public UserProfile()
   {
      this.failedLoginCount = 0;
   }

   public UserProfile(int failedLoginCount)
   {
      this.failedLoginCount = failedLoginCount;
   }

   @Column(name="FAILED_LOGIN_COUNT")
   public int getFailedLoginCount()
   {
      return failedLoginCount;
   }

   public void setFailedLoginCount(int failedLoginCount)
   {
      this.failedLoginCount = failedLoginCount;
   }

   @Id
   @Column(name="USER_ID")
   public String getId()
   {
      return id;
   }

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

   @Column(name="LAST_UPDATE_USER_ID")
   public String getUpdatedBy()
   {
      return updatedBy;
   }

   public void setUpdatedBy(String updatedBy)
   {
      this.updatedBy = updatedBy;
   }

   @Version
   @Column(name="LAST_UPDATE_DATETIME")
   public Timestamp getUpdatedDate()
   {
      return updatedDate;
   }

   public void setUpdatedDate(Timestamp updatedDate)
   {
      this.updatedDate = updatedDate;
   }

   @Column(name="USER_DESCRIPTION")
   public String getUserDescription()
   {
      return userDescription;
   }

   public void setUserDescription(String userDescription)
   {
      this.userDescription = userDescription;
   }

   @Column(name="USER_EMAIL")
   public String getUserEmail()
   {
      return userEmail;
   }

   public void setUserEmail(String userEmail)
   {
      this.userEmail = userEmail;
   }

   @Column(name="USER_NAME")
   public String getUserName()
   {
      return userName;
   }

   public void setUserName(String userName)
   {
      this.userName = userName;
   }

   @Column(name="USER_STATUS")
   public String getUserStatus()
   {
      return userStatus;
   }

   public void setUserStatus(String userStatus)
   {
      this.userStatus = userStatus;
   }
}



Full stack trace of any exception that occurs:
No exception.
on System.out : "Nb users : 0"

Name and version of the database you are using:
Oracle 9.2

The generated SQL (show_sql=true):
No SQL generated (that is the problem..)

Debug level Hibernate log excerpt:
Code:
2006-03-15 10:14:22,359 [main] INFO  org.hibernate.cfg.Environment - Hibernate 3.1.2
2006-03-15 10:14:22,375 [main] INFO  org.hibernate.cfg.Environment - hibernate.properties not found
2006-03-15 10:14:22,375 [main] INFO  org.hibernate.cfg.Environment - using CGLIB reflection optimizer
2006-03-15 10:14:22,390 [main] INFO  org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
2006-03-15 10:14:22,609 [main] INFO  org.hibernate.cfg.Configuration - configuring from resource: /hibernate.cfg.xml
2006-03-15 10:14:22,609 [main] INFO  org.hibernate.cfg.Configuration - Configuration resource: /hibernate.cfg.xml
2006-03-15 10:14:23,312 [main] DEBUG org.hibernate.util.DTDEntityResolver - trying to locate http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd in classpath under org/hibernate/
2006-03-15 10:14:23,312 [main] DEBUG org.hibernate.util.DTDEntityResolver - found http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd in classpath
2006-03-15 10:14:23,421 [main] DEBUG org.hibernate.cfg.Configuration - hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver
2006-03-15 10:14:23,421 [main] DEBUG org.hibernate.cfg.Configuration - hibernate.connection.password=****
2006-03-15 10:14:23,421 [main] DEBUG org.hibernate.cfg.Configuration - hibernate.connection.url=jdbc:oracle:thin:@123.12.12.123:1234
2006-03-15 10:14:23,421 [main] DEBUG org.hibernate.cfg.Configuration - hibernate.connection.username=**
2006-03-15 10:14:23,421 [main] DEBUG org.hibernate.cfg.Configuration - hibernate.default_schema=**
2006-03-15 10:14:23,421 [main] DEBUG org.hibernate.cfg.Configuration - hibernate.dialect=org.hibernate.dialect.Oracle9Dialect
2006-03-15 10:14:23,437 [main] DEBUG org.hibernate.cfg.Configuration - hibernate.show_sql=true
2006-03-15 10:14:23,437 [main] DEBUG org.hibernate.cfg.AnnotationConfiguration - null<-org.dom4j.tree.DefaultAttribute@21b6d [Attribute: name class value "test.UserProfile"]
2006-03-15 10:14:23,562 [main] INFO  org.hibernate.cfg.Configuration - Configured SessionFactory: null
2006-03-15 10:14:23,562 [main] DEBUG org.hibernate.cfg.Configuration - properties: {hibernate.connection.password=****, java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, hibernate.default_schema=***, sun.boot.library.path=D:\jdk1.5.0\jre\bin, java.vm.version=1.5.0-b64, hibernate.connection.username=****, 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=GB, sun.os.patch.level=Service Pack 4, java.vm.specification.name=Java Virtual Machine Specification, user.dir=C:\phjoly\workspace\Test Hibernate, java.runtime.version=1.5.0-b64, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.endorsed.dirs=D:\jdk1.5.0\jre\lib\endorsed, os.arch=x86, java.io.tmpdir=C:\DOCUME~1\phJoly\LOCALS~1\Temp\, line.separator=
, java.vm.specification.vendor=Sun Microsystems Inc., user.variant=, os.name=Windows 2000, sun.jnu.encoding=Cp1252, java.library.path=D:\jdk1.5.0\bin;.;C:\WINNT\system32;C:\WINNT;D:\jdk1.5.0\bin;D:\oracle\ora92\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\IBM Connectors\Encina\bin;C:\IBMDebug\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\WINNT\system32\nls;C:\WINNT\system32\nls\English;C:\java_dev\apache-ant-1.6.2\bin;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;C:\java_dev\xml-xindice-1.0\bin;D:\Dev-Cpp\projects\RMI Service;C:\Program Files\Novell\ZENworks\;Z:., java.specification.name=Java Platform API Specification, java.class.version=49.0, sun.management.compiler=HotSpot Client Compiler, os.version=5.0, user.home=C:\Documents and Settings\phJoly, user.timezone=Europe/London, java.awt.printerjob=sun.awt.windows.WPrinterJob, file.encoding=Cp1252, java.specification.version=1.5, hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver, user.name=PHJOLY, java.class.path=C:\phjoly\workspace\Test Hibernate\bin;D:\phjoly\hibernate-3.1\lib\ant-1.6.5.jar;D:\phjoly\hibernate-3.1\lib\ant-antlr-1.6.5.jar;D:\phjoly\hibernate-3.1\lib\ant-junit-1.6.5.jar;D:\phjoly\hibernate-3.1\lib\ant-launcher-1.6.5.jar;D:\phjoly\hibernate-3.1\lib\antlr-2.7.6rc1.jar;D:\phjoly\hibernate-3.1\lib\ant-swing-1.6.5.jar;D:\phjoly\hibernate-3.1\lib\asm.jar;D:\phjoly\hibernate-3.1\lib\asm-attrs.jar;D:\phjoly\hibernate-3.1\lib\c3p0-0.9.0.jar;D:\phjoly\hibernate-3.1\lib\cglib-2.1.3.jar;D:\phjoly\hibernate-3.1\lib\cleanimports.jar;D:\phjoly\hibernate-3.1\lib\commons-collections-2.1.1.jar;D:\phjoly\hibernate-3.1\lib\commons-logging-1.0.4.jar;D:\phjoly\hibernate-3.1\lib\concurrent-1.3.2.jar;D:\phjoly\hibernate-3.1\lib\connector.jar;D:\phjoly\hibernate-3.1\lib\dom4j-1.6.1.jar;D:\phjoly\hibernate-3.1\lib\ehcache-1.1.jar;D:\phjoly\hibernate-3.1\lib\jaas.jar;D:\phjoly\hibernate-3.1\lib\jacc-1_0-fr.jar;D:\phjoly\hibernate-3.1\lib\jaxen-1.1-beta-7.jar;D:\phjoly\hibernate-3.1\lib\jboss-cache.jar;D:\phjoly\hibernate-3.1\lib\jboss-common.jar;D:\phjoly\hibernate-3.1\lib\jboss-jmx.jar;D:\phjoly\hibernate-3.1\lib\jboss-system.jar;D:\phjoly\hibernate-3.1\lib\jdbc2_0-stdext.jar;D:\phjoly\hibernate-3.1\lib\jgroups-2.2.8.jar;D:\phjoly\hibernate-3.1\lib\jta.jar;D:\phjoly\hibernate-3.1\lib\junit-3.8.1.jar;D:\phjoly\hibernate-3.1\lib\log4j-1.2.11.jar;D:\phjoly\hibernate-3.1\lib\oscache-2.1.jar;D:\phjoly\hibernate-3.1\lib\proxool-0.8.3.jar;D:\phjoly\hibernate-3.1\lib\swarmcache-1.0rc2.jar;D:\phjoly\hibernate-3.1\lib\syndiag2.jar;D:\phjoly\hibernate-3.1\lib\versioncheck.jar;D:\phjoly\hibernate-3.1\lib\xerces-2.6.2.jar;D:\phjoly\hibernate-3.1\lib\xml-apis.jar;D:\phjoly\hibernate-3.1\hibernate3.jar;C:\phjoly\workspace\Test Hibernate\lib\ojdbc14-9.2.0.5.jar;C:\phjoly\workspace\Test Hibernate\lib\hibernate-annotations.jar;D:\phjoly\hibernate-entitymanager-3.1beta6\lib\ejb3-persistence.jar, hibernate.show_sql=true, java.vm.specification.version=1.0, java.home=D:\jdk1.5.0\jre, sun.arch.data.model=32, hibernate.dialect=org.hibernate.dialect.Oracle9Dialect, hibernate.connection.url=jdbc:oracle:thin:@123.12.12.123:1234:****, user.language=en, java.specification.vendor=Sun Microsystems Inc., awt.toolkit=sun.awt.windows.WToolkit, hibernate.cglib.use_reflection_optimizer=true, java.vm.info=mixed mode, sharing, java.version=1.5.0, java.ext.dirs=D:\jdk1.5.0\jre\lib\ext, sun.boot.class.path=D:\jdk1.5.0\jre\lib\rt.jar;D:\jdk1.5.0\jre\lib\i18n.jar;D:\jdk1.5.0\jre\lib\sunrsasign.jar;D:\jdk1.5.0\jre\lib\jsse.jar;D:\jdk1.5.0\jre\lib\jce.jar;D:\jdk1.5.0\jre\lib\charsets.jar;D:\jdk1.5.0\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-03-15 10:14:23,562 [main] DEBUG org.hibernate.cfg.Configuration - Preparing to build session factory with filters : {}
2006-03-15 10:14:23,562 [main] DEBUG org.hibernate.cfg.AnnotationConfiguration - Execute first pass mapping processing
2006-03-15 10:14:23,562 [main] DEBUG org.hibernate.cfg.AnnotationConfiguration - Process hbm files
2006-03-15 10:14:23,562 [main] DEBUG org.hibernate.cfg.AnnotationConfiguration - Process annotated classes
2006-03-15 10:14:23,687 [main] DEBUG org.hibernate.cfg.AnnotationConfiguration - processing manytoone fk mappings
2006-03-15 10:14:23,687 [main] DEBUG org.hibernate.cfg.Configuration - processing extends queue
2006-03-15 10:14:23,687 [main] DEBUG org.hibernate.cfg.Configuration - processing collection mappings
2006-03-15 10:14:23,687 [main] DEBUG org.hibernate.cfg.Configuration - processing native query and ResultSetMapping mappings
2006-03-15 10:14:23,687 [main] DEBUG org.hibernate.cfg.Configuration - processing association property references
2006-03-15 10:14:23,687 [main] DEBUG org.hibernate.cfg.Configuration - processing foreign key constraints
2006-03-15 10:14:23,703 [main] INFO  org.hibernate.connection.DriverManagerConnectionProvider - Using Hibernate built-in connection pool (not for production use!)
2006-03-15 10:14:23,703 [main] INFO  org.hibernate.connection.DriverManagerConnectionProvider - Hibernate connection pool size: 20
2006-03-15 10:14:23,703 [main] INFO  org.hibernate.connection.DriverManagerConnectionProvider - autocommit mode: false
2006-03-15 10:14:23,828 [main] INFO  org.hibernate.connection.DriverManagerConnectionProvider - using driver: oracle.jdbc.driver.OracleDriver at URL: jdbc:oracle:thin:@123.12.12.123:1234:****
2006-03-15 10:14:23,828 [main] INFO  org.hibernate.connection.DriverManagerConnectionProvider - connection properties: {user=****, password=****}
2006-03-15 10:14:23,828 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - total checked-out connections: 0
2006-03-15 10:14:23,828 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - opening new JDBC connection
2006-03-15 10:14:24,796 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - created connection to: jdbc:oracle:thin:@123.12.12.123:1234:****, Isolation Level: 2
2006-03-15 10:14:24,828 [main] DEBUG org.hibernate.cfg.SettingsFactory - could not get database version from JDBC metadata
2006-03-15 10:14:24,828 [main] INFO  org.hibernate.cfg.SettingsFactory - RDBMS: Oracle, version: Oracle9i Enterprise Edition Release 9.2.0.5.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.5.0 - Production
2006-03-15 10:14:24,828 [main] INFO  org.hibernate.cfg.SettingsFactory - JDBC driver: Oracle JDBC driver, version: 9.2.0.5.0
2006-03-15 10:14:24,828 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - returning connection to pool, pool size: 1
2006-03-15 10:14:24,890 [main] INFO  org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.Oracle9Dialect
2006-03-15 10:14:25,046 [main] INFO  org.hibernate.transaction.TransactionFactoryFactory - Using default transaction strategy (direct JDBC transactions)
2006-03-15 10:14:25,062 [main] INFO  org.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
2006-03-15 10:14:25,062 [main] INFO  org.hibernate.cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled
2006-03-15 10:14:25,062 [main] INFO  org.hibernate.cfg.SettingsFactory - Automatic session close at end of transaction: disabled
2006-03-15 10:14:25,062 [main] INFO  org.hibernate.cfg.SettingsFactory - JDBC batch size: 15
2006-03-15 10:14:25,062 [main] INFO  org.hibernate.cfg.SettingsFactory - JDBC batch updates for versioned data: disabled
2006-03-15 10:14:25,062 [main] INFO  org.hibernate.cfg.SettingsFactory - Scrollable result sets: enabled
2006-03-15 10:14:25,062 [main] DEBUG org.hibernate.cfg.SettingsFactory - Wrap result sets: disabled
2006-03-15 10:14:25,062 [main] INFO  org.hibernate.cfg.SettingsFactory - JDBC3 getGeneratedKeys(): disabled
2006-03-15 10:14:25,062 [main] INFO  org.hibernate.cfg.SettingsFactory - Connection release mode: auto
2006-03-15 10:14:25,062 [main] INFO  org.hibernate.cfg.SettingsFactory - Default schema: ****
2006-03-15 10:14:25,062 [main] INFO  org.hibernate.cfg.SettingsFactory - Default batch fetch size: 1
2006-03-15 10:14:25,062 [main] INFO  org.hibernate.cfg.SettingsFactory - Generate SQL with comments: disabled
2006-03-15 10:14:25,062 [main] INFO  org.hibernate.cfg.SettingsFactory - Order SQL updates by primary key: disabled
2006-03-15 10:14:25,062 [main] INFO  org.hibernate.cfg.SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
2006-03-15 10:14:25,078 [main] INFO  org.hibernate.hql.ast.ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory
2006-03-15 10:14:25,078 [main] INFO  org.hibernate.cfg.SettingsFactory - Query language substitutions: {}
2006-03-15 10:14:25,078 [main] INFO  org.hibernate.cfg.SettingsFactory - Second-level cache: enabled
2006-03-15 10:14:25,078 [main] INFO  org.hibernate.cfg.SettingsFactory - Query cache: disabled
2006-03-15 10:14:25,078 [main] INFO  org.hibernate.cfg.SettingsFactory - Cache provider: org.hibernate.cache.EhCacheProvider
2006-03-15 10:14:25,078 [main] INFO  org.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: disabled
2006-03-15 10:14:25,078 [main] INFO  org.hibernate.cfg.SettingsFactory - Structured second-level cache entries: disabled
2006-03-15 10:14:25,093 [main] DEBUG org.hibernate.exception.SQLExceptionConverterFactory - Using dialect defined converter
2006-03-15 10:14:25,109 [main] INFO  org.hibernate.cfg.SettingsFactory - Echoing all SQL to stdout
2006-03-15 10:14:25,109 [main] INFO  org.hibernate.cfg.SettingsFactory - Statistics: disabled
2006-03-15 10:14:25,109 [main] INFO  org.hibernate.cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled
2006-03-15 10:14:25,109 [main] INFO  org.hibernate.cfg.SettingsFactory - Default entity-mode: pojo
2006-03-15 10:14:25,218 [main] INFO  org.hibernate.impl.SessionFactoryImpl - building session factory
2006-03-15 10:14:25,218 [main] DEBUG org.hibernate.impl.SessionFactoryImpl - Session factory constructed with filter configurations : {}
2006-03-15 10:14:25,218 [main] DEBUG org.hibernate.impl.SessionFactoryImpl - instantiating session factory with properties: {java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, hibernate.connection.password=****, sun.boot.library.path=D:\jdk1.5.0\jre\bin, hibernate.default_schema=****, java.vm.version=1.5.0-b64, hibernate.connection.username=****, 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=GB, sun.os.patch.level=Service Pack 4, java.vm.specification.name=Java Virtual Machine Specification, user.dir=C:\phjoly\workspace\Test Hibernate, java.runtime.version=1.5.0-b64, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.endorsed.dirs=D:\jdk1.5.0\jre\lib\endorsed, os.arch=x86, java.io.tmpdir=C:\DOCUME~1\phJoly\LOCALS~1\Temp\, line.separator=
, java.vm.specification.vendor=Sun Microsystems Inc., user.variant=, os.name=Windows 2000, sun.jnu.encoding=Cp1252, java.library.path=D:\jdk1.5.0\bin;.;C:\WINNT\system32;C:\WINNT;D:\jdk1.5.0\bin;D:\oracle\ora92\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\IBM Connectors\Encina\bin;C:\IBMDebug\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\WINNT\system32\nls;C:\WINNT\system32\nls\English;C:\java_dev\apache-ant-1.6.2\bin;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;C:\java_dev\xml-xindice-1.0\bin;D:\Dev-Cpp\projects\RMI Service;C:\Program Files\Novell\ZENworks\;Z:., java.specification.name=Java Platform API Specification, java.class.version=49.0, sun.management.compiler=HotSpot Client Compiler, os.version=5.0, user.home=C:\Documents and Settings\phJoly, user.timezone=Europe/London, java.awt.printerjob=sun.awt.windows.WPrinterJob, file.encoding=Cp1252, java.specification.version=1.5, hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver, java.class.path=C:\phjoly\workspace\Test Hibernate\bin;D:\phjoly\hibernate-3.1\lib\ant-1.6.5.jar;D:\phjoly\hibernate-3.1\lib\ant-antlr-1.6.5.jar;D:\phjoly\hibernate-3.1\lib\ant-junit-1.6.5.jar;D:\phjoly\hibernate-3.1\lib\ant-launcher-1.6.5.jar;D:\phjoly\hibernate-3.1\lib\antlr-2.7.6rc1.jar;D:\phjoly\hibernate-3.1\lib\ant-swing-1.6.5.jar;D:\phjoly\hibernate-3.1\lib\asm.jar;D:\phjoly\hibernate-3.1\lib\asm-attrs.jar;D:\phjoly\hibernate-3.1\lib\c3p0-0.9.0.jar;D:\phjoly\hibernate-3.1\lib\cglib-2.1.3.jar;D:\phjoly\hibernate-3.1\lib\cleanimports.jar;D:\phjoly\hibernate-3.1\lib\commons-collections-2.1.1.jar;D:\phjoly\hibernate-3.1\lib\commons-logging-1.0.4.jar;D:\phjoly\hibernate-3.1\lib\concurrent-1.3.2.jar;D:\phjoly\hibernate-3.1\lib\connector.jar;D:\phjoly\hibernate-3.1\lib\dom4j-1.6.1.jar;D:\phjoly\hibernate-3.1\lib\ehcache-1.1.jar;D:\phjoly\hibernate-3.1\lib\jaas.jar;D:\phjoly\hibernate-3.1\lib\jacc-1_0-fr.jar;D:\phjoly\hibernate-3.1\lib\jaxen-1.1-beta-7.jar;D:\phjoly\hibernate-3.1\lib\jboss-cache.jar;D:\phjoly\hibernate-3.1\lib\jboss-common.jar;D:\phjoly\hibernate-3.1\lib\jboss-jmx.jar;D:\phjoly\hibernate-3.1\lib\jboss-system.jar;D:\phjoly\hibernate-3.1\lib\jdbc2_0-stdext.jar;D:\phjoly\hibernate-3.1\lib\jgroups-2.2.8.jar;D:\phjoly\hibernate-3.1\lib\jta.jar;D:\phjoly\hibernate-3.1\lib\junit-3.8.1.jar;D:\phjoly\hibernate-3.1\lib\log4j-1.2.11.jar;D:\phjoly\hibernate-3.1\lib\oscache-2.1.jar;D:\phjoly\hibernate-3.1\lib\proxool-0.8.3.jar;D:\phjoly\hibernate-3.1\lib\swarmcache-1.0rc2.jar;D:\phjoly\hibernate-3.1\lib\syndiag2.jar;D:\phjoly\hibernate-3.1\lib\versioncheck.jar;D:\phjoly\hibernate-3.1\lib\xerces-2.6.2.jar;D:\phjoly\hibernate-3.1\lib\xml-apis.jar;D:\phjoly\hibernate-3.1\hibernate3.jar;C:\phjoly\workspace\Test Hibernate\lib\ojdbc14-9.2.0.5.jar;C:\phjoly\workspace\Test Hibernate\lib\hibernate-annotations.jar;D:\phjoly\hibernate-entitymanager-3.1beta6\lib\ejb3-persistence.jar, user.name=PHJOLY, hibernate.show_sql=true, java.vm.specification.version=1.0, sun.arch.data.model=32, java.home=D:\jdk1.5.0\jre, hibernate.connection.url=jdbc:oracle:thin:@123.12.12.123:1234:****, hibernate.dialect=org.hibernate.dialect.Oracle9Dialect, java.specification.vendor=Sun Microsystems Inc., user.language=en, awt.toolkit=sun.awt.windows.WToolkit, java.vm.info=mixed mode, sharing, hibernate.cglib.use_reflection_optimizer=true, java.version=1.5.0, java.ext.dirs=D:\jdk1.5.0\jre\lib\ext, sun.boot.class.path=D:\jdk1.5.0\jre\lib\rt.jar;D:\jdk1.5.0\jre\lib\i18n.jar;D:\jdk1.5.0\jre\lib\sunrsasign.jar;D:\jdk1.5.0\jre\lib\jsse.jar;D:\jdk1.5.0\jre\lib\jce.jar;D:\jdk1.5.0\jre\lib\charsets.jar;D:\jdk1.5.0\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-03-15 10:14:25,234 [main] DEBUG net.sf.ehcache.CacheManager - Creating new CacheManager with default config
2006-03-15 10:14:25,234 [main] DEBUG net.sf.ehcache.CacheManager - Configuring ehcache from classpath.
2006-03-15 10:14:25,250 [main] WARN  net.sf.ehcache.config.Configurator - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/D:/phjoly/hibernate-3.1/lib/ehcache-1.1.jar!/ehcache-failsafe.xml
2006-03-15 10:14:25,265 [main] DEBUG net.sf.ehcache.config.Configuration$DiskStore - Disk Store Path: C:\DOCUME~1\phJoly\LOCALS~1\Temp\
2006-03-15 10:14:25,296 [main] DEBUG org.hibernate.impl.SessionFactoryObjectFactory - initializing class SessionFactoryObjectFactory
2006-03-15 10:14:25,296 [main] DEBUG org.hibernate.impl.SessionFactoryObjectFactory - registered: 2c9fd28809fd662c0109fd662d010000 (unnamed)
2006-03-15 10:14:25,296 [main] INFO  org.hibernate.impl.SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured
2006-03-15 10:14:25,296 [main] DEBUG org.hibernate.impl.SessionFactoryImpl - instantiated session factory
2006-03-15 10:14:25,296 [main] DEBUG org.hibernate.impl.SessionFactoryImpl - Checking 0 named HQL queries
2006-03-15 10:14:25,296 [main] DEBUG org.hibernate.impl.SessionFactoryImpl - Checking 0 named SQL queries
2006-03-15 10:14:25,437 [main] DEBUG org.hibernate.impl.SessionImpl - opened session at timestamp: 4679342757117952
2006-03-15 10:14:25,453 [main] DEBUG org.hibernate.engine.query.QueryPlanCache - unable to locate HQL query plan in cache; generating (from test.UserProfile)
2006-03-15 10:14:25,453 [main] WARN org.hibernate.hql.QuerySplitter - no persistent classes found for query class: from test.UserProfile
Code:
2006-03-15 10:14:25,484 [main] DEBUG org.hibernate.engine.query.QueryPlanCache - located HQL query plan in cache (from test.UserProfile)
2006-03-15 10:14:25,484 [main] DEBUG org.hibernate.engine.query.HQLQueryPlan - find: from test.UserProfile
2006-03-15 10:14:25,484 [main] DEBUG org.hibernate.engine.QueryParameters - named parameters: {}
2006-03-15 10:14:25,484 [main] DEBUG org.hibernate.jdbc.JDBCContext - after autocommit
2006-03-15 10:14:25,484 [main] DEBUG org.hibernate.jdbc.ConnectionManager - aggressively releasing JDBC connection
2006-03-15 10:14:25,484 [main] DEBUG org.hibernate.impl.SessionImpl - after transaction completion
2006-03-15 10:14:25,500 [main] DEBUG org.hibernate.impl.SessionImpl - closing session
2006-03-15 10:14:25,500 [main] DEBUG org.hibernate.jdbc.ConnectionManager - connection already null in cleanup : no action
2006-03-15 10:14:25,500 [main] INFO  org.hibernate.impl.SessionFactoryImpl - closing
2006-03-15 10:14:25,500 [main] INFO  org.hibernate.connection.DriverManagerConnectionProvider - cleaning up connection pool: jdbc:oracle:thin:@123.12.12.123:1234:****



Hi,
I know this problem has been already posted, I read the posts, but I am still unable to fix my problem.
I want to retrieve the complete list of an entity from the databse.
There are 4 lines in user_profile table on the database.

No exception at runtime, just an incorrect empty result.
In the log file : no persistent classes found for query class

Apparently the mapping is not loaded, but I do not understand why, because the mapping is in the hibernate.cfg.xml file, and I know that Hibernate has found that file because we can see the database settings in the logs.

There is also no SQL generated.

Do you know what is wrong ?
It must be very basic, but I can not see...(I have tried as well a lot a various modifications, without any success).

Thanks a lot.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 15, 2006 6:54 am 
Newbie

Joined: Mon Mar 13, 2006 12:03 pm
Posts: 6
OK.......
I am searching for 1 day now, and I have just found the solution AFTER having post that message....

That is in the FAQ :
Quote:
My Annotated class will not load

If you did not annotate with javax.persistence.Entity the AnnotationConfiguration class will ignore it. In particular, be sure you did not use org.hibernate.annotation.Entity by mistake. A good test is to use programmatic configuration via AnnotationConfiguration.addAnnotatedClass() rather than a hibernate.cfg.xml entry for the class in question.


So I have changed my import to :
import javax.persistence.Entity;

Now a SQL request is generated !

It crashes ;-) but I will search why.

Thanks, and sorry !


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 15, 2006 7:02 am 
Newbie

Joined: Mon Mar 13, 2006 12:03 pm
Posts: 6
Lol,

Same problem with @Table

It must be also :
import javax.persistence.Table;

And now my crappy example works !

So Why is there a duplicate annotation in hibernate ?


Top
 Profile  
 
 Post subject: Re: [DEJA VU] no persistent classes found for query class
PostPosted: Wed Jun 16, 2010 9:53 pm 
Newbie

Joined: Mon Jan 26, 2009 10:20 pm
Posts: 1
I had a similar issue and your detailed message provided me the Hint I required to solve my problem !!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.