Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
[3.0.0] NoClassDefFoundError in AbstractJPAQuery static initializer (Hibernate stuff) #343
The static initializer is written as:
Class<?> clazz = Class.forName("com.mysema.query.jpa.impl.HibernateQueryTransformation");
I don't have Hibernate on the classpath, so HibernateQueryTransformation fails to initialize. Since HibernateQueryTransformation is itself present on the classpath but its dependencies aren't, it throws NoClassDefFoundError, which is not caught by the static initializer.
One way to fix this would be to create HibernateQueryTransformation statically (without reflection), but check for Hibernate dependencies via reflection inside the HibernateQueryTransformation constructor.