Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploy java web service without using web server

It is possible to deploy my own created web service to any of PC without installing any web server app eg:tomcat? I want make it like agent/plug-in in any PC. In order to access the web services i only need to access http://:8080/web_service. Any suggestion about this?

like image 452
winsontan520 Avatar asked Aug 18 '09 06:08

winsontan520


People also ask

Can application server work without web server?

An application server can (but doesn't always) run on a web server to execute program logic, the results of which can then be delivered by the web server.

Can I run Java without Tomcat?

Java SE – A platform for applications that don't use a web container, or use one other than Tomcat, such as Jetty or GlassFish. You can include any library Java Archives (JARs) used by your application in the source bundle that you deploy to Elastic Beanstalk.

Can spring boot run without server?

However, Spring Boot has a number of uses that do not require a web server: console applications, job scheduling, batch or stream processing, serverless applications, and more. In this tutorial, we'll look at several different ways to use Spring Boot without a web server.


2 Answers

Even lighter than running Jetty you can use the HttpServer built into Java.

http://java.sun.com/javase/6/docs/jre/api/net/httpserver/spec/com/sun/net/httpserver/package-summary.html

You'll need to write your own code for parsing request data but it's certainly doable.

http://blogs.operationaldynamics.com/andrew/software/free-java/sun-secret-webserver.html

like image 143
pjp Avatar answered Oct 17 '22 06:10

pjp


Take a look at Jetty, a very light servlet container

like image 34
Ben Avatar answered Oct 17 '22 05:10

Ben