Hello,
I have a web service that works perfectly fine when I deploy it on Mac Os X and Windows XP. Now I'm deploying it on a virtual machine with Ubuntu and I get this exception when I try to use it:
Code:
java.lang.ExceptionInInitializerError
at ve.usb.HibernateUtil.<clinit>(HibernateUtil.java:28)
at ve.usb.TestHelper.<init>(TestHelper.java:21)
at ve.usb.USB_RegCivil.USB_RegCivil_consulta(USB_RegCivil.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
TestHelper at line 21
Code:
this.session = HibernateUtil.getSessionFactory().getCurrentSession();
USB_RegCivil at line 28
Code:
TestHelper helper = new TestHelper();
HibernateUtil
Code:
package ve.usb;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.SessionFactory;
/**
* Hibernate Utility class with a convenient method to get Session Factory object.
*
* @author rafa
*/
public class HibernateUtil {
private static final SessionFactory sessionFactory;
static {
try {
// Create the SessionFactory from standard (hibernate.cfg.xml)
// config file.
sessionFactory = new AnnotationConfiguration().configure().buildSessionFactory();
} catch (Throwable ex) {
// Log the exception.
System.err.println("Initial SessionFactory creation failed." + ex);
throw new ExceptionInInitializerError(ex);
}
}
I also found this:
Code:
Caused by: java.lang.NoClassDefFoundError
at ve.usb.TestHelper.<init>(TestHelper.java:21)
at ve.usb.USB_RegCivil.USB_RegCivil_consulta(USB_RegCivil.java:28)
I also tried with a simple web service (with no hibernate nor connection to a db) and it worked fine.
It is only the web service with hibernate that doesn't work on my Ubuntu installation.
Any of you have any idea of what may be happening?
Im using Glassfish, and I'm using a SUN JVM.
Thank you very much guys.