now I get
Quote:
java.lang.NoClassDefFoundError: org/hibernate/Session
at com.flextronics.fftester.Client.main(Client.java:103)
Caused by: java.lang.ClassNotFoundException: org.hibernate.Session
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 1 more
I know it's from hibernate3.jar file not in the classpath lib directory
but i have used :
Code:
java -cp hibernate3.jar -jar XXX.jar
(with jar file relatively)
Code:
java -cp C:\hibernate-3.2\lib -jar XXX.jar
(with pointing to hibernate installation folder directly)
Code:
java -cp lib -jar XXX.jar
(with all the hibernate library in a folder called "lib" relatively)
all failed, no matter I used JBoss way to get session :
Code:
SessionFactory sessionFac_report = (SessionFactory)ctx.lookup("java:/hibernate/XXXSessionFactory");
sesReporting = sessionFac_report.openSession();
or Hibernate way:
Code:
SessionFactory sessionFac_report = new Configuration().configure().buildSessionFactory();
sesReporting = sessionFac_report.openSession();