hibernate 2.1.3
i made one application for deskop and another with tomcat. in aplication with desktop, the hibernate returns that i want. but, when i start the aplication with tomcat and try make the same thing, return this error:
with SQLSERVER
Code:
Jun 1, 2004 5:54:19 PM net.sf.hibernate.cfg.Configuration addClass
INFO: Mapping resource: Cinq/entrega/Courier.hbm.xml
Jun 1, 2004 5:54:20 PM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: Cinq.entrega.Courier -> TB_ENTREGADOR
Jun 1, 2004 5:54:20 PM net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing one-to-many association mappings
Jun 1, 2004 5:54:20 PM net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing one-to-one association property references
Jun 1, 2004 5:54:20 PM net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing foreign key constraints
Jun 1, 2004 5:54:20 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
WARNING: No dialect set - using GenericDialect: The dialect was not set. Set the property hibernate.dialect.
Jun 1, 2004 5:54:20 PM net.sf.hibernate.dialect.Dialect <init>
INFO: Using dialect: net.sf.hibernate.dialect.GenericDialect
Jun 1, 2004 5:54:20 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Use outer join fetching: false
Jun 1, 2004 5:54:20 PM net.sf.hibernate.connection.UserSuppliedConnectionProvider configure
WARNING: No connection properties specified - the user must supply JDBC connections
Jun 1, 2004 5:54:20 PM net.sf.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
INFO: No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
Jun 1, 2004 5:54:20 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Use scrollable result sets: false
Jun 1, 2004 5:54:20 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Use JDBC3 getGeneratedKeys(): false
Jun 1, 2004 5:54:20 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Optimize cache for minimal puts: false
Jun 1, 2004 5:54:20 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Query language substitutions: {}
Jun 1, 2004 5:54:20 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: cache provider: net.sf.ehcache.hibernate.Provider
Jun 1, 2004 5:54:20 PM net.sf.hibernate.cfg.Configuration configureCaches
INFO: instantiating and configuring caches
Jun 1, 2004 5:54:20 PM net.sf.hibernate.impl.SessionFactoryImpl <init>
INFO: building session factory
net.sf.hibernate.MappingException: Dialect does not support identity key generation
at net.sf.hibernate.dialect.Dialect.getIdentitySelectString(Dialect.java:289)
at net.sf.hibernate.persister.AbstractEntityPersister.<init>(AbstractEntityPersister.java:632)
at net.sf.hibernate.persister.EntityPersister.<init>(EntityPersister.java:714)
at net.sf.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:42)
at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:137)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:768)
at Cinq.entrega.GenericPersistence.<init>(GenericPersistence.java:31)
at Cinq.entrega.CourierDatabase.getCourier(CourierDatabase.java:161)
at Cinq.entrega.AdminProtocolHandler.handleCreateCourierRequest(AdminProtocolHandler.java:853)
at Cinq.entrega.AdminProtocolHandler.doPost(AdminProtocolHandler.java:508)
at Cinq.entrega.DeliveryServlet.doPost(DeliveryServlet.java:133)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:793)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:702)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:571)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:644)
at java.lang.Thread.run(Unknown Source)
Jun 1, 2004 5:54:20 PM net.sf.hibernate.cfg.Configuration addClass
INFO: Mapping resource: Cinq/entrega/Courier.hbm.xml
Jun 1, 2004 5:54:21 PM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: Cinq.entrega.Courier -> TB_ENTREGADOR
Jun 1, 2004 5:54:21 PM net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing one-to-many association mappings
Jun 1, 2004 5:54:21 PM net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing one-to-one association property references
Jun 1, 2004 5:54:21 PM net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing foreign key constraints
Jun 1, 2004 5:54:22 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
WARNING: No dialect set - using GenericDialect: The dialect was not set. Set the property hibernate.dialect.
Jun 1, 2004 5:54:22 PM net.sf.hibernate.dialect.Dialect <init>
INFO: Using dialect: net.sf.hibernate.dialect.GenericDialect
Jun 1, 2004 5:54:22 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Use outer join fetching: false
Jun 1, 2004 5:54:22 PM net.sf.hibernate.connection.UserSuppliedConnectionProvider configure
WARNING: No connection properties specified - the user must supply JDBC connections
Jun 1, 2004 5:54:22 PM net.sf.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
INFO: No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
Jun 1, 2004 5:54:22 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Use scrollable result sets: false
Jun 1, 2004 5:54:22 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Use JDBC3 getGeneratedKeys(): false
Jun 1, 2004 5:54:22 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Optimize cache for minimal puts: false
Jun 1, 2004 5:54:22 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Query language substitutions: {}
Jun 1, 2004 5:54:22 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: cache provider: net.sf.ehcache.hibernate.Provider
Jun 1, 2004 5:54:22 PM net.sf.hibernate.cfg.Configuration configureCaches
INFO: instantiating and configuring caches
Jun 1, 2004 5:54:22 PM net.sf.hibernate.impl.SessionFactoryImpl <init>
INFO: building session factory
net.sf.hibernate.MappingException: Dialect does not support identity key generation
at net.sf.hibernate.dialect.Dialect.getIdentitySelectString(Dialect.java:289)
at net.sf.hibernate.persister.AbstractEntityPersister.<init>(AbstractEntityPersister.java:632)
at net.sf.hibernate.persister.EntityPersister.<init>(EntityPersister.java:714)
at net.sf.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:42)
at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:137)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:768)
at Cinq.entrega.GenericPersistence.<init>(GenericPersistence.java:31)
at Cinq.entrega.CourierDatabase.createCourier(CourierDatabase.java:98)
at Cinq.entrega.AdminProtocolHandler.handleCreateCourierRequest(AdminProtocolHandler.java:866)
at Cinq.entrega.AdminProtocolHandler.doPost(AdminProtocolHandler.java:508)
at Cinq.entrega.DeliveryServlet.doPost(DeliveryServlet.java:133)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:793)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:702)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:571)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:644)
at java.lang.Thread.run(Unknown Source)
MY Courier.hbm.xml
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping.dtd">
<hibernate-mapping>
<class name="Cinq.entrega.Courier" table="TB_ENTREGADOR">
<id name="ID" type="long" column="ENT_ID">
<generator class="identity"/>
</id>
<property name="username" column="ENT_NOME" type="string"/>
<property name="password" column="ENT_SENHA" type="string"/>
</class>
</hibernate-mapping>
Hibernate.cfg.xml
Code:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.datasource">jdbc:microsoft:sqlserver://192.168.227.201:1433;DatabaseName=ENTREGAEXPRESSA</property>
<property name="show_sql">false</property>
<property name="dialect">net.sf.hibernate.dialect.SQLServerDialect</property>
<mapping resource="Courier.hbm.xml"/>
</session-factory>
</hibernate-configuration>
server.xml
Code:
<-- I COPY ONLY THE PART THAT I INSERT IM SERVER.XML -->
<Context path="/Teste" reloadable="true" docBase="C:\tomcat\Midlet\Teste" workDir="C:\tomcat\Midlet\Teste\work" />
<Context path="/EntregaExpressa" reloadable="true" docBase="C:\tomcat\Servlet\EntregaExpressa" workDir="C:\tomcat\Servlet\EntregaExpressa\work" >
<Resource name="jdbc/quickstart" scope="Shareable" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/quickstart">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<!-- DBCP database connection settings -->
<parameter>
<name>url</name>
<value>jdbc:microsoft:sqlserver://192.168.227.201:1433;DatabaseName=ENTREGAEXPRESSA</value>
</parameter>
<parameter>
<name>driverClassName</name><value>com.microsoft.jdbc.sqlserver.SQLServerDriver</value>
</parameter>
<parameter>
<name>username</name>
<value>expressacinq</value>
</parameter>
<parameter>
<name>password</name>
<value>ecinq</value>
</parameter>
<!-- DBCP connection pooling options -->
<parameter>
<name>maxWait</name>
<value>3000</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>100</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>10</value>
</parameter>
</ResourceParams>
</Context>
</Host>
</Engine>
</Service>
</Server>
i try everything, but the application dont work!
thanks!