• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

How to change jetty binding port number in maven.

 
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have built a web service application based on CXF2 and Spring 3.0.5, Jetty plugin.
During the deployment process, JBOSS AS7 (WEB) thrown the following exception:



I tried to setup jetty plugin in my pom.xml file to bind to port 8080, but I couldn't find the right way to do that.

Here is my pom.xml file:



web.xml:



I have searched google for the whole day but still unable to find the correct answer to resolve my question. I believe this is something to do with the xml configuraiton code in my pom.xml or web.xml.

Any suggestion and example would be very appreciated.

Thanks
Sam
 
Ranch Hand
Posts: 55
Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

You can pass the port number through command parameters like:

 
sam White
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

N Sahni wrote:Hi,

You can pass the port number through command parameters like:



Thank you for the suggestion. with the following command:



I got this error

 
N Sahni
Ranch Hand
Posts: 55
Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ohh!! my mistake i published incorrect command. jetty.port is passed to JVM as system parameters. Below is the correct command.
 
sam White
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks again for the prompt response, your command works, but it got a problem finding the correct path to web.xml file.

Here is the error:




Command:


mvn -Djetty.port=8080 jetty:run clean install


Thanks
Sam
 
N Sahni
Ranch Hand
Posts: 55
Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

This is a configuration issue.
At line 200 in your pom.xml you need to specify correct path of your web.xml
 
sam White
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am still getting the error:

Caused by: javax.xml.ws.WebServiceException: org.apache.cxf.interceptor.Fault: Could not start Jetty server on port 80: Cannot assign requested address: bind

Would the command "-Djetty.port=8080 jetty:run" change the jetty start up port number when the WAR file deployed to JBOSS AS7 server?

My development machine has no any application server running.
I only want to package it into a war file and scp into my remote server, and then deploy it in the JBOSS AS7.

How can I tell maven to setup jetty bind to port 8080 instead 80?

Thanks
Sam
 
Yes, my master! Here is the tiny ad you asked for:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!