spring configuretion xML file
Code:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:flow="http://www.springframework.org/schema/webflow-config"
xmlns:jms="http://www.springframework.org/schema/jms"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:lang="http://www.springframework.org/schema/lang"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.6.SEC01.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.6.SEC01.xsd
http://www.springframework.org/schema/webflow-config http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.0.xsd
http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms-2.5.6.SEC01.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.6.SEC01.xsd
http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.5.6.SEC01.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.6.SEC01.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.6.SEC01.xsd
">
<bean id="dataSource" class="org.apache.tomcat.dbcp.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver" />
<property name="url" value="jdbc:sqlserver://URL" />
<property name="username" value="UNAME" />
<property name="password" value="PASS" /> </bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="configLocation" value="hibernate.cfg.xml" />
<property name="configurationClass" value="org.hibernate.cfg.AnnotationConfiguration" />
<property name="hibernateProperties">
<props>
<prop key="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</prop>
<prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop>
<prop key="hibernate.hbm2ddl.auto">create</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
</bean>
<bean name="loginDAO" class="test.LoginDAO">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
</beans>
hibernate configuration file
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>
</session-factory>
</hibernate-configuration>
Stack TRACE
Code:
run:
Mar 11, 2011 4:55:54 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [XMLConfig.xml]
Mar 11, 2011 4:55:54 PM org.hibernate.cfg.annotations.Version <clinit>
INFO: Hibernate Annotations 3.3.1.GA
Mar 11, 2011 4:55:54 PM org.hibernate.cfg.Environment <clinit>
INFO: Hibernate 3.2.5
Mar 11, 2011 4:55:54 PM org.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found
Mar 11, 2011 4:55:54 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: Bytecode provider name : cglib
Mar 11, 2011 4:55:54 PM org.hibernate.cfg.Environment <clinit>
INFO: using JDK 1.4 java.sql.Timestamp handling
Mar 11, 2011 4:55:54 PM org.hibernate.cfg.Configuration configure
INFO: configuring from url: file:/C:/sphib/build/classes/hibernate.cfg.xml
Mar 11, 2011 4:55:54 PM org.hibernate.cfg.Configuration doConfigure
INFO: Configured SessionFactory: null
Mar 11, 2011 4:55:54 PM org.hibernate.cfg.AnnotationConfiguration secondPassCompile
INFO: Hibernate Validator not found: ignoring
Mar 11, 2011 4:55:54 PM org.springframework.orm.hibernate3.LocalSessionFactoryBean buildSessionFactory
INFO: Building new Hibernate SessionFactory
Mar 11, 2011 4:55:54 PM org.hibernate.connection.ConnectionProviderFactory newConnectionProvider
INFO: Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
Mar 11, 2011 4:55:55 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: RDBMS: Microsoft SQL Server, version: 9.00.4053
Mar 11, 2011 4:55:55 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC driver: Microsoft SQL Server 2005 JDBC Driver, version: 1.0.809.102
Mar 11, 2011 4:55:55 PM org.hibernate.dialect.Dialect <init>
INFO: Using dialect: org.hibernate.dialect.SQLServerDialect
Mar 11, 2011 4:55:55 PM org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory
INFO: Transaction strategy: org.springframework.orm.hibernate3.SpringTransactionFactory
Mar 11, 2011 4:55:55 PM org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
INFO: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
Mar 11, 2011 4:55:55 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Automatic flush during beforeCompletion(): disabled
Mar 11, 2011 4:55:55 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Automatic session close at end of transaction: disabled
Mar 11, 2011 4:55:55 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Scrollable result sets: enabled
Mar 11, 2011 4:55:55 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC3 getGeneratedKeys(): enabled
Mar 11, 2011 4:55:55 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Connection release mode: auto
Mar 11, 2011 4:55:55 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Default batch fetch size: 1
Mar 11, 2011 4:55:55 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Generate SQL with comments: disabled
Mar 11, 2011 4:55:55 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Order SQL updates by primary key: disabled
Mar 11, 2011 4:55:55 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Order SQL inserts for batching: disabled
Mar 11, 2011 4:55:55 PM org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory
INFO: Query translator: org.hibernate.hql.classic.ClassicQueryTranslatorFactory
Mar 11, 2011 4:55:55 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Query language substitutions: {}
Mar 11, 2011 4:55:55 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JPA-QL strict compliance: disabled
Mar 11, 2011 4:55:55 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Second-level cache: enabled
Mar 11, 2011 4:55:55 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Query cache: disabled
Mar 11, 2011 4:55:55 PM org.hibernate.cfg.SettingsFactory createCacheProvider
INFO: Cache provider: org.hibernate.cache.NoCacheProvider
Mar 11, 2011 4:55:55 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Optimize cache for minimal puts: disabled
Mar 11, 2011 4:55:55 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Structured second-level cache entries: disabled
Mar 11, 2011 4:55:55 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Echoing all SQL to stdout
Mar 11, 2011 4:55:55 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Statistics: disabled
Mar 11, 2011 4:55:55 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Deleted entity synthetic identifier rollback: disabled
Mar 11, 2011 4:55:55 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Default entity-mode: pojo
Mar 11, 2011 4:55:55 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Named query checking : enabled
Mar 11, 2011 4:55:55 PM org.hibernate.impl.SessionFactoryImpl <init>
INFO: building session factory
Mar 11, 2011 4:55:55 PM org.hibernate.impl.SessionFactoryObjectFactory addInstance
INFO: Not binding factory to JNDI, no JNDI name configured
Mar 11, 2011 4:55:55 PM org.hibernate.tool.hbm2ddl.SchemaExport execute
INFO: Running hbm2ddl schema export
Mar 11, 2011 4:55:55 PM org.hibernate.tool.hbm2ddl.SchemaExport execute
INFO: exporting generated schema to database
Mar 11, 2011 4:55:55 PM org.hibernate.tool.hbm2ddl.SchemaExport execute
INFO: schema export complete
Exception in thread "main" org.springframework.orm.hibernate3.HibernateSystemException: Unknown entity: test.Login_Validate; nested exception is org.hibernate.MappingException: Unknown entity: test.Login_Validate
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:676)
at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:339)
at test.LoginDAO.ValidateProcedure(LoginDAO.java:23)
at test.Testing.main(Testing.java:23)
Caused by: org.hibernate.MappingException: Unknown entity: test.Login_Validate
at org.hibernate.impl.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:550)
at org.hibernate.loader.custom.sql.SQLQueryReturnProcessor.getSQLLoadable(SQLQueryReturnProcessor.java:312)
at org.hibernate.loader.custom.sql.SQLQueryReturnProcessor.processRootReturn(SQLQueryReturnProcessor.java:353)
at org.hibernate.loader.custom.sql.SQLQueryReturnProcessor.processReturn(SQLQueryReturnProcessor.java:332)
at org.hibernate.loader.custom.sql.SQLQueryReturnProcessor.process(SQLQueryReturnProcessor.java:148)
at org.hibernate.loader.custom.sql.SQLCustomQuery.<init>(SQLCustomQuery.java:64)
at org.hibernate.engine.query.NativeSQLQueryPlan.<init>(NativeSQLQueryPlan.java:43)
at org.hibernate.engine.query.QueryPlanCache.getNativeSQLQueryPlan(QueryPlanCache.java:114)
at org.hibernate.impl.AbstractSessionImpl.getNativeSQLQueryPlan(AbstractSessionImpl.java:137)
at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142)
at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:152)
at test.LoginDAO$1.doInHibernate(LoginDAO.java:27)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:419)
... 3 more
Java Result: 1
BUILD SUCCESSFUL (total time: 23 seconds)