Announcement Announcement Module
Collapse
No announcement yet.
How to make spring service available through REST and RMI Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to make spring service available through REST and RMI

    We have a few spring services that should be available through REST (for external client programs) and RMI (for internal client programs). What is the standard way to do this with spring. Can we achieve this with Apache Virgo, dm server or tc server?

  • #2
    For RMI just use Spring Remoting for RMI
    For REST there are serveral ways. Spring MVC with propper annotations, Spring Data REST, Jersey...
    Has nothing to do with your servlet container, pure tomcat or jetty are doing the job too.

    Comment


    • #3
      Thanks for you swift reply! We are already using Spring MVC for the REST communication under tomcat. For RMI we already use spring remoting, but we need to start a separate process for the RMI server, to listen on the RMI port (1099). We do that by running the following main method, which was inspired by http://snehaprashant.blogspot.nl/2009/05/rmi-using-spring.html :
      Code:
      public static void main(String[] args) {
              new ClassPathXmlApplicationContext("classpath:/META-INF/application-context.xml");
          }
      What we are looking for is a single application that handles both the REST part and the RMI part. Can we do this with one of the aforementioned servers (eclipse Virgo, dm server or tc server)?

      Comment


      • #4
        As mentioned before by spgmx it doesn't matter which server your on... Simply expose your services by using the RMI remoting support, not sure why you want to start that in a seperate instance it will work in every environment (btw eclipse virgo is dm server the latter isn't supported anymore).

        Comment


        • #5
          Very useful answer once more! As a reaction to it we now included the RMI configuration in the application-context of the war we already used for the REST communication, and indeed the RMI and REST work OK when we deploy this archive to tomcat. The reason why we are stressing the virgo/tc server deployment is that it would be great if we could deploy the RMI and REST 'handler' as separate OSGI bundles to this type of server. This link already seems to suggest that RMI doesn't combine well with OSGI: http://stackoverflow.com/questions/1...osgi-container, but we want to be sure that this type of solution is 'impossible'.

          Comment

          Working...
          X