Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
I have been cleaning my jar library for a project with hibernate entity manager.
I read I can replace cglib with javassist. So I delete all the jars for cglib.
Then, it didn't work.
So I browsed google and found the property hibernate.bytecode.provider.
I used it but it did not work.
It is trying to use cglib and I don't know how to tell it to use javassist.
Any help?
Hibernate version: 3.2
Mapping documents:
<?xml version="1.0" encoding="UTF-8"?>
<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/ ... ce_1_0.xsd"
version="1.0">
<persistence-unit name="paninfo">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>es.csa.ubu.paninfo.modelo._Auditoria</class>
<class>es.csa.ubu.paninfo.modelo._Auditoria_Estado</class>
<class>es.csa.ubu.paninfo.modelo._IdRecursoBanner</class>
<class>es.csa.ubu.paninfo.modelo._IdRecursoNoticia</class>
<class>es.csa.ubu.paninfo.modelo.CategoriaEntity</class>
<class>es.csa.ubu.paninfo.modelo.CentroEntity</class>
<class>es.csa.ubu.paninfo.modelo.UnidadEntity</class>
<class>es.csa.ubu.paninfo.modelo.BannerEntity</class>
<class>es.csa.ubu.paninfo.modelo.MeteorologiaEntity</class>
<class>es.csa.ubu.paninfo.modelo.FuenteEntity</class>
<class>es.csa.ubu.paninfo.modelo.NoticiaEntity</class>
<class>es.csa.ubu.paninfo.modelo.ParametroEntity</class>
<class>es.csa.ubu.paninfo.modelo.RecursoBannerEntity</class>
<class>es.csa.ubu.paninfo.modelo.RecursoNoticiaEntity</class>
<class>es.csa.ubu.paninfo.modelo.UsuarioEntity</class>
<class>es.csa.ubu.paninfo.modelo.RecursoEntity</class>
<class>es.csa.ubu.paninfo.modelo.ContenidoEntity</class>
<class>es.csa.ubu.paninfo.modelo.TemaEntity</class>
<properties>
<property
name="hibernate.connection.datasource"
value="java:comp/env/jdbc/paninfoDB" />
<property
name="hibernate.dialect"
value="org.hibernate.dialect.MySQL5InnoDBDialect" />
<property
name="hibernate.hbm2ddl.auto"
value="validate" />
<property
name="hibernate.default_catalog"
value="paninfo" />
<property
name="hibernate.ejb.autodetection"
value="class" />
<property
name="hibernate.bytecode.provider"
value="javassist" />
</properties>
</persistence-unit>
</persistence>
Full stack trace of any exception that occurs:
java.lang.NoClassDefFoundError: net/sf/cglib/proxy/CallbackFilter
at org.hibernate.bytecode.cglib.BytecodeProviderImpl.getProxyFactoryFactory(BytecodeProviderImpl.java:33)
at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactoryInternal(PojoEntityTuplizer.java:182)
at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:160)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:135)
at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55)
at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:56)
at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:295)
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:434)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:915)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:726)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:121)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:33)
at es.csa.ubu.paninfo.negocio.EntityManager.getEmf(EntityManager.java:533)
at es.csa.ubu.paninfo.negocio.EntityManager.getBanners(EntityManager.java:485)
at es.csa.ubu.paninfo.services.BannerServlet.doGet(BannerServlet.java:54)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)