编译模块com.example.myPackage.GWT.HelloGWT 新编译单元的信息验证 信息忽略了一个单位与编译错误在第一次通过。 信息编译与-strict或-logLevel设置为跟踪或调试,以查看所有错误。 信息查找入口点类 'file:/home/ilsurih/Projects/maven%20hibernate/src/main/java/com/example/myPackage/GWT/client/HelloGWT.java‘中的信息错误 信息第31行:com.example.myPackage.HibernateUtil类型没有可用的源代码;您忘记继承所需的模块了吗? 无法找到'com.example.myPackage.GWT.client.HelloGWT‘类型的信息 信息提示:以前的编译器错误可能使此类型不可用。 信息提示:检查来自模块的继承链;它可能没有继承所需的模块,或者模块可能没有正确地添加源路径条目。 线程"UnitWriteThread“java.lang.IndexOutOfBoundsException中的错误异常 信息 信息构建失败 信息
这是HibernateUtil类:
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();
}
public static List getUsers(){
Session session = HibernateUtil.getSessionFactory().openSession();
return session.createCriteria(User.class).list();
}
}当我从getUsers()调用main方法时,它可以工作。一定是Maven出了问题。我试图删除所有Hibernate文件。当我运行mvn clean install时,它会编译工作的war归档文件。
发布于 2014-07-16 09:50:58
我认为包com.example.myPackage不是您的gwt客户端源路径的一部分。因此它不能在客户端使用。
https://stackoverflow.com/questions/24777495
复制相似问题