-1

I've generated two instances of Spring Boot (1.5.10.RELEASE) (war) with different properties (DB), My question is about to run those two instances with same port but with different context in WebSphere Liberty Core 8.5 ?

My server.xml :

<httpEndpoint id="defaultHttpEndpoint"
                  host="*"
                  httpPort="9081"
                  httpsPort="9443"/>

<!-- A application -->
 <webApplication id="A"  location="A-0.0.1-SNAPSHOT.war"  contextRoot="/interactioncorpcontext-a"/>

<!-- B application -->
<webApplication id = "B" location="B-0.0.1-SNAPSHOT.war"  contextRoot="/interactioncorpcontext-b"/>

As result :

**http://hostname:9081/interactioncorpcontext-a**

**http://hostname:9081/interactioncorpcontext-b**
Mirlo
  • 625
  • 9
  • 26

1 Answers1

0

I found a solution is to create an EAR of two war modules :

<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <artifactId>ear</artifactId>
    <packaging>ear</packaging>
    <name>${project.artifactId}</name>
    <version>0.0.1-SNAPSHOT</version>

        <parent>
        <groupId>a.b.c</groupId>
        <artifactId>AP00959-starter-parent</artifactId>
        <version>1.5.10-SNAPSHOT</version>
    </parent>

    <dependencies>
<!--        Project dependencies -->
        <dependency>
            <groupId>a.b.c</groupId>
            <artifactId>CCS</artifactId>
            <version>0.0.1-SNAPSHOT</version>
              <type>war</type>
        </dependency>

                <dependency>
            <groupId>a.b.c</groupId>
            <artifactId>mael</artifactId>
            <version>0.0.1-SNAPSHOT</version>
              <type>war</type>
        </dependency>

    </dependencies>



        <build>
        <plugins>


  <plugin>
        <artifactId>maven-ear-plugin</artifactId>
        <version>2.10.1</version>
        <configuration>
                <modules>
                        <webModule>
                                <groupId>a.b.c</groupId>
                                <artifactId>CCS1FRD0</artifactId>
                                <contextRoot>/interactioncorpcontext-ccs</contextRoot>
                        </webModule>
                        <webModule>
                                <groupId>a.b.c</groupId>
                                <artifactId>mael</artifactId>
                                <contextRoot>/interactioncorpcontext-mael</contextRoot>
                        </webModule>
                </modules>
        </configuration>
      </plugin>

        </plugins>
    </build>





</project>

Also to disable jmx endpoints :

endpoints:
   jmx:
     enabled: false
Mirlo
  • 625
  • 9
  • 26