Hello, i´m traying to make a servlet aplication with hibernate 3 for tomcat 5.5. When deploy the aplication in tomcat all be fine, but when i tray to create a sessionfactory ( sessionFactory = configuration.buildSessionFactory()) I get an error.
This is my code:
Mapping documents:
<hibernate-mapping package="Servidor"> <class name="Tareas" table="tareas" catalog="servidor"> <composite-id name="id" class="TareasId"> <key-property name="idCliente" type="java.lang.Short"> <column name="Id_cliente" /> </key-property> <key-property name="idEnvio" type="java.lang.Short"> <column name="Id_envio" /> </key-property> </composite-id> <many-to-one name="envios" class="Envios" update="false" insert="false" fetch="select"> <column name="Id_envio" not-null="true" /> </many-to-one> <many-to-one name="clientes" class="Clientes" update="false" insert="false" fetch="select"> <column name="Id_cliente" not-null="true" /> </many-to-one> </class> </hibernate-mapping>
hibernate.cfg.xml:
<hibernate-configuration>
<session-factory> <property name="connection.username">root</property> <property name="connection.url">jdbc:mysql://localhost:3306/servidor</property> <property name="dialect">org.hibernate.dialect.MySQLDialect</property> <property name="myeclipse.connection.profile">com.mysql.jdbc.Driver</property> <property name="connection.password">admin</property> <property name="connection.driver_class">com.mysql.jdbc.Driver</property> <mapping resource="Servidor/Clientes.hbm.xml"></mapping> <mapping resource="Servidor/Contenidos.hbm.xml" /> <mapping resource="Servidor/Envios.hbm.xml" /> <mapping resource="Servidor/Tareas.hbm.xml" /> <mapping resource="Servidor/Usuarios.hbm.xml" /> </session-factory>
</hibernate-configuration>
When i execute sessionFactory = configuration.buildSessionFactory();
I get this error:
Full stack trace of any exception that occurs:
00:56,656 ERROR BasicLazyInitializer:103 - CGLIB Enhancement failed: Servidor.Tareas net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:236) at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:373) at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:281) at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:640) at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:94) at org.hibernate.proxy.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:42) at org.hibernate.tuple.PojoTuplizer.buildProxyFactory(PojoTuplizer.java:144) at org.hibernate.tuple.AbstractTuplizer.<init>(AbstractTuplizer.java:83) at org.hibernate.tuple.PojoTuplizer.<init>(PojoTuplizer.java:54) at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:47) at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:218) at org.hibernate.persister.entity.BasicEntityPersister.<init>(BasicEntityPersister.java:400) at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:104) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:211) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005) at Servidor.HibernateSessionFactory.<clinit>(HibernateSessionFactory.java:31) at Servidor.BaseHibernateDAO.getSession(BaseHibernateDAO.java:13) at Servidor.UsuariosDAO.findByExample(UsuariosDAO.java:65) at Servidor.Login.doGet(Login.java:40) at javax.servlet.http.HttpServlet.service(HttpServlet.java:690) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:373) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:218) ... 35 more Caused by: java.lang.SecurityException: class "Servidor.Tareas$$EnhancerByCGLIB$$a556f282"'s signer information does not match signer information of other classes in the same package at java.lang.ClassLoader.checkCerts(ClassLoader.java:775) at java.lang.ClassLoader.preDefineClass(ClassLoader.java:487) at java.lang.ClassLoader.defineClass(ClassLoader.java:614) ... 41 more
The aplication run well but this error appear when i create a org.hibernate.SessionFactory.
any idea, thanks
|