Announcement Announcement Module
Collapse
No announcement yet.
Spring-based Server Without Web or App Server Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring-based Server Without Web or App Server

    How common is the use of Spring for a J2EE server application that does not run within web or application server? In that scenario, what would the typical remoting choice be? Is it RMI so there isn't a servlet required?

    I guess one could embed a Jetty server within the application, but suppose you didn't want to do that, what would be the most preferred architecture?

    Most discussions and examples I see assume a web application.

    Thanks for any advice/opinion.....

  • #2
    How can you have a 'J2EE server application' not running in an 'application server'?! Well I guess you cannot...

    Comment


    • #3
      Is a server application that uses various J2EE APIs, but does not run under an app server, not a J2EE server application?

      We currently have a server application that uses Corba between client/server, and uses various API from J2EE portfolio, and I consider it a J2EE server application, despite the fact that it was not involve an application server.

      What I was attempting to clarify is whether this application would benefit from introducing Spring, but we have only thick client, won't have a web client, so in theory don't need any kind of http server, although we could introduce that.

      I wondered if there was a simple answer here, such as just migrate to Tomcat web server, or embed jetty, or do RMI, whatever......

      Comment


      • #4
        I worked in such an application some time ago, and the choice was RMI.
        The main reasons were that I wanted the performance and convenience of RMI and (at least at that time) some problems were reported serializing Hibernate generated objects with hessian and burlap.
        I have to say that the deployment was mostly local, so no 'port 80 only' restrictions applied.

        Federico.
        Last edited by fschroder; Nov 1st, 2006, 03:38 PM.

        Comment


        • #5
          I think the answer depends on what level of service your client requires.

          RMI is fine but I don't think a stand-alone RMI server doesn't do thread pooling. It creates a thread for each request. So a server may not perform well under load.

          The wonderful thing about a reasonably decoupled Spring-based application is you don't have to make these decisions up front. You can implement your service objects, unit/integration test them and start with a simple deployment (exposing your objects using RMI, using a RMI proxy on the client side) and then add additional capabilities (like JMX if you are using Java 5) and even change remoting technology without having to rewrite your business logic or client code. Just your Spring XML files.

          Comment


          • #6
            Originally posted by con19m31 View Post
            How common is the use of Spring for a J2EE server application that does not run within web or application server? In that scenario, what would the typical remoting choice be? Is it RMI so there isn't a servlet required?

            I guess one could embed a Jetty server within the application, but suppose you didn't want to do that, what would be the most preferred architecture?

            Most discussions and examples I see assume a web application.

            Thanks for any advice/opinion.....
            Interesting question. I'm struggling with the same at the moment.

            I've done a couple of things in the past:

            Run a customized and minimal JBoss with the Spring Deployer. This works pretty well actually. It gives you a really minimal container i which you can drop .spr archives. For example, I've done projects like that with Jetty embedded in the Spring app instead of the other way around.

            I've run Spring from a simple main() together with a wrapper script like you can find in Tomcat or Jetty to setup the classpath and execute a jar file. Works pretty well to run things standalone without the use of any server technology.

            For various reasons I'm now looking at something more dynamic. What I really want is a simple container that can bootstrap itself and then download applications or services in a more maven like way. Not sure how that would work but I think OSGi will be a nice base for this.

            S.

            Comment


            • #7
              Originally posted by con19m31 View Post
              Is a server application that uses various J2EE APIs, but does not run under an app server, not a J2EE server application?
              An application using J2EE apis doesn't have to be a server application, it can be a J2EE application. However I think it is just a matter of definition.

              If you don't have the need for a server you can run it from a standalone (long-living) Spring container. For communication you could use RMI or anyother protocol/standard of choice. You could even implement your own mechanism.

              Not sure what you need it for but you might even get away with synchronized JMS messages (hence you would need a JMS Broker).

              Comment

              Working...
              X