Setting up a Complete JBoss Stack on Fedora 10

I do most of my development work on Windows XP, but now that I have a decent laptop running Fedora 10 I thought I would see how it is doing something useful with the machine. I recently setup a complete JBoss stack for doing Seam and portal development with JBoss portal. There are a number of obvious differences when it comes to getting the complete set of tools installed on Fedora. In this post I’ll run through all the steps required to get a fully working development environment setup.

There’s a number of tools to grab and install for my development setup:

  1. Apache Ant 1.6.5 (required by JBoss AS 4.2.2)
  2. Sun Java 1.5.0_u17 (required by JBoss AS 4.2.2)
  3. JBoss AS 4.2.2
  4. Eclipse 3.4 SR1 for J2EE
  5. JBoss Tools 3b1
  6. Subclipse 1.4
  7. MySQL 5.0  **Use Add/Remove Software for this one**
  8. MySQL Connector/J 5.0
  9. JBoss Portal 2.7
  10. Seam Framework

Well that’s a bunch of things to get so grab a few beers and download all this crap…if you need some help picking a good beer check here. I’ve downloaded everything except #5 and #6 to my user’s download directory (/home/beren/Downloads). We’ll use Eclipse to get #5 and #6 so blow those off for now. On Linux you can install everything under the root account or under a user account. Since I’m just setting up a development machine that only I use, I’m going to install the server systems and core libraries as root. Development tools like Eclipse I’ll install under my user’s account. This is a bit lazy I guess.

If you do not grab the same exact versions as above be sure to adjust your paths when I show entering things into property files.

Most Linux distros have Apache Ant 1.7 or higher included, however this won’t work for us. Grab 1.6.5 from the Apache site, and extract this in the /usr directory. You’ll need to su to root and move the extract files: mv /home/beren/Downloads/apache-ant-1.6.5 /usr. After doing that you’ll need to modify your .bashrc file. This file is in your user’s home directory. You can open it from a terminal or grab it from the X GUI explorer. To see the file in the desktop you need to enable the display of hidden files. You can do this by going to your home directory and clicking Edit and Preferences. Then pick off the “show hidden and backup files” checkbox. Now you’ll be able to see and edit the .bashrc file in your user’s home directory. Edit that file and enter the following lines:

export ANT_HOME=/usr/apache-ant-1.6.5
export PATH=$PATH:$ANT_HOME/bin

Since we have the file open go ahead and add these lines for Boss AS (we’ll need them later):

export JAVA_HOME=/usr/java/jdk1.5.0_17
export PATH=$PATH:$JAVA_HOME/bin

Save the file and then type this:

source /home/beren/.bashrc

Then type “ant” and you should get a response. It is a good to go back and hide the files again.

Installing JDK 1.5.0_u17 is required for JBoss AS 4.2.2. The Linux download from Sun is a .bin file. To extract this just make the file executable and then run it. Use these commands:

su root
password: xxxxxxx
chmod +x jdk-1_5_0_17-linux-i586-rpm.bin
jdk-1_5_0_17-linux-i586-rpm.bin

The installer should run now and place the JDK in the /usr/java directory. I recommend a full restart at this point (although technically it is not required) and then check the ant environment vars to make sure they are set automatically when you login as your user.

Installation of JBoss AS is easy. Just su to root and extract the file to the /usr directory. Exit from root, switch to the /usr/jboss-4.2.2/bin directory and startup JBoss by executing the run.sh file. You should get a whole bunch of output that ends with a message stating the server was started successfully. You should also be able to browse to the server at http://localhost:8080

The next step is also easy – get Eclipse 3.4 SR1 for J2EE installed and working. I recommend just extracting this package to your home directory. Then test starting it up by double-clicking the eclipse icon in the main folder. Make sure it says “Java EE” in the title bar. If it doesn’t then you grabbed the wrong thing from eclipse.org.

While eclipse is open you might as well update everything.  Go to Help, Software Updates, then click the Update… button. While we’re here lets grab Subclipse and JBoss Tools. You need to add two new update sites to Eclipse. In the software updates wizard click on Available Software. Then click on Add Site. Add these two sites:

http://subclipse.tigris.org/update_1.4.x
http://download.jboss.org/updates/development

In each item select everything to install. Eclipse will figure out everything. You might get an error about a conflict…I got one with BIRT because for some reason I didn’t have it installed. I simply un-select the Birt components in the JBoss Tools stuff and I was good to go. Let all that stuff install, restart eclipse and then you should see a bunch of new View options under Window, Show View, Other. Make sure you have a bunch that includes Seam, jBoss Tools and jBoss BPM. If you have those then you are probably good to go.

We’re getting near to the end. The next step is installing MySQL. Many distro’s include MySQL in the Add/Remove software widgets. I recommend using that approach as the first choice method of installing MySQL. If that’s not working for you then grab the installer for MySQL 5 server as RPM packages for Red Hat Linux 5 (x86). Then use your command line rpm tool to install it. The MySQL site has good instructions…but you’re off the reservation with me on this one now 🙂 Once you get MySQL installed go into your services panel and start it up. I usually setup MySQL to start when my machine starts up.

You’ll need a client of some kind for MySQL  – I installed the MySQL GUI tools, also using the Add/Remove Software application. Too bad there is no Toad for MySQL on Linux. What you’ll need to do is login and create a new database and a user account “jboss” that has full access oit. The JBoss Portal environment will need this. I also created a separate database and account “seam” in case I want to screw around with Seam apps.

Installing JBoss Portal is pretty simple. Give your JBoss server the ‘ol ctrl-c, extract the portal files. Go into the setup directory and edit the file portal-mysql5-ds.xml and put in the correct jdbc information for your database. Copy this file to /usr/jboss-4.2.2/server/default. You’ll need to place the MySQL 5.0 JDBC (Connector/J) driver in your server’s lib directory (/usr/jboss-4.2.2/server/default/lib). Now copy the jboss-portal.sar to /usr/jboss-4.2.2/server/default and startup your jboss server. The portal will auto install its schema during its first load. You may need to edit memory settings in your JBoss AS configuration. Most importantly is the PermGenSpace param. To edit this param open up your run.sh file and add this param:

-XX:MaxPermSize=256m

to the JAVA_OPTS line (for me on line 179). If you get an error message about running out of PermGenSpace then use this param to fix it.

With this complete the portal should start up ok and you can login as admin/admin.

The next step is to install the Seam Framework so that you can build separate (non-portal) applications with Seam. I’ve got some other posts on doing this on Windows and the install is pretty much the same so just check these posts out:

Liferay I need a life jacket…

Using Seam and JBoss Portal

Bottom line is – extract the seam download to your home directory and then set the jboss.home directory in the build.properties file. After this you can deploy the examples to your JBoss server. So with all of that done you should have a complete stack and be ready to cast off your Win-bloze days -:)…if only you’re company that doesn’t force you to use MS Exchange server for email, right? D’oh!

3 Responses

  1. Beren says:

    I don’t normally use a visual editor…but I was just trying out the tools JBoss gives you and I was getting an error about a missing library “libstdc++.so.5” or something like that. I’ve seen this before when running other stuff. The problem is that the compatibility libraries for the gcc c++ tools need to be installed. Use yum or the Add/Remove software tool to add these in. In Add/Remove just do a search on “C++ compatibility” and you should pull it up.

  2. Michael Kazin says:

    Thanks for providing this Tarn. It was very useful.

    I encountered a tiny hiccup. JBoss Tools for Eclipse seems to have a new URL- the one supplied here did not work for me using Ganymede.

    I found three locations which may interest different folks, depending on their need for the cutting edge or stable software:
    download.jboss.org/jbosstools/updates/stable/
    download.jboss.org/jbosstools/updates/development/
    download.jboss.org/jbosstools/updates/nightly/trunk/

    For more details, see this other page I used:
    jboss.org/community/wiki/InstallingJBossTools

    (first attempt at posting was discarded. I am trying again without the specifying the protocol in the URLs)

Leave a Reply