[JBoss Eclipse IDE (users)] - Re: Cache-related error creating SessionFactory in Hibernate
by dserodio
"max.andersen(a)jboss.com" wrote : does it change anything if you restart eclipse ?
I restarted Eclipse, and it worked the first time I tried to open the SessionFactory. Then, I ran a HQL query, and it threw an error, complaining that the table didn't exist.
So I edited the hibernate.cfg.xml file, correcting the database URL, and next time I tried to open the SessionFactory, I got:
net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
| at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237)
| at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
| at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317)
| at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:121)
| at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43)
| at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162)
| 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:266)
| at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:422)
| 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:1218)
| at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:282)
| at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56)
| at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:85)
| at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:277)
| at org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:41)
| at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:88)
| at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:94)
| at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:207)
| at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
| Caused by: java.lang.reflect.InvocationTargetException
| at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
| at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
| at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384)
| at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219)
| ... 23 more
| Caused by: java.lang.NoClassDefFoundError: org/hibernate/proxy/HibernateProxy$$EnhancerByCGLIB$$a9ec73d2_2 : br/pucsp/apt/turgon/cheque/Cheque
| at java.lang.ClassLoader.defineClass(Ljava.lang.String;[BIILjava.security.ProtectionDomain;)Ljava.lang.Class;(Unknown Source)
| at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
| at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
| at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384)
| at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219)
| at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
| at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317)
| at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:121)
| at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43)
| at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162)
| 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:266)
| at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:422)
| 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:1218)
| at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:282)
| at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56)
| at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:85)
| at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:277)
| at org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:41)
| at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:88)
| at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:94)
| at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:207)
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3968169#3968169
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3968169
19 years, 8 months
[JBoss Seam] - Entity Scope question
by sjmenden
The seam docs are not completely clear on where an Entity lives when it exists in several scopes.
The following example:
| @Entity
| @Name("dog")
| @Scope(EVENT)
| @Role(name="currentDog", scope=SESSION)
| @Table(name="dogs")
| public class Dog implements Serializable {
| ....
|
So now, when exactly does my dog live in the EVENT scope and when does he live in the SESSION scope with the name currentDog.
Based on what I have observed so far, I would guess that the currentDog object gets put in the SESSION scope the first time I outject it, is that correct?
Also, if I outject the dog object
| @Out Dog dog.
|
Does this mean that the Dog object gets outjected to both EVENT(dog) and SESSION(currentDog)?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3968168#3968168
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3968168
19 years, 8 months