Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7978421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:29:22+00:00 2026-06-04T09:29:22+00:00

I am using jetty maven plugin to deploy some wars. I have 2 modules:

  • 0

I am using jetty maven plugin to deploy some wars.
I have 2 modules:
moduleA.war at port 8180
moduleB.war at port 8380

When I deploy the war using the maven jetty plugin, both webapps are trying to run at port 8180 even though I am setting up connectors for both application. Here is my pom configuration for doing this:

<plugin>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>jetty-maven-plugin</artifactId>
            <version>7.1.3.v20100526</version>
            <configuration>
                <connectors>
                    <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
                        <port>8180</port>
                        <name>instance_8180</name>                      
                    </connector>
                    <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
                        <port>8380</port>
                        <name>instance_8380</name>
                    </connector>
                </connectors>                   
                <contextHandlers>
                    <!-- <contextHandler implementation="org.mortbay.jetty.plugin.JettyWebAppContext"> -->
                    <contextHandler implementation="org.eclipse.jetty.webapp.WebAppContext">
                        <war>/${project.build.directory}/user-mgmt-web-1.0-SNAPSHOT.war</war> 
                        <contextPath>/user-mgmt-web</contextPath>
                        <connectorNames>
                            <item>instance_8180</item>
                        </connectorNames>
                    </contextHandler>
                    <!-- <contextHandler implementation="org.mortbay.jetty.plugin.JettyWebAppContext"> -->
                    <contextHandler implementation="org.eclipse.jetty.webapp.WebAppContext">
                        <war>/${project.build.directory}/services-web-1.0-SNAPSHOT.war</war> 
                        <contextPath>/services-web</contextPath>
                        <connectorNames>
                            <item>instance_8380</item>
                        </connectorNames>
                    </contextHandler>
                </contextHandlers>
                <stopPort>80</stopPort>
                <stopKey>stop</stopKey>
            </configuration>
            <executions>
                <execution>
                    <id>start-container</id>
                    <phase>pre-integration-test</phase>
                    <goals>
                        <goal>stop</goal>
                        <goal>run</goal>
                    </goals>
                    <configuration>
                        <scanIntervalSeconds>0</scanIntervalSeconds>
                        <daemon>true</daemon>
                    </configuration>
                </execution>
                <execution>
                    <id>stop-container</id>
                    <phase>post-integration-test</phase>
                    <goals>
                        <goal>stop</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

I would like to know how to make the second webapp deployed start at its assigned port.
When I run it, when the container finishes initializing the second webapp, i get an address already in use error.

Assane

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T09:29:23+00:00Added an answer on June 4, 2026 at 9:29 am

    I think two different module with two different port works only in multiple instance,In your case only first port no is activated set idle timeout for first port.

    <port>8180</port>
    <maxIdleTime>"put your time"</maxIdleTime>
    

    Then start another port.

    If above not work try this one below

    In your jetty.xml add new connector

    <!-- original connector on port 8080 -->
    <Call name="addConnector">
      <Arg>
          <New class="org.eclipse.jetty.server.nio.SelectChannelConnector">
            <Set name="host"><Property name="jetty.host" /></Set>
            <Set name="port"><Property name="jetty.port" default="8080"/></Set>
            <Set name="maxIdleTime">300000</Set>
            <Set name="Acceptors">2</Set>
            <Set name="statsOn">false</Set>
            <Set name="confidentialPort">8443</Set>
        <Set name="lowResourcesConnections">20000</Set>
        <Set name="lowResourcesMaxIdleTime">5000</Set>
          </New>
      </Arg>
    </Call>
    
    <!-- new connector on port 8081 --> 
    <Call name="addConnector">
      <Arg>
          <New class="org.eclipse.jetty.server.nio.SelectChannelConnector">
            <Set name="host"><Property name="jetty.host" /></Set>
            <Set name="port"><Property name="jetty.port" default="8081"/></Set>
            <Set name="maxIdleTime">300000</Set>
            <Set name="Acceptors">2</Set>
            <Set name="statsOn">false</Set>
        <Set name="lowResourcesConnections">20000</Set>
        <Set name="lowResourcesMaxIdleTime">5000</Set>
          </New>
      </Arg>
    </Call>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been able to run some web services locally through Maven's jetty plugin
I'm using Jetty's plugin for Maven, version 7.0.0.pre5, but I have issues configuring it
Maven Jetty plugin is very nice (I'm using version 6.1.26). The only annoying thing
I am using Jetty and Selenium to automate some unit tests from my Maven
i have a java web app with maven. i'm using jetty to run it
I am using to use jersey-server 1.12 with jetty-maven-plugin 8.1.2.v20120308. If I am using
I have application launched using maven cargo plugin with jetty6x. I get HTTP/1.1 413
I'm using the maven-jetty-plugin to run a web application in development mode. Also, I
I'm using Maven 3.0.3 with the Jetty plugin. I'm getting the error below: java.io.FileNotFoundException:
We are using the maven Jetty plugin for development. i always used <jetty.version>7.2.2.v20101205</jetty.version> and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.