在以下期间发生内部错误:" JPA Facet文件更改事件处理程序"

时间:2013-07-17 15:10:34

标签: java persistence jpa-2.0 java-ee-6

我是JPA 2.0的新手。我正在使用eclipse juno创建一个JPA项目(eclipseLink 2.0.2)。

创建JPA项目时,我收到错误

  

在以下期间发生内部错误:" JPA Facet文件更改事件   处理程序"

在检查日志时我得到了这个:

  

java.lang.NoClassDefFoundError:   org / eclipse / persistence / jpa / jpql / AbstractJPQLQueryHelper at   java.lang.ClassLoader.defineClass1(Native Method)at   java.lang.ClassLoader.defineClass(ClassLoader.java:791)at   org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:188)     在   org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClassHoldingLock(ClasspathManager.java:632)     在   org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:607)     在   org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:568)     在   org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:492)     在   org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:465)     在   org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)     在   org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:395)     在   org.eclipse.osgi.internal.loader.SingleSourcePackage.loadClass(SingleSourcePackage.java:35)     在   org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:461)     在   org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)     在   org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)     在   org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)     在java.lang.ClassLoader.loadClass(ClassLoader.java:356)at   org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence.EclipseLink2_0PersistenceXmlContextNodeFactory.buildPersistenceUnit(EclipseLink2_0PersistenceXmlContextNodeFactory.java:33)     在   org.eclipse.jpt.jpa.core.internal.jpa1.context.persistence.GenericPersistence.buildPersistenceUnit(GenericPersistence.java:179)     在   org.eclipse.jpt.jpa.core.internal.jpa1.context.persistence.GenericPersistence.initializePersistenceUnits(GenericPersistence.java:137)     在   org.eclipse.jpt.jpa.core.internal.jpa1.context.persistence.GenericPersistence。(GenericPersistence.java:55)     在   org.eclipse.jpt.jpa.core.internal.context.persistence.AbstractPersistenceXmlContextNodeFactory.buildPersistence(AbstractPersistenceXmlContextNodeFactory.java:41)     在   org.eclipse.jpt.jpa.core.internal.jpa1.context.persistence.GenericPersistenceXml.buildPersistence(GenericPersistenceXml.java:163)     在   org.eclipse.jpt.jpa.core.internal.jpa1.context.persistence.GenericPersistenceXml。(GenericPersistenceXml.java:68)     在   org.eclipse.jpt.jpa.core.internal.AbstractJpaFactory.buildPersistenceXml(AbstractJpaFactory.java:202)     在   org.eclipse.jpt.jpa.core.internal.jpa1.context.GenericRootContextNode.buildPersistenceXml(GenericRootContextNode.java:157)     在   org.eclipse.jpt.jpa.core.internal.jpa1.context.GenericRootContextNode.buildPersistenceXml(GenericRootContextNode.java:95)     在   org.eclipse.jpt.jpa.core.internal.jpa1.context.GenericRootContextNode。(GenericRootContextNode.java:62)     在   org.eclipse.jpt.jpa.core.internal.AbstractJpaFactory.buildRootContextNode(AbstractJpaFactory.java:195)     在   org.eclipse.jpt.jpa.core.internal.AbstractJpaProject.buildRootContextNode(AbstractJpaProject.java:276)     在   org.eclipse.jpt.jpa.core.internal.AbstractJpaProject。(AbstractJpaProject.java:251)     在   org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaProjectImpl。(EclipseLinkJpaProjectImpl.java:26)     在   org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaFactory.buildJpaProject(EclipseLinkJpaFactory.java:62)     在   org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLink2_0JpaFactory.buildJpaProject(EclipseLink2_0JpaFactory.java:84)     在   org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLink2_0JpaFactory.buildJpaProject(EclipseLink2_0JpaFactory.java:1)     在   org.eclipse.jpt.jpa.core.internal.InternalJpaProjectManager.buildJpaProject(InternalJpaProjectManager.java:616)     在   org.eclipse.jpt.jpa.core.internal.InternalJpaProjectManager.buildJpaProject(InternalJpaProjectManager.java:608)     在   org.eclipse.jpt.jpa.core.internal.InternalJpaProjectManager.buildJpaProject(InternalJpaProjectManager.java:601)     在   org.eclipse.jpt.jpa.core.internal.InternalJpaProjectManager.addJpaProject(InternalJpaProjectManager.java:582)     在   org.eclipse.jpt.jpa.core.internal.InternalJpaProjectManager.checkForJpaFacetTransition_(InternalJpaProjectManager.java:760)     在   org.eclipse.jpt.jpa.core.internal.InternalJpaProjectManager $ FacetFileChangeEventHandlerCommand.execute(InternalJpaProjectManager.java:750)     在   org.eclipse.jpt.common.core.internal.utility.command.CommandJobCommandAdapter.execute(CommandJobCommandAdapter.java:39)     在   org.eclipse.jpt.common.core.internal.utility.command.JobCommandJob.run(JobCommandJob.java:42)     在org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)引起的   by:java.lang.ClassNotFoundException:   org.eclipse.persistence.jpa.jpql.AbstractJPQLQueryHelper at   org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)     在   org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)     在   org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)     在   org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)     在java.lang.ClassLoader.loadClass(ClassLoader.java:356)... 43更多

我找不到这个错误和日志引用的内容。任何帮助都会很棒,因为我现在正在努力。

先谢谢。

2 个答案:

答案 0 :(得分:1)

我遇到了同样的问题。

基于这个关于Eclipse的错误报告 - NoClassDefFoundError with JPA projects 我不得不卸载Hibernate Tools插件来修复错误。

看起来基础Eclipse没有问题,但是如果你已经安装了JBoss Tools插件,它们会提供一个不兼容的JPA类版本,这会导致问题。

答案 1 :(得分:0)

我也面临同样的问题

错误是:

  

在以下期间发生内部错误:" JPA Facet文件更改事件   处理程序"

要解决:

我们需要卸载hibernate工具 我们的Eclipse没有任何问题,但我们动态安装的工具有问题,所以更好的是删除这些工具。