1

我正在使用 jenkins 来持续集成 maven 构建。我收到以下错误

部署期间发生错误:部署应用程序时出现异常 [项目名称]:无法解析引用远程 ejb-ref name=com.test/testclass,Remote 3.x interface =com.interfaces.ITestService,ejb-link=null,lookup=, mappedName=,jndi-name=,refType=Session 因为应用程序中有 2 个 ejb,接口为 com.test.interfaces.ITestService。一些可能的原因:
1. EJB bean 类被打包在一个ear lib 库中(或通过任何其他使库对所有组件模块可见的库机制),这使得所有组件模块都间接包含这个bean 类。
2. EJB bean 类被封装在一个组件模块中,该组件模块直接或间接通过 Manifest、WEB-INF/lib 引用 EJB。EJB bean 类应该只打包在声明的 ejb 模块中,而不是引用模块中。引用模块 .... msg.seeServerLog

以下是我的父母 pom 和 web pom

  <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>
  <groupId>test</groupId>
  <artifactId>Project-ParentPOM</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>pom</packaging>
  <name>Project-ParentPOM</name>

  <modules>
      <module>../Project-test1</module>
      <module>../Project-test2</module>
      <module>../Project-Web</module>
      <module>../Project-Service</module>
  </modules>  

</project>

这是网络 pom.xml

<?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>
    <groupId></groupId>
    <artifactId>Test-Web</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>war</packaging>
    <name>Test-Web</name>

    <properties>
        <struts2.version>2.3.14</struts2.version>
    </properties>

    <dependencies>

        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-tiles-plugin</artifactId>
            <version>2.3.8</version>
        </dependency>

        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-core</artifactId>
            <version>${struts2.version}</version>
        </dependency>

        <dependency>
            <groupId>org.javassist</groupId>
            <artifactId>javassist</artifactId>
            <version>3.15.0-GA</version>
        </dependency>

        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-config-browser-plugin</artifactId>
            <version>${struts2.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-junit-plugin</artifactId>
            <version>${struts2.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-cdi-plugin</artifactId>
            <version>${struts2.version}</version>
        </dependency>

        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.1.1</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.5</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.0.1</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
            <version>1</version>
        </dependency>

        <dependency>
            <groupId>test</groupId>
            <artifactId>Test-Common</artifactId>
            <version>0.0.1-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>test</groupId>
            <artifactId>Test-Service</artifactId>
            <version>1.0-SNAPSHOT</version>
            <type>ejb</type>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.persistence</groupId>
            <artifactId>persistence-api</artifactId>
            <version>1.0</version>
            <scope>provided</scope>
        </dependency>


        <!-- <dependency> <groupId>test</groupId> <artifactId>Test-Service-Bkp</artifactId> 
            <version>1.0-SNAPSHOT</version> <type>ejb</type> </dependency> -->


        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.6</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.5.1</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

任何帮助表示赞赏

4

0 回答 0