NoClassDefFoundError 无法初始化类 EMFService
我在我的 eclipse 中导入了一个应用程序引擎项目。它在我以前的笔记本电脑上运行良好,在这里我从我的旧机器复制了 eclipse 目录并将项目导入其中。现在我看到错误“java.lang.NoClassDefFoundError:无法初始化类 sharepro.java.dao.EMFService”。错误位于“EntityManager em = EMFService.get().createEntityManager();”行。我已经添加了所有罐子。关于我丢失的 jar 或任何配置问题的任何指针?
感谢和问候 桑迪
I have imported a an app engine project in my eclipse.It was running fine on my previous laptop, here i have copied the eclipse directory from my old machine and imported the project in it. Now I am seeing an error "java.lang.NoClassDefFoundError: Could not initialize class sharepro.java.dao.EMFService" . The error is in line "EntityManager em = EMFService.get().createEntityManager();". I have all the jars added. any pointer on whcih jar I am mising or any conf issue??
Thanks and Regards
Sundi
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我意识到这是一篇旧帖子,但我刚刚遇到了这个问题,今天(2013 年 6 月)我花了几个小时才解决这个问题。我仍然不确定为什么我的解决方案有效(或者更确切地说,为什么我的情况导致了错误),但这就是我修复它的方法:
我的项目结构中有一个带有 /test 的源文件夹 文件夹,其中有一些 JUnit 的东西。我删除了该文件夹,现在一切正常。诡异的。
我看到人们针对此问题提出的其他建议包括:
I realize this is an old post, but I just had this exact problem, and it took me a couple of hours to figure this out today (June 2013). I'm still not sure why my solution worked out (or rather, why my situation was causing the error), but this is what I did to fix it:
I had a source folder in my project structure with a /test folder, where I had some JUnit stuff. I deleted that folder, and now everything works. Weird.
Other things that I saw people suggest for this problem include the following:
(我知道这是一篇旧帖子,但以防万一其他人需要帮助)
您的错误很可能在您的 JDO 中,我只是遇到了这个问题,我没有正确注释 JDO,并且我得到了与您相同的错误
(I know this is an old post but in case anyone else needs help)
Your error is more than likely in your JDO, I just had this problem, I didn't annotate a JDO properly and I got the same error as you did
这是因为增强器无法正确增强您的实体。你应该增强实体。
This is because enhancer does not properly enhance your entities. You should enhance entities.