Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/apache-flex/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/design-patterns/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jpa 实体类的再创造_Jpa - Fatal编程技术网

Jpa 实体类的再创造

Jpa 实体类的再创造,jpa,Jpa,我尝试在netbeans 8.0.1上运行带有hibernate、spring和jpa的web应用程序,但现在我在编译应用程序时遇到了此异常……下面是错误: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default- compile) on project SMSXxxxx: Compilation failure: Compilation failure: er

我尝试在netbeans 8.0.1上运行带有hibernate、spring和jpa的web应用程序,但现在我在编译应用程序时遇到了此异常……下面是错误:

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-    compile) on project SMSXxxxx: Compilation failure: Compilation failure:
error: Problem with Filer: Attempt to recreate a file for type  com.equitel.smsmanager.entities.TextMessageContent_
error: Problem with Filer: Attempt to recreate a file for type com.smsmanager.entities.SmsUser_
这是持久性单元,我的项目中只有一个

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence"            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
 <persistence-unit name="SMSManagerPU" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/jboss/datasources/SMSManagerDS</jta-data-source>
<class>com.smsmanager.entities.Approval</class>
<class>com.smsmanager.entities.Changelog</class>
<class>com.smsmanager.entities.Contacts</class>
<class>com.smsmanager.entities.Dispatches</class>
<class>com.smsmanager.entities.MessageSchedule</class>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
  <property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/>
</properties>
</persistence-unit>
</persistence>

org.hibernate.ejb.HibernatePersistence
java:/jboss/datasources/smsmsmanagerds
com.smsmsmanager.entities.Approval
com.smsmsmanager.entities.Changelog
com.smsmsmanager.entities.Contacts
com.smsmsmanager.entities.Dispatches
com.smsmsmanager.entities.MessageSchedule
假的

我还没有修复此错误,您能帮我修复吗?

检查您的pom.xml文件
maven编译器插件是否已添加。如果没有,请添加插件,如下所示

<plugin>
<inherited>true</inherited>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>              
</plugin>

真的
org.apache.maven.plugins
maven编译器插件
您可以使用cmd提示符中的
mvn clean install-X
查找根本原因

pom.xml
文件中检查此处提到的java版本,并检查$java_HOME中提到的java版本 环境变量。两者应该是相同的

也检查一下这个

  • 可能是它的Java编译器问题
  • 下载jar时可能会出现问题

由于某些原因,在我的例子中,
pom.xml
中有一个依赖项导致了问题。查找并删除它:

    <dependency>
        <groupId>unknown.binary</groupId>
        <artifactId>hibernate-jpamodelgen-4.3.1.Final</artifactId>
        <version>SNAPSHOT</version>
        <scope>provided</scope>
    </dependency>

未知。二进制

您介意向我们展示pom.xml文件吗?它在eclipse中工作吗???