views:

126

answers:

5

Hi folks, I am currently developing an application for some researchers in my university.It's a small java program that you can use by command line. The next step is to package that program and deploy it to an application server. Some clients program will submit requests to the server who will call the tool that I wrote. Lately, we will add more tools to the server and he has to dispatch the requests to the right tool. Which application server fits my needs ? I have looked for Tomcat, Jetty and Glassfish but it seems that they are only used for web application. Is it possible to use those servers in some context different from web context? Which package archive should i use (jar, war) ? Any advice?

A: 

I don't see why you would want to use tomcat, glassfish or jetty for a command line program.

If it's command-line based, and you want it to run server-side, you could write a little program that allows users to, for instance, telnet to your server, which in turn starts the CLI-application in question, and relays input / output to the client.

You may also want to look into Java Webstart, which makes deployment of new versions a breeze.

aioobe
+2  A: 

Do you even need an application server? There's nothing stopping you from adding the necessary network bindings and deploying it on its own.

Of the servers you mention, you've got 2 different categories: servlet containers and full-stack Java EE servers

Tomcat and Jetty are servlet containers. That doesn't mean that you can only do web stuff with them and you could manually add the required libraries to get a full Java EE server.

Glassfish is a full-stack Java EE server and can be compared with JBoss (both are open source) or the commercial rivals Weblogic and Websphere.

Sometimes this question is simple as the environment you are working in mandates a particular flavour of app server. You should check this first.

If you're not forced to use an app server, I'd ask why you think you need to use an app server?

hbunny
A: 

You can check this http://stackoverflow.com/questions/2692701/choosing-an-application-server-for-web-application-development

Check the below link can find the answer for your questions.

harigm
+2  A: 

Some clients program will submit requests to the server who will call the tool that I wrote.

The big question is what server-side technology and what communication protocol can you use between the clients and the server. You basically have two major options: HTTP and web services (in that case, consider using either JAX-WS or JAX-RS) or RMI-IIOP and EJBs (in that case, you'll have to use a Java EE compliant server like GlassFish).

I have looked for Tomcat, Jetty and Glassfish but it seems that they are only used for web application.

Not really. As I said, they can also be used for web services oriented applications. And GlassFish can be used for EJBs applications.

Which package archive should i use (jar, war)

The packaging will depend on the type of application you'll write, it's not something that you choose upfront, it's just a consequence. EJBs are packaged in an EJB JAR and typically deployed inside an EAR; Servlet based web services are deployed inside a WAR.

You really need to think about what technology to use first (with the current level of detail, I can't provide more guidance).

Pascal Thivent
Hi, thanks for your answer. We maybe use REST or Web Services.
Dimitri
@Dimitri Then have a look at the JAX-WS or JAX-RS standards. GlassFish v3 provides implementations for both by default (that you can also deploy on servlet containers).
Pascal Thivent
@Pascal Thanks for your answer. We maybe will use GlassFish. Encore une fois merci !!
Dimitri
@Dimitri You're welcome and have fun with GlassFish
Pascal Thivent
A: 

Actually we can't answer with so few elements. - What are you planning to do - With what technologies - Where are you planning to host your application (have you got budget?) - In which language are written the clients (even the future ones)? - Could clients be on mobile phones (add some technlogy constraints...) ....

It would also be great to know what kind of request the clients will do, and what kind of response the server will provide...

Actually with what you tell us, all those application servers can do what you want...

I have looked for Tomcat, Jetty and Glassfish but it seems that they are only used for web application

You could even make a webapplication (servlet) and on the clientside use a httpclient to call that servlet... there are so many options :)

vive Paris!

Sebastien Lorber