在Payara 5中部署包含ejb-module

时间:2019-02-11 07:15:35

标签: java java-ee deployment ejb payara

我正尝试部署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>

1 个答案:

答案 0 :(得分:0)

问题出在domain.xml中。我只是从payara 4.1 config文件夹复制它,这是一个错误的决定。正确的方法是:获取原始文件并不断对其进行更改。不幸的是,EJB还有另一个问题,但是上述所有错误都消失了。