2

I have a war file with embedded jetty server. I want to deploy it online. What should I do first? I tried it to run in IDE it works well but I am confused on how to deploy it online? I don't want to start server everytime I tried to run my app like what IDE does. For instance, I want to type "http://119.81.44.73/myapp" then my homepage will show up. Can I ask some help to guide how to do this. or Is there any configuration needed to deploy it online?

2
  • What do you mean to deploy it online? Make it permanently available? Aug 25, 2013 at 12:33
  • Yes, permanently available.. thanks
    – Lazy Coder
    Aug 25, 2013 at 12:40

2 Answers 2

5

A WAR file is meant to be deployed into a stand alone application server like Tomcat or Jetty. The embedded Jetty is vice versa. You have a standalone Java application and inside your application you start a Jetty server running in the same process. With that configuration you can enhance your application with a web interface or you can even deploy other web applications (WARs) into your embedded Jetty.

So it makes no sense to build a WAR with an embedded Jetty included. If you embed Jetty then your application should be a normal JAR with a main class. If you are able to start your application via a IDE then the next step would be to build a JAR and try to start it via the command line. Create a batch file or shell script for that purpose. All the Jetty JARs should be in the classpath.

If this all works on your local machine you can copy all the necessary files (application JAR, Jetty JARs and your start script) to your server.

0
0

You probably need to either:

  1. Hire a hosting service,
  2. Install jetty as a *nix daemon / Windows service, or
  3. Install other application server as a *nix daemon / Windows service.

and deploy your war according to usual procedure in each case.

2
  • The reason why I used jetty is that it can be embed in your app unlike Tomcat or other web server you have install it first. Correct me if I am wrong.
    – Lazy Coder
    Aug 25, 2013 at 12:48
  • I want to upload the war file with embedded jetty server and access it like normal website developed using PHP. Is this possible?
    – Lazy Coder
    Aug 25, 2013 at 12:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.