eclipse 4.3 EE facet jpa 2.0构建错误

时间:2013-08-19 18:10:00

标签: eclipse jpa-2.0 eclipselink eclipse-kepler

我正在尝试Eclipse Kepler 4.3 EE

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

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

的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>

有关正在发生的事情的任何想法?

2 个答案:

答案 0 :(得分:0)

如果重命名了项目,则重命名后会发生错误 (或在另一个文件夹下载svn)..

原因在这个日食中解释Eclipse BUG 414688(OPEN) https://bugs.eclipse.org/bugs/show_bug.cgi?id=414688

问题的真正根源在于BUG 414795(已修复) https://bugs.eclipse.org/bugs/show_bug.cgi?id=414795

自第二个Bug于2013年12月修复,并于2014年1月验证, 我想Eclipse的下一个版本将解决这个错误。

答案 1 :(得分:0)

我在下载Eclipse Neon后遇到了同样的问题。我解决了这个问题:

  1. 右键单击该项目。然后选择属性以打开属性窗口。
  2. 选择JPA以查看JPA配置。在平台下,选择我的案例Hibernate(JPA 2.1)中的JPA平台。
  3. 在JPA实施类型下,选择禁用库配置原因在我的情况下,我使用maven项目,我声明了JPA依赖项,因此库将在类路径中可用。
  4. 在Peristent类管理下,请确保选择自动发现带注释的类选项。单击“应用”后,单击“确定”,它将解决错误。
  5. 同样在项目属性下---&gt; Project Facets,确保选择正确的Java版本和目标运行时(JDK),如果选中,则取消选中Utility Module复选框。