views:

1043

answers:

6

I am fairly comfortable with standalone Java app development, but will soon be working on a project using a J2EE application server.

Does anyone know of a straightforward how-to tutorial to getting a hello-world type application working in an application server? I'm (perhaps naievly) assuming that the overall approach is similar between different frameworks, so I'm more interested in finding out the approach rather than getting bogged down in differences between the different frameworks.

If you are not aware of a good guide, then could you post bullet-point type steps to getting a hello-world running?, i.e.

  1. Download XX
  2. Write some code to do YY
  3. Change file ZZ
  4. Other steps...

Note: Just because I have a windows machine at home, I would prefer to run if this could be run on windows, but in the interest of a better answer, linux/mac based implementations are welcome.

+5  A: 

The JavaEE (they dropped the 2) space is pretty big. A good tutorial to start is the one from Sun. For a simple hello world application, the web container only would suffice. A well known servlet jsp container is tomcat. See here for installation instructions. Try installing it with eclipse and create a web project. This will generate some files for you that you can look at and edit. Also starting and stopping the application server is simpler.

JeroenWyseur
+5  A: 

I would choose JBoss or Glassfish for a start. However I'm not sure what you mean by J2EE "Hello World". If you just want to deploy some JSP you could use this tutorial (for JBoss):

http://www.centerkey.com/jboss/

If you want to get further and do the EJB stack and/or deploy an ear-file, you could read the very good JBoss documentation:

Installation Guide

Getting started

Configuration Guide

In general you could also just do the basic installation and change or try the pre-installed example applications.

I currently have JBoss installed (on windows). I develop with Eclipse and use the J2EE server integration to hot deploy or debug my code. After you get your first code running you realy should have a look at the ide integration since it makes development/deploy roundtrips so much faster.

Martin
Hi Martin, By 'Hello-World' I mean a minimal amount of code that can be run on the app server in order to understand the basics of setting up and running an app server.
Lehane
A: 

As JeroenWyseur puts it, J2EE is a fairly big space. In addition to what he said, you should try to get more details of what exactly you'll be doing: servelts & co, EJB (entity, session, message beans?) and try to get familiar with that.

It should be clear for you that your code runs in a managed environment, which imposes a lot of constraints. in order to make sure you understand what happens you should get familiar with the concept of deployment. Then, if you do EJBs, transaction management is important too. If you don't understand exactly what happens when a bean or a servlet is deployed, how transactions are managed, how beans are invoked, you're going to have a hard time.

A book that helped me a lot back in the time is Mastering EJB, by Ed Roman.

Also, getting familiar with RMI will help you understand EJBs.

entzik
A: 

If you haven't gone near NetBeans in a while its catching up with Eclipse very fast and worth a look, especially when starting JEE.

Version 6.x installs Tomcat and/or Glassfish for you and then provides wizards to create/deploy/redeploy applications.

The initial tutorial on Web Applications is here and a more complex example here.

Garth Gilmour
+2  A: 
tardate