Hibernate where to put classfiles?
Posted: 05 Oct 2010, 11:38
Hi
I'm trying to get hibernate + jpa to work with smartfox.
However I'm running into a problem because I allways get the exception pasted below.
I guess the exception gets thrown because hibernate is unable to find the classes.
I have the classes in the javaExtensions folder and also tried to copy them into the Server folder since thats where the persistence.xml needed to be.
But nothing helped so far.
I saw that several people are using smartfox + hibernate so I must be missing something obvious here.
Thx in advance
INFO | jvm 1 | 2010/10/05 14:08:17 | 14:08:17.484 - [ WARNING ] > Unexpected Exception: javax.persistence.PersistenceException: [PersistenceUnit: examplePersistenceUnit] class or package not found
INFO | jvm 1 | 2010/10/05 14:08:17 | 05.10.2010 14:08:17 it.gotoandplay.smartfoxserver.controllers.SystemHandler processEvent
INFO | jvm 1 | 2010/10/05 14:08:17 | WARNUNG: Unexpected Exception: javax.persistence.PersistenceException: [PersistenceUnit: examplePersistenceUnit] class or package not found
INFO | jvm 1 | 2010/10/05 14:08:17 | javax.persistence.PersistenceException: [PersistenceUnit: examplePersistenceUnit] class or package not found
INFO | jvm 1 | 2010/10/05 14:08:17 | at org.hibernate.ejb.Ejb3Configuration.addNamedAnnotatedClasses(Ejb3Configuration.java:1093)
INFO | jvm 1 | 2010/10/05 14:08:17 | at org.hibernate.ejb.Ejb3Configuration.addClassesToSessionFactory(Ejb3Configuration.java:871)
INFO | jvm 1 | 2010/10/05 14:08:17 | at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:758)
INFO | jvm 1 | 2010/10/05 14:08:17 | at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:191)
INFO | jvm 1 | 2010/10/05 14:08:17 | at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:253)
INFO | jvm 1 | 2010/10/05 14:08:17 | at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:125)
INFO | jvm 1 | 2010/10/05 14:08:17 | at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52)
INFO | jvm 1 | 2010/10/05 14:08:17 | at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:34)
INFO | jvm 1 | 2010/10/05 14:08:17 | at globals.Database.getEntityManager(Database.java:15)
INFO | jvm 1 | 2010/10/05 14:08:17 | at secureLogin.SecureLogin.handleInternalEvent(SecureLogin.java:144)
INFO | jvm 1 | 2010/10/05 14:08:17 | at it.gotoandplay.smartfoxserver.controllers.MessageHandler.dispatchEvent(MessageHandler.java:147)
INFO | jvm 1 | 2010/10/05 14:08:17 | at it.gotoandplay.smartfoxserver.controllers.SystemHandler.handleLoginRequest(SystemHandler.java:482)
INFO | jvm 1 | 2010/10/05 14:08:17 | at it.gotoandplay.smartfoxserver.controllers.SystemHandler.processEvent(SystemHandler.java:221)
INFO | jvm 1 | 2010/10/05 14:08:17 | at it.gotoandplay.smartfoxserver.controllers.SystemHandler.run(SystemHandler.java:146)
INFO | jvm 1 | 2010/10/05 14:08:17 | at java.lang.Thread.run(Thread.java:619)
INFO | jvm 1 | 2010/10/05 14:08:17 | Caused by: java.lang.ClassNotFoundException: javaExtensions.Persistance.AvatarData
INFO | jvm 1 | 2010/10/05 14:08:17 | at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
INFO | jvm 1 | 2010/10/05 14:08:17 | at java.security.AccessController.doPrivileged(Native Method)
INFO | jvm 1 | 2010/10/05 14:08:17 | at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
INFO | jvm 1 | 2010/10/05 14:08:17 | at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
INFO | jvm 1 | 2010/10/05 14:08:17 | at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
INFO | jvm 1 | 2010/10/05 14:08:17 | at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
INFO | jvm 1 | 2010/10/05 14:08:17 | at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
INFO | jvm 1 | 2010/10/05 14:08:17 | at java.lang.Class.forName0(Native Method)
INFO | jvm 1 | 2010/10/05 14:08:17 | at java.lang.Class.forName(Class.java:247)
INFO | jvm 1 | 2010/10/05 14:08:17 | at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:135)
INFO | jvm 1 | 2010/10/05 14:08:17 | at org.hibernate.ejb.Ejb3Configuration.classForName(Ejb3Configuration.java:1009)
INFO | jvm 1 | 2010/10/05 14:08:17 | at org.hibernate.ejb.Ejb3Configuration.addNamedAnnotatedClasses(Ejb3Configuration.java:1081)
INFO | jvm 1 | 2010/10/05 14:08:17 | ... 14 more
I'm trying to get hibernate + jpa to work with smartfox.
However I'm running into a problem because I allways get the exception pasted below.
I guess the exception gets thrown because hibernate is unable to find the classes.
I have the classes in the javaExtensions folder and also tried to copy them into the Server folder since thats where the persistence.xml needed to be.
But nothing helped so far.
I saw that several people are using smartfox + hibernate so I must be missing something obvious here.
Thx in advance
INFO | jvm 1 | 2010/10/05 14:08:17 | 14:08:17.484 - [ WARNING ] > Unexpected Exception: javax.persistence.PersistenceException: [PersistenceUnit: examplePersistenceUnit] class or package not found
INFO | jvm 1 | 2010/10/05 14:08:17 | 05.10.2010 14:08:17 it.gotoandplay.smartfoxserver.controllers.SystemHandler processEvent
INFO | jvm 1 | 2010/10/05 14:08:17 | WARNUNG: Unexpected Exception: javax.persistence.PersistenceException: [PersistenceUnit: examplePersistenceUnit] class or package not found
INFO | jvm 1 | 2010/10/05 14:08:17 | javax.persistence.PersistenceException: [PersistenceUnit: examplePersistenceUnit] class or package not found
INFO | jvm 1 | 2010/10/05 14:08:17 | at org.hibernate.ejb.Ejb3Configuration.addNamedAnnotatedClasses(Ejb3Configuration.java:1093)
INFO | jvm 1 | 2010/10/05 14:08:17 | at org.hibernate.ejb.Ejb3Configuration.addClassesToSessionFactory(Ejb3Configuration.java:871)
INFO | jvm 1 | 2010/10/05 14:08:17 | at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:758)
INFO | jvm 1 | 2010/10/05 14:08:17 | at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:191)
INFO | jvm 1 | 2010/10/05 14:08:17 | at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:253)
INFO | jvm 1 | 2010/10/05 14:08:17 | at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:125)
INFO | jvm 1 | 2010/10/05 14:08:17 | at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52)
INFO | jvm 1 | 2010/10/05 14:08:17 | at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:34)
INFO | jvm 1 | 2010/10/05 14:08:17 | at globals.Database.getEntityManager(Database.java:15)
INFO | jvm 1 | 2010/10/05 14:08:17 | at secureLogin.SecureLogin.handleInternalEvent(SecureLogin.java:144)
INFO | jvm 1 | 2010/10/05 14:08:17 | at it.gotoandplay.smartfoxserver.controllers.MessageHandler.dispatchEvent(MessageHandler.java:147)
INFO | jvm 1 | 2010/10/05 14:08:17 | at it.gotoandplay.smartfoxserver.controllers.SystemHandler.handleLoginRequest(SystemHandler.java:482)
INFO | jvm 1 | 2010/10/05 14:08:17 | at it.gotoandplay.smartfoxserver.controllers.SystemHandler.processEvent(SystemHandler.java:221)
INFO | jvm 1 | 2010/10/05 14:08:17 | at it.gotoandplay.smartfoxserver.controllers.SystemHandler.run(SystemHandler.java:146)
INFO | jvm 1 | 2010/10/05 14:08:17 | at java.lang.Thread.run(Thread.java:619)
INFO | jvm 1 | 2010/10/05 14:08:17 | Caused by: java.lang.ClassNotFoundException: javaExtensions.Persistance.AvatarData
INFO | jvm 1 | 2010/10/05 14:08:17 | at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
INFO | jvm 1 | 2010/10/05 14:08:17 | at java.security.AccessController.doPrivileged(Native Method)
INFO | jvm 1 | 2010/10/05 14:08:17 | at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
INFO | jvm 1 | 2010/10/05 14:08:17 | at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
INFO | jvm 1 | 2010/10/05 14:08:17 | at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
INFO | jvm 1 | 2010/10/05 14:08:17 | at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
INFO | jvm 1 | 2010/10/05 14:08:17 | at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
INFO | jvm 1 | 2010/10/05 14:08:17 | at java.lang.Class.forName0(Native Method)
INFO | jvm 1 | 2010/10/05 14:08:17 | at java.lang.Class.forName(Class.java:247)
INFO | jvm 1 | 2010/10/05 14:08:17 | at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:135)
INFO | jvm 1 | 2010/10/05 14:08:17 | at org.hibernate.ejb.Ejb3Configuration.classForName(Ejb3Configuration.java:1009)
INFO | jvm 1 | 2010/10/05 14:08:17 | at org.hibernate.ejb.Ejb3Configuration.addNamedAnnotatedClasses(Ejb3Configuration.java:1081)
INFO | jvm 1 | 2010/10/05 14:08:17 | ... 14 more