1 2 Previous Next 20 Replies Latest reply on May 7, 2009 1:12 PM by peterj

    no persistent classes found for query class

      Hi buddies,
      i encountered such an error using hibernate annotations

      "no persistent classes found for query class"

      i don't know how to solve this.it is very urgent for me.i appricete all the answers earlier.

        • 1. Re: no persistent classes found for query class
          peterj

          Details, please.

          • 2. Re: no persistent classes found for query class

            14:04:18,739 INFO [ServerImpl] Starting JBoss (Microcontainer)...
            14:04:18,739 INFO [ServerImpl] Release ID: JBoss [Morpheus] 5.0.1.GA (build: SVNTag=JBoss_5_0_1_GA date=200902231221)
            14:04:18,739 INFO [ServerImpl] Bootstrap URL: null
            14:04:18,739 INFO [ServerImpl] Home Dir: C:\jboss-5.0.1.GA
            14:04:18,739 INFO [ServerImpl] Home URL: file:/C:/jboss-5.0.1.GA/
            14:04:18,739 INFO [ServerImpl] Library URL: file:/C:/jboss-5.0.1.GA/lib/
            14:04:18,739 INFO [ServerImpl] Patch URL: null
            14:04:18,739 INFO [ServerImpl] Common Base URL: file:/C:/jboss-5.0.1.GA/common/
            14:04:18,864 INFO [ServerImpl] Common Library URL: file:/C:/jboss-5.0.1.GA/common/lib/
            14:04:18,864 INFO [ServerImpl] Server Name: default
            14:04:18,864 INFO [ServerImpl] Server Base Dir: C:\jboss-5.0.1.GA\server
            14:04:18,864 INFO [ServerImpl] Server Base URL: file:/C:/jboss-5.0.1.GA/server/
            14:04:18,864 INFO [ServerImpl] Server Config URL: file:/C:/jboss-5.0.1.GA/server/default/conf/
            14:04:18,864 INFO [ServerImpl] Server Home Dir: C:\jboss-5.0.1.GA\server\default
            14:04:18,864 INFO [ServerImpl] Server Home URL: file:/C:/jboss-5.0.1.GA/server/default/
            14:04:18,864 INFO [ServerImpl] Server Data Dir: C:\jboss-5.0.1.GA\server\default\data
            14:04:18,864 INFO [ServerImpl] Server Library URL: file:/C:/jboss-5.0.1.GA/server/default/lib/
            14:04:18,864 INFO [ServerImpl] Server Log Dir: C:\jboss-5.0.1.GA\server\default\log
            14:04:18,864 INFO [ServerImpl] Server Native Dir: C:\jboss-5.0.1.GA\server\default\tmp\native
            14:04:18,864 INFO [ServerImpl] Server Temp Dir: C:\jboss-5.0.1.GA\server\default\tmp
            14:04:18,864 INFO [ServerImpl] Server Temp Deploy Dir: C:\jboss-5.0.1.GA\server\default\tmp\deploy
            14:04:19,239 INFO [ServerImpl] Starting Microcontainer, bootstrapURL=file:/C:/jboss-5.0.1.GA/server/default/conf/bootstrap.xml
            14:04:19,629 INFO [VFSCacheFactory] Initializing VFSCache [org.jboss.virtual.plugins.cache.CombinedVFSCache]
            14:04:19,629 INFO [VFSCacheFactory] Using VFSCache [CombinedVFSCache[real-cache: null]]
            14:04:19,817 INFO [CopyMechanism] VFS temp dir: C:\jboss-5.0.1.GA\server\default\tmp
            14:04:19,832 INFO [ZipEntryContext] VFS force nested jars copy-mode is enabled.
            14:04:20,520 INFO [ServerInfo] Java version: 1.6.0_13,Sun Microsystems Inc.
            14:04:20,520 INFO [ServerInfo] Java Runtime: Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
            14:04:20,520 INFO [ServerInfo] Java VM: Java HotSpot(TM) Client VM 11.3-b02,Sun Microsystems Inc.
            14:04:20,520 INFO [ServerInfo] OS-System: Windows 2003 5.2,x86
            14:04:20,551 INFO [JMXKernel] Legacy JMX core initialized
            14:04:21,629 INFO [ProfileServiceImpl] Loading profile: default from: org.jboss.system.server.profileservice.repository.SerializableDeploymentRepository@f51766(root=C:\jboss-5.0.1.GA\server, key=org.jboss.profileservice.spi.ProfileKey@143b82c3[domain=default,server=default,name=default])
            14:04:21,629 INFO [ProfileImpl] Using repository:org.jboss.system.server.profileservice.repository.SerializableDeploymentRepository@f51766(root=C:\jboss-5.0.1.GA\server, key=org.jboss.profileservice.spi.ProfileKey@143b82c3[domain=default,server=default,name=default])
            14:04:21,629 INFO [ProfileServiceImpl] Loaded profile: ProfileImpl@9021e3{key=org.jboss.profileservice.spi.ProfileKey@143b82c3[domain=default,server=default,name=default]}
            14:04:22,785 INFO [WebService] Using RMI server codebase: http://127.0.0.1:8083/
            14:04:26,847 INFO [NativeServerConfig] JBoss Web Services - Stack Native Core
            14:04:26,847 INFO [NativeServerConfig] 3.0.5.GA
            14:04:33,347 INFO [JMXConnectorServerService] JMX Connector server: service:jmx:rmi://127.0.0.1/jndi/rmi://127.0.0.1:1090/jmxconnector
            14:04:33,456 INFO [MailService] Mail Service bound to java:/Mail
            14:04:35,175 WARN [JBossASSecurityMetadataStore] WARNING! POTENTIAL SECURITY RISK. It has been detected that the MessageSucker component which sucks messages from one node to another has not had its password changed from the installation default. Please see the JBoss Messaging user guide for instructions on how to do this.
            14:04:35,191 WARN [AnnotationCreator] No ClassLoader provided, using TCCL: org.jboss.managed.api.annotation.ManagementComponent
            14:04:35,284 INFO [TransactionManagerService] JBossTS Transaction Service (JTA version) - JBoss Inc.
            14:04:35,284 INFO [TransactionManagerService] Setting up property manager MBean and JMX layer
            14:04:35,472 INFO [TransactionManagerService] Initializing recovery manager
            14:04:35,581 INFO [TransactionManagerService] Recovery manager configured
            14:04:35,581 INFO [TransactionManagerService] Binding TransactionManager JNDI Reference
            14:04:35,597 INFO [TransactionManagerService] Starting transaction recovery manager
            14:04:36,019 INFO [Http11Protocol] Initializing Coyote HTTP/1.1 on http-127.0.0.1-8080
            14:04:36,019 INFO [AjpProtocol] Initializing Coyote AJP/1.3 on ajp-127.0.0.1-8009
            14:04:36,019 INFO [StandardService] Starting service jboss.web
            14:04:36,019 INFO [StandardEngine] Starting Servlet Engine: JBoss Web/2.1.2.GA
            14:04:36,597 INFO [Catalina] Server startup in 638 ms
            14:04:36,612 INFO [TomcatDeployment] deploy, ctxPath=/jbossws
            14:04:37,018 INFO [TomcatDeployment] deploy, ctxPath=/invoker
            14:04:37,065 INFO [TomcatDeployment] deploy, ctxPath=/web-console
            14:04:37,315 INFO [RARDeployment] Required license terms exist, view vfszip:/C:/jboss-5.0.1.GA/server/default/deploy/jboss-local-jdbc.rar/META-INF/ra.xml
            14:04:37,331 INFO [RARDeployment] Required license terms exist, view vfszip:/C:/jboss-5.0.1.GA/server/default/deploy/jboss-xa-jdbc.rar/META-INF/ra.xml
            14:04:37,362 INFO [RARDeployment] Required license terms exist, view vfszip:/C:/jboss-5.0.1.GA/server/default/deploy/jms-ra.rar/META-INF/ra.xml
            14:04:37,393 INFO [RARDeployment] Required license terms exist, view vfszip:/C:/jboss-5.0.1.GA/server/default/deploy/mail-ra.rar/META-INF/ra.xml
            14:04:37,409 INFO [RARDeployment] Required license terms exist, view vfszip:/C:/jboss-5.0.1.GA/server/default/deploy/quartz-ra.rar/META-INF/ra.xml
            14:04:37,456 INFO [SimpleThreadPool] Job execution threads will use class loader of thread: main
            14:04:37,487 INFO [QuartzScheduler] Quartz Scheduler v.1.5.2 created.
            14:04:37,503 INFO [RAMJobStore] RAMJobStore initialized.
            14:04:37,503 INFO [StdSchedulerFactory] Quartz scheduler 'DefaultQuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties'
            14:04:37,503 INFO [StdSchedulerFactory] Quartz scheduler version: 1.5.2
            14:04:37,503 INFO [QuartzScheduler] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started.
            14:04:38,425 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'
            14:04:38,721 INFO [ServerPeer] JBoss Messaging 1.4.1.GA server [0] started
            14:04:38,831 INFO [QueueService] Queue[/queue/DLQ] started, fullSize=200000, pageSize=2000, downCacheSize=2000
            14:04:38,831 INFO [QueueService] Queue[/queue/ExpiryQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000
            14:04:38,878 INFO [ConnectionFactory] Connector bisocket://127.0.0.1:4457 has leasing enabled, lease period 10000 milliseconds
            14:04:38,878 INFO [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@18a4ec6 started
            14:04:38,878 INFO [ConnectionFactory] Connector bisocket://127.0.0.1:4457 has leasing enabled, lease period 10000 milliseconds
            14:04:38,878 INFO [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@141928f started
            14:04:38,878 WARN [ConnectionFactoryJNDIMapper] supportsFailover attribute is true on connection factory: jboss.messaging.connectionfactory:service=ClusteredConnectionFactory but post office is non clustered. So connection factory will *not* support failover
            14:04:38,878 WARN [ConnectionFactoryJNDIMapper] supportsLoadBalancing attribute is true on connection factory: jboss.messaging.connectionfactory:service=ClusteredConnectionFactory but post office is non clustered. So connection factory will *not* support load balancing
            14:04:38,878 INFO [ConnectionFactory] Connector bisocket://127.0.0.1:4457 has leasing enabled, lease period 10000 milliseconds
            14:04:38,878 INFO [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@1ba0b12 started
            14:04:38,956 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
            14:04:39,003 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=MSSQLDS' to JNDI name 'java:MSSQLDS'
            14:04:39,034 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=hibernateJNDI' to JNDI name 'java:hibernateJNDI'
            14:04:39,050 INFO [TomcatDeployment] deploy, ctxPath=/
            14:04:39,081 INFO [TomcatDeployment] deploy, ctxPath=/jmx-console
            14:04:39,112 INFO [HibernateDeployer] Created Hibernate bean: AbstractBeanMetaData@1bdcd96{name=jboss.har:service=Hibernate bean=org.jboss.hibernate.jmx.Hibernate properties=[datasourceName, dialect, sessionFactoryName] constructor=AbstractConstructorMetaData@4473c{parameters=[org.jboss.virtual.VirtualFile]} autowireCandidate=true}
            14:04:39,190 INFO [Environment] Hibernate 3.3.1.GA
            14:04:39,190 INFO [Environment] hibernate.properties not found
            14:04:39,206 INFO [Environment] Bytecode provider name : javassist
            14:04:39,206 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
            14:04:39,315 INFO [HbmBinder] Mapping class: Bank -> Bank
            14:04:39,409 INFO [HbmBinder] Mapping class: User -> BankUser
            14:04:39,409 INFO [HbmBinder] Mapping class: Station -> Station
            14:04:39,409 INFO [HbmBinder] Mapping class: Bid -> Bid
            14:04:39,425 INFO [HbmBinder] Mapping class: BillingDetails -> BillingDetails
            14:04:39,518 INFO [NamingHelper] JNDI InitialContext properties:{}
            14:04:39,518 INFO [DatasourceConnectionProvider] Using datasource: java:/hibernateJNDI
            14:04:39,550 INFO [SettingsFactory] RDBMS: Microsoft SQL Server, version: 9.00.1399
            14:04:39,550 INFO [SettingsFactory] JDBC driver: Microsoft SQL Server 2005 JDBC Driver, version: 1.0.809.102
            14:04:39,565 INFO [Dialect] Using dialect: org.hibernate.dialect.SQLServerDialect
            14:04:39,565 INFO [TransactionFactoryFactory] Transaction strategy: org.hibernate.transaction.JTATransactionFactory
            14:04:39,565 INFO [NamingHelper] JNDI InitialContext properties:{}
            14:04:39,565 INFO [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup
            14:04:39,565 INFO [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
            14:04:39,565 INFO [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup
            14:04:39,565 INFO [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
            14:04:39,565 INFO [SettingsFactory] Automatic flush during beforeCompletion(): enabled
            14:04:39,565 INFO [SettingsFactory] Automatic session close at end of transaction: enabled
            14:04:39,565 INFO [SettingsFactory] Scrollable result sets: enabled
            14:04:39,565 INFO [SettingsFactory] JDBC3 getGeneratedKeys(): enabled
            14:04:39,565 INFO [SettingsFactory] Connection release mode: after_statement
            14:04:39,565 INFO [SettingsFactory] Default batch fetch size: 1
            14:04:39,565 INFO [SettingsFactory] Generate SQL with comments: disabled
            14:04:39,565 INFO [SettingsFactory] Order SQL updates by primary key: disabled
            14:04:39,565 INFO [SettingsFactory] Order SQL inserts for batching: disabled
            14:04:39,565 INFO [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
            14:04:39,581 INFO [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
            14:04:39,581 INFO [SettingsFactory] Query language substitutions: {}
            14:04:39,581 INFO [SettingsFactory] JPA-QL strict compliance: disabled
            14:04:39,581 INFO [SettingsFactory] Second-level cache: enabled
            14:04:39,581 INFO [SettingsFactory] Query cache: disabled
            14:04:39,581 INFO [SettingsFactory] Cache region factory : org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge
            14:04:39,581 INFO [RegionFactoryCacheProviderBridge] Cache provider: org.hibernate.cache.HashtableCacheProvider
            14:04:39,581 INFO [SettingsFactory] Optimize cache for minimal puts: disabled
            14:04:39,581 INFO [SettingsFactory] Structured second-level cache entries: disabled
            14:04:39,581 INFO [SettingsFactory] Statistics: disabled
            14:04:39,581 INFO [SettingsFactory] Deleted entity synthetic identifier rollback: disabled
            14:04:39,581 INFO [SettingsFactory] Default entity-mode: pojo
            14:04:39,581 INFO [SettingsFactory] Named query checking : enabled
            14:04:40,237 INFO [SessionFactoryImpl] building session factory
            14:04:40,440 INFO [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured
            14:04:40,440 INFO [NamingHelper] JNDI InitialContext properties:{}
            14:04:40,440 INFO [Hibernate] SessionFactory successfully built and bound into JNDI [hibernateJNDI]
            14:04:40,456 INFO [PersistenceUnitDeployment] Starting persistence unit persistence.unit:unitName=#bank
            14:04:40,471 INFO [Version] Hibernate Annotations 3.4.0.GA
            14:04:40,503 INFO [Version] Hibernate Commons Annotations 3.1.0.GA
            14:04:40,503 INFO [Version] Hibernate EntityManager 3.4.0.GA
            14:04:40,518 WARN [Ejb3Configuration] Persistence provider caller does not implement the EJB3 spec correctly. PersistenceUnitInfo.getNewTempClassLoader() is null.
            14:04:40,518 INFO [Configuration] configuring from resource: hibernate.cfg.xml
            14:04:40,518 INFO [Configuration] Configuration resource: hibernate.cfg.xml
            14:04:40,518 INFO [Configuration] Configured SessionFactory: hibernateJNDI
            14:04:40,565 INFO [HbmBinder] Mapping class: Station -> Station
            14:04:40,565 INFO [HbmBinder] Mapping class: Bank -> Bank
            14:04:40,565 INFO [HbmBinder] Mapping class: BillingDetails -> BillingDetails
            14:04:40,565 INFO [HbmBinder] Mapping class: Bid -> Bid
            14:04:40,565 INFO [HbmBinder] Mapping class: User -> BankUser
            14:04:40,581 INFO [Version] Hibernate Validator 3.1.0.GA
            14:04:40,643 INFO [HibernateSearchEventListenerRegister] Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
            14:04:40,643 INFO [ConnectionProviderFactory] Initializing connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
            14:04:40,643 INFO [InjectedDataSourceConnectionProvider] Using provided datasource
            14:04:40,643 INFO [SettingsFactory] RDBMS: Microsoft SQL Server, version: 9.00.1399
            14:04:40,643 INFO [SettingsFactory] JDBC driver: Microsoft SQL Server 2005 JDBC Driver, version: 1.0.809.102
            14:04:40,643 INFO [Dialect] Using dialect: org.hibernate.dialect.SQLServerDialect
            14:04:40,643 INFO [TransactionFactoryFactory] Transaction strategy: org.hibernate.transaction.JDBCTransactionFactory
            14:04:40,643 INFO [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup
            14:04:40,643 INFO [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
            14:04:40,643 INFO [SettingsFactory] Automatic flush during beforeCompletion(): disabled
            14:04:40,643 INFO [SettingsFactory] Automatic session close at end of transaction: disabled
            14:04:40,643 INFO [SettingsFactory] Scrollable result sets: enabled
            14:04:40,643 INFO [SettingsFactory] JDBC3 getGeneratedKeys(): enabled
            14:04:40,643 INFO [SettingsFactory] Connection release mode: auto
            14:04:40,643 INFO [SettingsFactory] Default batch fetch size: 1
            14:04:40,643 INFO [SettingsFactory] Generate SQL with comments: disabled
            14:04:40,643 INFO [SettingsFactory] Order SQL updates by primary key: disabled
            14:04:40,643 INFO [SettingsFactory] Order SQL inserts for batching: disabled
            14:04:40,643 INFO [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
            14:04:40,643 INFO [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
            14:04:40,643 INFO [SettingsFactory] Query language substitutions: {}
            14:04:40,643 INFO [SettingsFactory] JPA-QL strict compliance: enabled
            14:04:40,643 INFO [SettingsFactory] Second-level cache: enabled
            14:04:40,643 INFO [SettingsFactory] Query cache: disabled
            14:04:40,643 INFO [SettingsFactory] Cache region factory : org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge
            14:04:40,643 INFO [RegionFactoryCacheProviderBridge] Cache provider: org.hibernate.cache.HashtableCacheProvider
            14:04:40,643 INFO [SettingsFactory] Optimize cache for minimal puts: disabled
            14:04:40,643 INFO [SettingsFactory] Cache region prefix: persistence.unit:unitName=#bank
            14:04:40,643 INFO [SettingsFactory] Structured second-level cache entries: disabled
            14:04:40,643 INFO [SettingsFactory] Echoing all SQL to stdout
            14:04:40,643 INFO [SettingsFactory] Statistics: disabled
            14:04:40,643 INFO [SettingsFactory] Deleted entity synthetic identifier rollback: disabled
            14:04:40,643 INFO [SettingsFactory] Default entity-mode: pojo
            14:04:40,643 INFO [SettingsFactory] Named query checking : enabled
            14:04:40,674 INFO [SessionFactoryImpl] building session factory
            14:04:40,690 INFO [SessionFactoryObjectFactory] Factory name: persistence.unit:unitName=#bank
            14:04:40,706 INFO [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
            14:04:40,706 INFO [SessionFactoryObjectFactory] Bound factory to JNDI name: persistence.unit:unitName=#bank
            14:04:40,706 WARN [SessionFactoryObjectFactory] InitialContext did not implement EventContext
            14:04:40,706 INFO [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
            14:04:40,706 WARN [SessionFactoryImpl] JTASessionContext being used with JDBCTransactionFactory; auto-flush will not operate correctly with getCurrentSession()
            14:04:40,784 INFO [TomcatDeployment] deploy, ctxPath=/web
            14:04:41,362 INFO [Configuration] configuring from resource: hibernate.cfg.xml
            14:04:41,362 INFO [Configuration] Configuration resource: hibernate.cfg.xml
            14:04:41,378 INFO [Configuration] Configured SessionFactory: hibernateJNDI
            14:04:41,378 INFO [HibernateSearchEventListenerRegister] Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
            14:04:41,378 INFO [NamingHelper] JNDI InitialContext properties:{}
            14:04:41,378 INFO [DatasourceConnectionProvider] Using datasource: java:/MSSQLDS
            14:04:41,378 INFO [SettingsFactory] RDBMS: Microsoft SQL Server, version: 9.00.1399
            14:04:41,378 INFO [SettingsFactory] JDBC driver: Microsoft SQL Server 2005 JDBC Driver, version: 1.0.809.102
            14:04:41,378 INFO [Dialect] Using dialect: org.hibernate.dialect.SQLServerDialect
            14:04:41,378 INFO [TransactionFactoryFactory] Transaction strategy: org.hibernate.transaction.JDBCTransactionFactory
            14:04:41,378 INFO [TransactionManagerLookupFactory] No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
            14:04:41,378 INFO [SettingsFactory] Automatic flush during beforeCompletion(): disabled
            14:04:41,378 INFO [SettingsFactory] Automatic session close at end of transaction: disabled
            14:04:41,378 INFO [SettingsFactory] Scrollable result sets: enabled
            14:04:41,378 INFO [SettingsFactory] JDBC3 getGeneratedKeys(): enabled
            14:04:41,378 INFO [SettingsFactory] Connection release mode: auto
            14:04:41,378 INFO [SettingsFactory] Default batch fetch size: 1
            14:04:41,378 INFO [SettingsFactory] Generate SQL with comments: disabled
            14:04:41,378 INFO [SettingsFactory] Order SQL updates by primary key: disabled
            14:04:41,378 INFO [SettingsFactory] Order SQL inserts for batching: disabled
            14:04:41,378 INFO [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
            14:04:41,378 INFO [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
            14:04:41,378 INFO [SettingsFactory] Query language substitutions: {}
            14:04:41,378 INFO [SettingsFactory] JPA-QL strict compliance: enabled
            14:04:41,378 INFO [SettingsFactory] Second-level cache: enabled
            14:04:41,378 INFO [SettingsFactory] Query cache: disabled
            14:04:41,378 INFO [SettingsFactory] Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory
            14:04:41,378 INFO [SettingsFactory] Optimize cache for minimal puts: disabled
            14:04:41,378 INFO [SettingsFactory] Structured second-level cache entries: disabled
            14:04:41,378 INFO [SettingsFactory] Echoing all SQL to stdout
            14:04:41,378 INFO [SettingsFactory] Statistics: disabled
            14:04:41,378 INFO [SettingsFactory] Deleted entity synthetic identifier rollback: disabled
            14:04:41,378 INFO [SettingsFactory] Default entity-mode: pojo
            14:04:41,378 INFO [SettingsFactory] Named query checking : enabled
            14:04:41,378 INFO [SessionFactoryImpl] building session factory
            14:04:41,378 INFO [SessionFactoryObjectFactory] Factory name: hibernateJNDI
            14:04:41,378 INFO [NamingHelper] JNDI InitialContext properties:{}
            14:04:41,378 INFO [SessionFactoryObjectFactory] Bound factory to JNDI name: hibernateJNDI
            14:04:41,378 WARN [SessionFactoryObjectFactory] InitialContext did not implement EventContext
            14:04:41,440 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
            14:04:41,456 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
            14:04:41,456 INFO [ServerImpl] JBoss (Microcontainer) [5.0.1.GA (build: SVNTag=JBoss_5_0_1_GA date=200902231221)] Started in 22s:592ms
            14:08:51,765 WARN [QuerySplitter] no persistent classes found for query class: from User user

            • 3. Re: no persistent classes found for query class

              I am using Eclipse IDE and hibernate entity domain classes and ms sql server

              • 4. Re: no persistent classes found for query class

                public class User {
                public Long id;
                public String getName() {
                return Name;
                }
                public void setName(String name) {
                Name = name;
                }
                public String getPassword() {
                return password;
                }
                public void setPassword(String password) {
                this.password = password;
                }
                public Long getId() {
                return id;
                }
                public String Name;
                public String password;

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

                • 5. Re: no persistent classes found for query class

                  there are two files under src/META_INF/persistence.xml and web-hibernate.xml

                  persistence.xml is as below:

                  <persistence xmlns="http://java.sun.com/xml/ns/persistence"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
                  version="1.0">
                  <persistence-unit name="bank" transaction-type="RESOURCE_LOCAL">
                  org.hibernate.ejb.HibernatePersistence
                  <non-jta-data-source>java:/MSSQLDS</non-jta-data-source>




                  </persistence-unit>


                  web-hibernate.xml

                  <?xml version="1.0" encoding="UTF-8"?>
                  <hibernate-configuration xmlns="urn:jboss:hibernate-deployer:1.0">
                  <session-factory name="hibernateJNDI" bean="jboss.har:service=Hibernate">
                  java:/hibernateJNDI
                  org.hibernate.dialect.SQLServerDialect
                  </session-factory>
                  </hibernate-configuration>

                  also there exists two hibernate xml files

                  one is hibernate.cfg.xml

                  <?xml version="1.0" encoding="UTF-8"?>
                  <!DOCTYPE hibernate-configuration PUBLIC
                  "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
                  "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

                  <hibernate-configuration>
                  <session-factory name="SessionFactoryName">
                  true

                  org.hibernate.dialect.SQLServerDialect
                  com.microsoft.sqlserver.jdbc.SQLServerDriver
                  java:/MSSQLDS
                  jdbc:sqlserver://localhost\SQLEXPRESS3:1433;DatabaseName=bank
                  sa
                  12345678

                  </session-factory>
                  </hibernate-configuration>

                  User.hbm.xml

                  <?xml version="1.0" encoding="UTF-8"?>
                  <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
                  "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
                  <hibernate-mapping>







                  </hibernate-mapping>









                  • 6. Re: no persistent classes found for query class
                    peterj

                    When posting XML text or source code, please enclose the text in UBBCode "code" tags - you can do this by selecting the text and clicking the Code button above the editor window. Also, click the Preview button to ensure that the formatting is correct and the XML text shows up before posting.

                    • 7. Re: no persistent classes found for query class

                       

                      <?xml version="1.0" encoding="UTF-8"?>
                      <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
                      "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
                      <hibernate-mapping>
                      <class name="User" table="BankUser">
                      <id column="ID" name="id" type="java.lang.Long">
                      <generator class="identity"/>
                      </id>
                      <property name="Name" type="string" length="50" column="Name" />
                      <property name="password" type="string" length="50" column="password" />
                      </class>
                      </hibernate-mapping>
                      


                      • 8. Re: no persistent classes found for query class

                         

                        public class User {
                        public Long id;
                        public String getName() {
                         return Name;
                        }
                        public void setName(String name) {
                         Name = name;
                        }
                        public String getPassword() {
                         return password;
                        }
                        public void setPassword(String password) {
                         this.password = password;
                        }
                        public Long getId() {
                         return id;
                        }
                        public String Name;
                        public String password;
                        
                        public void setId(Long id) {
                         this.id = id;
                        }
                        }
                        


                        • 9. Re: no persistent classes found for query class

                          hibernate.cfg.xml

                          
                          <?xml version="1.0" encoding="UTF-8"?>
                          <!DOCTYPE hibernate-configuration PUBLIC
                          "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
                          "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
                          
                          <hibernate-configuration>
                          <session-factory name="SessionFactoryName">
                           <property name="show_sql">true</property>
                          
                           <property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property>
                           <property name="hibernate.connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
                           <property name="hibernate.connection.datasource">java:/MSSQLDS</property>
                           <property name="hibernate.connection.url">jdbc:sqlserver://localhost\SQLEXPRESS3:1433;DatabaseName=bank</property>
                           <property name="hibernate.connection.username">sa</property>
                           <property name="hibernate.connection.password">12345678</property>
                          
                          </session-factory>
                          </hibernate-configuration>


                          • 10. Re: no persistent classes found for query class

                             

                            <persistence xmlns="http://java.sun.com/xml/ns/persistence"
                             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
                             version="1.0">
                             <persistence-unit name="bank" transaction-type="RESOURCE_LOCAL">
                             <provider>org.hibernate.ejb.HibernatePersistence</provider>
                             <non-jta-data-source>java:/MSSQLDS</non-jta-data-source>
                             <properties>
                            
                             <!-- alternatively to <class> and <property> declarations, you can use a regular hibernate.cfg.xml file -->
                             <property name="hibernate.ejb.cfgfile" value="hibernate.cfg.xml"/>
                            
                             </properties>
                             </persistence-unit>
                            </persistence>


                            • 11. Re: no persistent classes found for query class

                              and this is the last :)

                              <?xml version="1.0" encoding="UTF-8"?>
                              <hibernate-configuration xmlns="urn:jboss:hibernate-deployer:1.0">
                              <session-factory name="hibernateJNDI" bean="jboss.har:service=Hibernate">
                              <property name="datasourceName">java:/hibernateJNDI</property>
                              <property name="dialect">org.hibernate.dialect.SQLServerDialect</property>
                              </session-factory>
                              </hibernate-configuration>


                              • 12. Re: no persistent classes found for query class

                                the last one was web-hibernate.xml

                                i am waiting your helps,please.it became urgent

                                • 13. Re: no persistent classes found for query class
                                  peterj

                                  Are you using EJB3, or are you using Hibernate directly? I ask because you posted both the hibernate.cfg.xml file and the persistence.xml file. Also, you appear to have posted two hibernate.cfg.xml files. Could you specify the exact location, relative to the base of your EAR or WAR file, of all of the files?

                                  You earlier mentioned annotations - I don't see any.

                                  The User class - is there no package name? Not a good idea - I have seen various weird problems when dealing with packageless classes.

                                  The WARN at the end of the console log - was there not a stack trace that went with it? That is the interesting information. If there is not one in the console log, look in server.log.

                                  Where is the code that is performing the lookup (or whatever) on the User class?

                                  • 14. Re: no persistent classes found for query class

                                     

                                    import javax.naming.InitialContext;
                                    import javax.persistence.EntityManager;
                                    import javax.persistence.EntityManagerFactory;
                                    import javax.persistence.NoResultException;
                                    import javax.persistence.Persistence;
                                    import javax.persistence.Query;
                                    
                                    import org.hibernate.Session;
                                    import org.hibernate.SessionFactory;
                                    
                                    
                                    public class LoginBean {
                                    private String LoginName;
                                    private String password;
                                    
                                    public String getLoginName() {
                                     return LoginName;
                                    }
                                    public void setLoginName(String loginName) {
                                     LoginName = loginName;
                                    }
                                    public String getPassword() {
                                     return password;
                                    }
                                    public void setPassword(String password) {
                                     this.password = password;
                                    }
                                    public String login() throws Exception{
                                     /* EntityManagerFactory emf;
                                    
                                     EntityManager em;
                                    
                                     // Logger.getLogger("org").setLevel(Level.SEVERE);
                                    
                                     emf = Persistence.createEntityManagerFactory("bank");
                                     em = emf.createEntityManager();
                                     Query query = em.createQuery("from User user");
                                     User user = (User)query.getSingleResult();*/
                                     // get entity manager from helper class
                                    
                                     EntityManager em = Contexts.getEntityManager();
                                    //EntityManagerFactory emf = Persistence.createEntityManagerFactory("bank");
                                    //EntityManager em = emf.createEntityManager();
                                     // create a query with named parameters
                                     Query query = em.createQuery(
                                     "from User user"/* +
                                     "user.Name = :username" +
                                     "and user.password = :password"*/);
                                    
                                     // bind parameters
                                    /* query.setParameter("username", getLoginName());
                                     query.setParameter("password", getPassword());*/
                                     InitialContext ctx = new InitialContext();
                                     SessionFactory factory = (SessionFactory)
                                     ctx.lookup("java:/MSSQLDS");
                                     Session hsession = factory.openSession();
                                     Query q = (Query) hsession.createQuery("from User user");
                                     // execute query
                                     try {
                                     User user = (User)query.getSingleResult();
                                     // store found user to session
                                     Contexts.getSession().setAttribute("user", user);
                                     } catch (NoResultException e) {
                                     // no user found - return failure
                                     e.printStackTrace();
                                     return "failure";
                                     }
                                    
                                     //return success
                                     return "success";
                                    }
                                    }


                                    i'm using session beans and hibernate jpa.as far as i know if we use hibernate.cfg.xml and persistence.xml are one of them overrides the other,anyway.

                                    As you said i didn't use packages.i will use it. i used hibernate annotations but didn't put any@Entity and the other tags.Could you please how to use hibernate entity manager in jboss.
                                    my aim to use jsf in jboss and o/r mapping with hibernate.



                                    1 2 Previous Next