i think i fix a few the problem, but now i have another problem :
Code:
org.apache.jasper.JasperException: net/sf/cglib/core/KeyFactory
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:534)
root cause
If i see the trace:
Code:
04-may-2006 12:35:32 net.sf.hibernate.cfg.Environment <clinit>
INFO: Hibernate 2.1 final
04-may-2006 12:35:32 net.sf.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found
04-may-2006 12:35:32 net.sf.hibernate.cfg.Environment <clinit>
INFO: using CGLIB reflection optimizer
04-may-2006 12:35:32 net.sf.hibernate.cfg.Configuration configure
INFO: configuring from resource: /hibernate.cfg.xml
04-may-2006 12:35:32 net.sf.hibernate.cfg.Configuration getConfigurationInputStream
INFO: Configuration resource: /hibernate.cfg.xml
04-may-2006 12:35:32 net.sf.hibernate.cfg.Configuration addResource
INFO: Mapping resource: es/gato.hbm.xml
04-may-2006 12:35:32 net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: es.gato -> gato
04-may-2006 12:35:32 net.sf.hibernate.cfg.Configuration doConfigure
INFO: Configured SessionFactory: null
04-may-2006 12:35:32 net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing one-to-many association mappings
04-may-2006 12:35:32 net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing one-to-one association property references
04-may-2006 12:35:32 net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing foreign key constraints
04-may-2006 12:35:32 net.sf.hibernate.dialect.Dialect <init>
INFO: Using dialect: net.sf.hibernate.dialect.MySQLDialect
04-may-2006 12:35:32 net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Use outer join fetching: true
04-may-2006 12:35:32 net.sf.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Using Hibernate built-in connection pool (not for production use!)
04-may-2006 12:35:32 net.sf.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Hibernate connection pool size: 20
04-may-2006 12:35:32 net.sf.hibernate.connection.DriverManagerConnectionProvider configure
INFO: using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost/gato
04-may-2006 12:35:32 net.sf.hibernate.connection.DriverManagerConnectionProvider configure
INFO: connection properties: {user=root, password=root}
04-may-2006 12:35:32 net.sf.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
INFO: No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
04-may-2006 12:35:32 net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Use scrollable result sets: true
04-may-2006 12:35:32 net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC 2 max batch size: 15
04-may-2006 12:35:32 net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Query language substitutions: {}
04-may-2006 12:35:32 net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: cache provider: net.sf.ehcache.hibernate.Provider
04-may-2006 12:35:32 net.sf.hibernate.cfg.Configuration configureCaches
INFO: instantiating and configuring caches
I think that the problem is that the SessionFactory object cant be created correctly cause the hibernate config file make something wrong :(
The Jsp code:
Code:
net.sf.hibernate.SessionFactory sessionFactory;
net.sf.hibernate.Session s = null;
net.sf.hibernate.Transaction transaction = null;
Configuration configuration = new Configuration();
sessionFactory = configuration.configure().buildSessionFactory();
//------------
gato gato = new gato();
gato.setNombre("aaa");
try{
s = sessionFactory.openSession();
transaction = s.beginTransaction();
s.save(gato);
transaction.commit();
}catch(Exception error){
out.print(error.getMessage());
}finally{
s.close();
}
Thanks