Eclipse 4.3 EE Facet JPA 2.0构建错误 [英] eclipse 4.3 EE facet jpa 2.0 build error

查看:264
本文介绍了Eclipse 4.3 EE Facet JPA 2.0构建错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试Eclipse Kepler 4.3 EE

I'm trying Eclipse Kepler 4.3 EE

在旧工作区中打开它之后,我的项目开始出现构建错误:

After open it over my old workspace, my project starts with an build error:

This project has the JPA facet, but no JPA project could be created. See the error log for more details.

这是详细信息:

eclipse.buildId=4.3.0.I20130605-2000
java.version=1.7.0_21
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=pt_BR
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -data D:\JJW\srcWeb -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product

Error
Mon Aug 19 14:46:53 BRT 2013
null JPA platform: P/jjwxp-web

java.lang.IllegalArgumentException
    at org.eclipse.jpt.jpa.core.internal.InternalJpaProjectManager.buildJpaProject(InternalJpaProjectManager.java:643)
    at org.eclipse.jpt.jpa.core.internal.InternalJpaProjectManager.buildJpaProject(InternalJpaProjectManager.java:635)
    at org.eclipse.jpt.jpa.core.internal.InternalJpaProjectManager.buildJpaProject(InternalJpaProjectManager.java:628)
    at org.eclipse.jpt.jpa.core.internal.InternalJpaProjectManager.addJpaProject(InternalJpaProjectManager.java:609)
    at org.eclipse.jpt.jpa.core.internal.InternalJpaProjectManager.buildJpaProject_(InternalJpaProjectManager.java:312)
    at org.eclipse.jpt.jpa.core.internal.InternalJpaProjectManager$BuildJpaProjectCommand.execute(InternalJpaProjectManager.java:306)
    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)

项目方面:JPA 2.0

Project facet: JPA 2.0

Persistence.xml

Persistence.xml

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
    xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">


    <persistence-unit name="jjwxp-web-unit"
        transaction-type="RESOURCE_LOCAL">

        <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>

        <class>br.com.jjw.jjwxp.web.model.Pais</class>
        <class>br.com.jjw.jjwxp.web.model.Estado</class>
        <class>br.com.jjw.jjwxp.web.model.Cidade</class>
        <class>br.com.jjw.jjwxp.web.model.Usuario</class>
        <class>br.com.jjw.jjwxp.web.model.Empresa</class>
        <class>br.com.jjw.jjwxp.web.model.Pessoa</class>
        <class>br.com.jjw.jjwxp.web.model.PessoaCliente</class>
        <class>br.com.jjw.jjwxp.web.model.PessoaRepresentante</class>
        <class>br.com.jjw.jjwxp.web.model.PessoaContato</class>
        <class>br.com.jjw.jjwxp.web.model.ListaPrecos</class>
        <class>br.com.jjw.jjwxp.web.model.ListaPrecosRepresentante</class>
        <class>br.com.jjw.jjwxp.web.model.ListaPrecosColuna</class>
        <class>br.com.jjw.jjwxp.web.model.ListaPrecosItem</class>
        <class>br.com.jjw.jjwxp.web.model.Produto</class>
        <class>br.com.jjw.jjwxp.web.model.ProdutoGrade</class>
        <class>br.com.jjw.jjwxp.web.model.ProdutoEstoque</class>
        <class>br.com.jjw.jjwxp.web.model.ProdutoCor</class>
        <class>br.com.jjw.jjwxp.web.model.FaixaTamanho</class>
        <class>br.com.jjw.jjwxp.web.model.GrupoProduto</class>
        <class>br.com.jjw.jjwxp.web.model.Tamanho</class>
        <class>br.com.jjw.jjwxp.web.model.Cor</class>
        <class>br.com.jjw.jjwxp.web.model.ProdutoImagem</class>
        <class>br.com.jjw.jjwxp.web.model.ProdutoCorImagem</class>
        <class>br.com.jjw.jjwxp.web.model.PVE</class>
        <class>br.com.jjw.jjwxp.web.model.PVEItem</class>
        <class>br.com.jjw.jjwxp.web.model.PVEItemGrade</class>
        <class>br.com.jjw.jjwxp.web.model.CondicaoPagamento</class>
        <class>br.com.jjw.jjwxp.web.model.ModalidadeVenda</class>
        <class>br.com.jjw.jjwxp.web.model.Moeda</class>
        <class>br.com.jjw.jjwxp.web.model.ClassificacaoFiscal</class>
        <class>br.com.jjw.jjwxp.web.model.ClassificacaoFiscalEmpresa</class>
        <class>br.com.jjw.jjwxp.web.model.RepresentanteProduto</class>
        <class>br.com.jjw.jjwxp.web.model.ModuloSistema</class>


        <shared-cache-mode>NONE</shared-cache-mode>

        <properties>
            <property name="eclipselink.ddl-generation" value="NONE" />
            <property name="eclipselink.weaving" value="dynamic" />

            <property name="eclipselink.logging.level" value="FINE" />
            <property name="eclipselink.logging.logger"
                value="org.eclipse.persistence.logging.CommonsLoggingSessionLog" />
        </properties>

    </persistence-unit>

</persistence>

有什么想法吗?

推荐答案

下载Eclipse Neon之后,我遇到了同样的问题。我通过以下方法解决了这个问题:

I just had the same exact issue after downloading Eclipse Neon. I solved the problem by:


  1. 右键单击该项目。然后选择属性以打开属性窗口。

  2. 选择JPA以查看JPA配置。在平台下,在我的案例Hibernate(JPA 2.1)中选择JPA平台。

  3. 在 JPA实现类型下,选择禁用库配置,原因是我在使用maven项目,声明为JPA依赖关系,因此该库将在类路径中可用。

  4. 在持久类管理下,请确保选择选项自动发现带注释的类。单击应用后,然后单击确定,它应该可以解决该错误。

  1. Right click on the project. Then select properties to open the properties window.
  2. Select JPA to see the JPA configuration. Under platform, select the JPA platform in my case Hibernate (JPA 2.1).
  3. Under JPA Implementation Type, select Disable Library Configuration cause in my case, I'm using a maven project where I declared the JPA dependencies, so the library will be available in the classpath.
  4. Under Peristent class management make sure you select the option discover annotated classes automatically. After click apply, then OK and it should resolve the error.

在Project Properties ---> Project Facets下,请确保您选择正确的Java版本和目标运行时(您的JDK),并取消选中实用程序模块复选框。

Also under Project Properties ---> Project Facets, make sure you select the proper Java version and target runtime (your JDK) and also deselect Utility Module check box if it is checked.

这篇关于Eclipse 4.3 EE Facet JPA 2.0构建错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆