在Payara 5中部署包含ejb-module的ear-file时出现问题
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在Payara 5中部署包含ejb-module的ear-file时出现问题相关的知识,希望对你有一定的参考价值。
我正在尝试部署ear文件,它包含Payara 5.184中依赖项中的ejb模块并收到错误:
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配置文件夹中复制它,这是错误的决定。正确的方法是:获取原始文件并不断对其进行更改。不幸的是,EJB还有一个问题,但上面描述的所有错误都消失了。
以上是关于在Payara 5中部署包含ejb-module的ear-file时出现问题的主要内容,如果未能解决你的问题,请参考以下文章
org.jboss.weld.exceptions.DefinitionException:在payara / glassfish中部署时的WELD-001113
Tyrus 端点阻止 Glassfish (Payara) 中的线程
Payara中的Apache Camel:'java:/ TransactionManager'查找失败