File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes How to change jetty binding port number in maven. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "How to change jetty binding port number in maven." Watch "How to change jetty binding port number in maven." New topic
Author

How to change jetty binding port number in maven.

sam White
Ranch Hand

Joined: Feb 18, 2011
Posts: 208
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
N Sahni
Ranch Hand

Joined: Jul 07, 2011
Posts: 55

Hi,

You can pass the port number through command parameters like:



Thanks and Regards,
Nilesh Sahni | nsahni@infocepts.com | www.infocepts.com
sam White
Ranch Hand

Joined: Feb 18, 2011
Posts: 208
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

Joined: Jul 07, 2011
Posts: 55

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

Joined: Feb 18, 2011
Posts: 208
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

Joined: Jul 07, 2011
Posts: 55

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

Joined: Feb 18, 2011
Posts: 208
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to change jetty binding port number in maven.
 
Similar Threads
Incorrect hibernate version or maven ignore and didn't download hibernate jar file.
Could not resolve dependencies
Where is my wsdl path?
Could not resolve dependencies for maven project
Missing CXF plugins??