3rd party update is at risk Apple Mac Video Music
Apr 30

I had a look at jBoss and wanted to validate its capabilities from a PaaS perspective.

First I prefer to have a kind of factory which includes the minimum software and tools to start. This does not include you JDK that should already be installed. This factory will include Eclipse (I use version Europa Winter (Java EE) 3.2 that you can download here) , maven2 (2.0.8 downloadable here) and jBoss (4.2.2 downloadable here ). I also create a folder in this factory for the eclipse workspace.

Install factory

I suggest to backup it, to reuse a copy of it for each project. Create a folder named factory. Download Eclipse, maven 2 and jboss. Then create a folder for eclipse workspace. You should have something like:

Here are some files (eclipse, vars) to put in the folder factory that will setup environment variables.
Add also a shortcut that will launch a command prompt and use the environement variables setup in vars.bat. Here his the value of the shortcut:

C:\WINDOWS\system32\cmd.exe /k “”vars.bat”"

(you should change only the windows folder according to your machine installation).
Now, update the vars.bat file for the line pointing to your JDK, the other lines should not be changed.

Done, yoiur factory is ready. Next step is to create and build your project.

Project and build creation

Create a folder named as you want (I will use C:\PaaS. Then copy the factory folder there (the factory folder is a sub folder of PaaS).

I’ve created a jBoss/Seam project containing : a webclient (for presentation logic of my application), a separated ejb folder (for business logique of my application), an ear to contain the projects.

Unzip this file mycompany.zip into the PaaS folder (mycompany should be asub folder of PaaS).

This project is based on MySql as RDBMS. You do not need to install it to make this sample working as this sample does not include any access to the database. bitewise, it will requires the jdbc driver. Here is the jdbc driver I used for MySql 5.1.6. I did not handle to include it in the factory, so you have to copy it into the lib folder of the jBoss deployment (factory > jboss-4.2.2.GA > server > default > lib).

Execute short cut that is in factory folder, it should launch a command prompt. Go in mycompany folder and execute folowing command line:

mvn clean install

Use Eclipse as IDE

Execute folowing command line:

mvn eclipse:eclipse -DdownloadSources=true -DdownloadJavaDosc=true

Execute eclipse.bat that will launch eclipse with the right workspace. I then suggest you to declare the jBoss server.

Now import projects that are in mycompany folder. Deploy it and check it works.

Deployment

Go in platform folder and execute folowing command line:

mvn jboss:harddeploy

Go in http://localhost:8080/webclient …should be ok !!

Conclusion

There are 3 important points in that sample:

  • usage a factory to bootstrap a new project (I think this is the right direction for a PaaS approch, even if that requires lot more work…this is only a prototype…not more),
  • the maven2 pom.xml files which demonstrate how to separate business logic, presentation…and can be extended easily to host morte than one application,
  • the IDE is nicely included into the picture through maven, and the IDE is NOT the build process.

I will improve it and create a dedicated page on this blog and post updates using regular posts.

If you try it and have any question or see any problem, feel free to add a comment.

Leave a Reply