![](/img/trans.png)
[英]deploying ejb-module for ObjectDB fails: PersistenceProvider not found
[英]Trouble with deploying ear-file in Payara 5, that contains ejb-module
我正在嘗試在Payara 5.184中依賴地部署包含ejb模塊的ear文件並出現錯誤:
11.02.2019 13:57:15.938 | [payara-executor-service-scheduled-task] | ERROR | Exception while deploying the app [my-ear-SNAPSHOT]
11.02.2019 13:57:15.945 | [payara-executor-service-scheduled-task] | ERROR | Exception during lifecycle processing
java.lang.IllegalArgumentException: Invalid ejb jar [lib/my-ejb.jar]: it contains zero ejb.
Note:
1. A valid ejb jar requires at least one session, entity (1.x/2.x style),
or message-driven bean.
2. EJB3+ entity beans (@Entity) are POJOs and please package them as library jar.
3. If the jar file contains valid EJBs which are annotated with EJB component
level annotations (@Stateless, @Stateful, @MessageDriven, @Singleton),
please check server.log to see whether the annotations were processed properly.
使用payara 4.1,不會發生此錯誤。 我該怎么做才能解決部署錯誤?
我的pom文件有簡短版本:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>my</groupId>
<artifactId>my-ears</artifactId>
<version>SNAPSHOT</version>
</parent>
<artifactId>my-ear</artifactId>
<packaging>ear</packaging>
<dependencies>
<dependency>
<groupId>my</groupId>
<artifactId>my-ejb</artifactId>
<version>${project.version}</version>
<type>ejb</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<version>6</version>
<generateApplicationXml>true</generateApplicationXml>
<skinnyWars>true</skinnyWars>
<defaultJavaBundleDir>lib/</defaultJavaBundleDir>
<defaultLibBundleDir>lib</defaultLibBundleDir>
<filtering>true</filtering>
<modules>
<ejbModule>
<groupId>my</groupId>
<artifactId>my-ejb</artifactId>
<bundleDir>/lib</bundleDir>
</ejbModule>
</modules>
</configuration>
</plugin>
</plugins>
</build>
</project>
問題出在domain.xml中。 我只是從payara 4.1 config文件夾復制它,這是一個錯誤的決定。 正確的方法是:獲取原始文件並不斷對其進行更改。 不幸的是,EJB還有另一個問題,但是上述所有錯誤都消失了。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.