-
1. Re: jBoss and Hibernate
wolfgangknauf Jul 2, 2009 9:05 AM (in response to marcelk1607)Hi!
Where do you see the exception? In your EJB or in the client side? Please provide more details about your app.
JBoss uses Hibernate internally to perform all EJB3 database access. Does your app contain hibernate JARs?
Best regards
Wolfgang -
2. Re: jBoss and Hibernate
marcelk1607 Jul 2, 2009 9:19 AM (in response to marcelk1607)Exception in thread "main" java.lang.reflect.UndeclaredThrowableException at $Proxy2.findMedewerker(Unknown Source) at nl.capgemini.inzetmanagement.client.Client.main(Client.java:27) Caused by: java.lang.ClassNotFoundException: org.hibernate.hql.ast.QuerySyntaxException at org.jboss.remoting.serialization.ClassLoaderUtility.loadClass(ClassLoaderUtility.java:103) at org.jboss.remoting.loading.RemotingClassLoader.loadClass(RemotingClassLoader.java:86) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at java.lang.Class.forName0(Native Method)
This happens when i use this code:@Override public Medewerker findMedewerker(int id) { Query createQuery = entityManager.createQuery("SELECT m FROM medewerker m"); Collection<Medewerker> result = createQuery.getResultList(); System.out.println(result); return null; }
Ths is what I put in my remote bean.
So do I have something missing in my libs? Do i need hibernate in the libs dir? -
3. Re: jBoss and Hibernate
marcelk1607 Jul 2, 2009 9:20 AM (in response to marcelk1607)Also I am running the client app in Eclipse, maybe I need hibernate there?
I am confused sorry. -
4. Re: jBoss and Hibernate
peterj Jul 2, 2009 2:55 PM (in response to marcelk1607)Which version of JBoss AS are you using? I found the QuerySyntaxException
in common/lib/hibernate-core.jar, so it should be available.
Could you post your JAR or EAR file that contains the EJB? Use: "jar -tf xxx.jar" where xxx.jar is the name of your JAR (or EAR) file.
Also, is the code that you posted from and EJB3 session bean? If so, where are the entity beans located relative to the session bean? The stack trace suggests that you are attempting to access the entity beans remotely... -
5. Re: jBoss and Hibernate
marcelk1607 Jul 2, 2009 2:59 PM (in response to marcelk1607)Sorry, already solved it, i didnt have the right jars.
Thanks anyway!