views:

32

answers:

0

Ok, back for another complicated question, I'm afraid. Please be patient: this is a lot of new stuff for me.

Back in the dark ages, we were running a Frankenstein of an application on WebLogic. When we decided to move things to GlassFish v3, we all agreed that the time was nigh to do things the "right" way, from an EE 6 perspective.

To that end, we now have a single EAR file (MyEAR.ear), which contains a single WAR (MyApp.ear) and a single EJB jar file (MyEJBs.jar), as well as a bunch of supporting jars. Everything works beautifully as far as the web application goes.

However, we used to have something we called (erroneously) "scripts". These were actually Application classes, embedded in the WAR. We'd copy the WAR file to a new file with the name Framework.jar and then execute that jar from the command-line with the java command, specifying which main class we wanted to run.

As I'm sure you'll agree, this is complex, error-prone, and unbearably ugly.

So what's the CORRECT way to do this?

Well, one thing we've been looking at is the Application Client. Basically, we want to make a tiny application that we can run manually on our servers that will operate in an EE environment and have access to our data and logic in our WAR.

But that's where I get stumped. Documentation on this seems either non-existent or tailored to another purpose: namely making a client application to run on a user's desktop. We don't want this to run on another machine from the EAR and WAR: we want to run this on the SAME machine, only we want to be able to start and stop it from the command line.

How do I do this, or is there a better way to do this?

Also, assuming a Client Application is the way to go, how on Earth do I build and deploy this thing with MyEclipse? MyEclipse lets you build a Client Application, but then it won't let you add it to an existing EAR. I've managed to hack a solution by modifying the various settings files, but that's so unorthodox that I'm worried it's fragile and will break.

Thanks again, Jeff G.