4

我对配备 jboss 开发工作室的 Eclipse IDE (Juno RE 2) 有疑问。我有一些使用 JPA 的 Maven 项目。在这些项目中,Eclipse 报告错误“此项目具有 JPA 方面,但无法创建 JPA 项目。有关详细信息,请参阅错误日志。”

当我在工作区的 .metadata 文件夹中看到 .log 文件时,我看到了这个异常:

java.lang.AbstractMethodError: org.jboss.tools.hibernate.jpt.core.internal.jpa2.HibernateJpa2_0PlatformFactory.buildJpaPlatform(Lorg/eclipse/jpt/jpa/core/JpaPlatform$Config;)Lorg/eclipse/jpt/jpa/core/JpaPlatform;
at org.eclipse.jpt.jpa.core.internal.platform.InternalJpaPlatformConfig.buildJpaPlatform(InternalJpaPlatformConfig.java:109)
at org.eclipse.jpt.jpa.core.internal.platform.InternalJpaPlatformConfig.getJpaPlatform(InternalJpaPlatformConfig.java:102)
at org.eclipse.jpt.jpa.core.internal.platform.InternalJpaPlatformManager.getJpaPlatform(InternalJpaPlatformManager.java:288)
at org.eclipse.jpt.jpa.core.internal.InternalJpaProjectManager.getJpaPlatform(InternalJpaProjectManager.java:666)
at org.eclipse.jpt.jpa.core.internal.InternalJpaProjectManager.buildJpaProjectConfig(InternalJpaProjectManager.java:653)
at org.eclipse.jpt.jpa.core.internal.InternalJpaProjectManager.buildJpaProject(InternalJpaProjectManager.java:623)
at org.eclipse.jpt.jpa.core.internal.InternalJpaProjectManager.addJpaProject(InternalJpaProjectManager.java:604)
at org.eclipse.jpt.jpa.core.internal.InternalJpaProjectManager.buildJpaProject_(InternalJpaProjectManager.java:303)
at org.eclipse.jpt.jpa.core.internal.InternalJpaProjectManager$BuildJpaProjectCommand.execute(InternalJpaProjectManager.java:297)
at org.eclipse.jpt.common.core.internal.utility.command.CommandJobCommandAdapter.execute(CommandJobCommandAdapter.java:50)
at org.eclipse.jpt.common.core.internal.utility.command.JobCommandJob.run(JobCommandJob.java:42)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

我真的找不到这个错误的原因。我也无法绕开它。任何形式的解释和/或帮助将不胜感激。

编辑:或者,当我告诉 maven 更新项目时,我得到

java.lang.NoClassDefFoundError: org/eclipse/jpt/jpa/core/JpaFacet
at org.jboss.tools.maven.jpa.configurators.JpaProjectConfigurator.canConfigure(JpaProjectConfigurator.java:171)
at org.jboss.tools.maven.jpa.configurators.JpaProjectConfigurator.configure(JpaProjectConfigurator.java:73)
at org.eclipse.m2e.core.project.configurator.AbstractLifecycleMapping.configure(AbstractLifecycleMapping.java:109)
at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration(ProjectConfigurationManager.java:413)
at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration(ProjectConfigurationManager.java:350)
at org.eclipse.m2e.core.ui.internal.UpdateMavenProjectJob.runInWorkspace(UpdateMavenProjectJob.java:74)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
4

1 回答 1

0

更新我的 Eclipse (Kepler) 后,我遇到了同样的问题。我通过删除项目属性中的 JPA Facet 来解决这个问题。不幸的是,这只是一个临时解决方案。在“Maven”>“更新项目...”之后,JPA 问题标记返回...

也许有人会想出一个更好、更持久的解决方案!

如何从项目属性中删除 JPA Facet

于 2013-10-30T09:24:33.150 回答