Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/374.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
Java 尝试从weblogic控制台部署时,没有名为的EntityManager的持久性提供程序_Java_Jpa_Weblogic12c_Persistence.xml_Persistence Provider - Fatal编程技术网

Java 尝试从weblogic控制台部署时,没有名为的EntityManager的持久性提供程序

Java 尝试从weblogic控制台部署时,没有名为的EntityManager的持久性提供程序,java,jpa,weblogic12c,persistence.xml,persistence-provider,Java,Jpa,Weblogic12c,Persistence.xml,Persistence Provider,我为这个错误挣扎了几天 当我尝试从ide(IntellijEclipse)部署时,它工作正常 但是当我尝试从WebLogic控制台部署时,我得到了这些错误 Error Unable to access the selected application. Error Unable to invoke Annotation processoror. Error Unable to invoke Annotation processoror. 有关更多信息,我检查了堆栈跟踪中的日志和错误。 看起来

我为这个错误挣扎了几天

当我尝试从ide(IntellijEclipse)部署时,它工作正常

但是当我尝试从WebLogic控制台部署时,我得到了这些错误

Error Unable to access the selected application. 
Error Unable to invoke Annotation processoror.
Error Unable to invoke Annotation processoror.
有关更多信息,我检查了堆栈跟踪中的日志和错误。 看起来主要错误是:javax.persistence.PersistenceException:没有名为的EntityManager的持久性提供程序

在调试中,从该代码中抛出<代码>Persistence.createEntityManagerFactory(“persistenceUnitName”)

持久性类来自
javaee-web-abi-7.0.jar

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="persistanceUnitName"
        transaction-type="JTA">
        <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
        <jta-data-source>dataSource</jta-data-source>
        <exclude-unlisted-classes>false</exclude-unlisted-classes>
        <properties>
            <property name="eclipselink.target-database" value="Oracle" />
            <property name="eclipselink.logging.parameters" value="true" />
            <property name="eclipselink.logging.logger" value="DefaultLogger" />
            <property name="eclipselink.logging.level" value="WARNING" />
            <property name="eclipselink.refresh" value="true" />
            <property name="eclipselink.query-results-cache" value="false" />
            <!-- <property name="eclipselink.ddl-generation" value="create-or-extend-tables" />-->
        </properties>
    </persistence-unit>
</persistence>

org.eclipse.persistence.jpa.PersistenceProvider
数据源
假的
persistence.xml位于/WEB-INF/classes/META-INF中

我们有这样一个案例:我们有一个测试和准备环境。在测试中,它起作用,在prep中不起作用,在local中不起作用(从WebLogic控制台)。很遗憾,我看不到测试服务器配置。但是我希望prep也有同样的选择。不管怎样,忘记其他环境,首先我需要从本地成功部署


你能帮帮我吗,我真的不知道我错过了什么。阅读每个主题,尝试所有内容

看起来像是类路径问题。检查weblogic类路径。 如果您使用的是eclipselink库,则在部署时必须首先加载该库

检查

将eclipselink添加到提供范围的项目中:

然后,将下面的内容添加到weblogic.xml中,以使用eclipselink库

<wls:container-descriptor>
    <wls:prefer-application-packages>
        <wls:package-name>org.eclipse.persistence.*</wls:package-name>
    </wls:prefer-application-packages>
</wls:container-descriptor>

org.eclipse.persistence*

看起来与相同,你能在那里检查答案吗?是的,我几乎检查了所有地方:)属于提供商的行存在。org.eclipse.persistence.jpa.PersistenceProvider-我不使用hibernate。
$WEBLOGIC_HOME/user_projects/domains/base_domain/lib
<wls:container-descriptor>
    <wls:prefer-application-packages>
        <wls:package-name>org.eclipse.persistence.*</wls:package-name>
    </wls:prefer-application-packages>
</wls:container-descriptor>