Deploy java web service without using web server

前端 未结 9 1170
情话喂你
情话喂你 2020-12-02 23:53

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 ac

相关标签:
9条回答
  • 2020-12-03 00:19

    You mention Tomcat as an example of what you don't want to do, but Tomcat can be run in embedded mode, where it gets started up from inside your application:

    http://tomcat.apache.org/tomcat-5.5-doc/catalina/docs/api/org/apache/catalina/startup/Embedded.html

    Saying that, I'd recommend Jetty, it's more light-weight than Tomcat.

    0 讨论(0)
  • 2020-12-03 00:21

    Take a look at Apache CXF. It can use jetty for stand-alone web-services. It integrates with Spring which makes it easy to add a web-service simply as spring-bean with very little additional code.

    0 讨论(0)
  • 2020-12-03 00:23

    same question with Lightweight Webservice producing in Java (without an application server)

    javax.xml.ws.Endpoint.publish("http://localhost:8000/myService/", myServiceImplementation);
    
    0 讨论(0)
  • 2020-12-03 00:26

    You will need something listening for a http connection. Fortunately Java 6 has all you need in the default runtime.

    Have a look at:

    http://hofmanndavid.blogspot.com/2008/11/easiest-way-to-publish-java-web.html

    0 讨论(0)
  • 2020-12-03 00:28

    I've been following this pretty basic tutorial, and it does just what you want

    http://java.sun.com/developer/technicalArticles/J2SE/jax_ws_2/

    It seems like the Java SE 6 platform has a small web application server that will publish the web service while the JVM is running.

    0 讨论(0)
  • 2020-12-03 00:30

    A perfect solution is here from IBM

    https://www.ibm.com/developerworks/webservices/tutorials/ws-jse/

    0 讨论(0)
提交回复
热议问题