On my local server, I'm able to make my api calls to my server and I can see that the values are being saved into the database. But when going live and using the actual domain address, I'm getting the error below:
java.lang.NoClassDefFoundError: Could not initialize class d.d.util.HibernateUtil
My HibernateUtil.java is:
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
public class HibernateUtil {
private static final SessionFactory sessionFactory = buildSessionFactory();
private static SessionFactory buildSessionFactory() {
try {
// Create the SessionFactory from hibernate.cfg.xml
return new Configuration().configure().buildSessionFactory();
}
catch (Throwable ex) {
// Make sure you log the exception, as it might be swallowed
System.err.println("Initial SessionFactory creation failed." + ex);
throw new ExceptionInInitializerError(ex);
}
}
public static SessionFactory getSessionFactory() {
return sessionFactory;
}
public static void shutdown() {
// Close caches and connection pools
getSessionFactory().close();
}
}
Logs from Amazon are showing me something else:
Exception occurred during processing request: uid is required
java.lang.Exception: uid is required
at d.d.Pamper.action.GetUserProfileAction.execute(GetUserProfileAction.java:16) ~[classes/:?]
This is my own exception that I'm throwing if the UID comes in null.