Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/hibernate/5.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
Hibernate Java persistence.xml多重持久化单元“;找不到符号。。。进口;_Hibernate_Maven_Junit_Persistence.xml_Persistence Unit - Fatal编程技术网

Hibernate Java persistence.xml多重持久化单元“;找不到符号。。。进口;

Hibernate Java persistence.xml多重持久化单元“;找不到符号。。。进口;,hibernate,maven,junit,persistence.xml,persistence-unit,Hibernate,Maven,Junit,Persistence.xml,Persistence Unit,我的NetBeans Maven项目有问题。 如果我在相同的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-instan

我的NetBeans Maven项目有问题。 如果我在相同的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="com.xxx.plugin.connector_xxxAuthServices_war_firstPU" transaction-type="RESOURCE_LOCAL">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <class>com.xxx.plugin.entities.Businesspartner</class>
    <exclude-unlisted-classes>false</exclude-unlisted-classes>
    <shared-cache-mode>NONE</shared-cache-mode>
    <validation-mode>NONE</validation-mode>
    <properties>
      <property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/db_first?zeroDateTimeBehavior=convertToNull"/>
      <property name="javax.persistence.jdbc.password" value="xxx"/>
      <property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
      <property name="javax.persistence.jdbc.user" value="root"/>
    </properties>
  </persistence-unit>

  <!--  
  <persistence-unit name="com.xxx.plugin.connector_xxxAuthServices_war_secondPU" transaction-type="RESOURCE_LOCAL">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <class>com.xxx.plugin.entities.Businesspartner</class>
    <exclude-unlisted-classes>false</exclude-unlisted-classes>
    <shared-cache-mode>NONE</shared-cache-mode>
    <validation-mode>NONE</validation-mode>
    <properties>
      <property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/db_second?zeroDateTimeBehavior=convertToNull"/>
      <property name="javax.persistence.jdbc.password" value="xxx"/>
      <property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
      <property name="javax.persistence.jdbc.user" value="root"/>
    </properties>
  </persistence-unit>
  -->
</persistence>
MaterialsLoginRESTfulWSTest是jUnit测试,第9行是“import com.xxx.plugin.entities.Businesspartner”

我束手无策。 有没有人能帮我解决这个问题

最佳格里茨酒店
扎克

忘了发布我的修复/错误。 我的Maven-Rep上有一个旧的或不匹配的版本

问候扎克

------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 2.558s
Finished at: Wed Nov 14 10:26:32 CET 2012
Final Memory: 21M/56M
------------------------------------------------------------------------
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:testCompile (default-testCompile) on project xxxAuthServices: Compilation failure: Compilation failure:
D:\Users\me\Documents\xxx\code\trunk\xxxAuthServices\src\test\java\com\xxx\plugin\webservices\MaterialsLoginRESTfulWSTest.java:[8,35] error: cannot find symbol

could not parse error message:   symbol:   class Businesspartner
location: package com.xxx.plugin.entities