Configuring Links to data files in the BII web app in JBoss 5.x

We have been getting asked a lot about general deployment within the ISA tools suite, particularly with respect to the web application, which can look a little complex. Here I’m going to describe one of the more perplexing tasks when setting up JBoss: how do I configure JBoss to serve up static content, i.e. my data files. I will also cover how to set up the URLs in data-locations.xml (for the BII Manager tool) to automatically place your files in this directory.

Setting up JBoss to serve out files

Probably the most annoying part of setting up JBoss is telling JBoss to serve out your data files from the web application. For instance, the BII data manager tool has sent the files to /tmp/data/bii/ on my file system and I want the URL http://localhost/data to point to that directory. There are a number of ways you can do this. You can use Apache or nginx to do this, you could change your data directory to be within the ROOT.war directory in your JBoss server directory, or you could do what I’m suggesting here and do everything through JBoss…which I think is a bit cleaner, and not so difficult when you know how.

1. The first thing to do is modify the profile.xml file found under the server/default/config/bootstrap folder in your JBoss installation.


In profile.xml, there is a bean named BootstrapProfileFactory, you need to modify this and add a value element to the list element. Here, I’ve added a path to my Downloads directory.


2. Next, we need to set up a folder in my Downloads directory, which has to have a series of folders following the deploy pattern of  /server/<profile>/deploy/ – so now, the directory /Users/eamonnmaguire/Downloads/server/default/deploy/ should exist

3. Within the deploy directory, create a data.war directory, and inside that create a WEB-INF directory. The name of the .war directory will dictate the URL, so data.war will correspond to http://localhost/data. In the WEB-INF directory, create an empty web.xml file. It’s contents will be <web-app></web-app> – Under the /Users/eamonnmaguire/Downloads/server/ I now have the following directory structure.


4. Add your files

Finally, within your data.war directory, add the files you want to display. Here I’ve added a PDF for simplicity.


Start up JBoss running ./ -c default and navigate your browser to http://localhost:8080/data/Diagnosis.pdf and I get this lovely page.


That’s it!

Now, to configure data-locations.xml. For out ISA-Tab for example, we simply set up the filesystem_path to be where, on our machine we want the files to be distributed. The web_url will be the URL we’ve just configured that has mapped data to that actual position in the file system.


9 thoughts on “Configuring Links to data files in the BII web app in JBoss 5.x

  1. Mutlu Dogruel

    Hi Eamonn, thanks for this useful information. A small correction: The directory in which you change profile.xml must be
    server/default/config/bootstrap/ instead of server/default/bootstrap/.

  2. Pingback: Getting up and running with the BII Web Application | ISA tools & ISA commons

  3. Eamonn Maguire

    Well, in the example, instead of /Users/eamonnmaguire/ you’d just have /home/csherati/data/server/default/deploy/data.war/

    The applicationURIs option would be /home/csherati/data/ instead of /Users/eamonnmaguire/Downloads/

    It’s essentially just a case of modifying the paths in this example. Linux and Mac are essentially the same under the hood.

  4. Matthew Cserhati

    Hi Eaonn,
    Thanks, I tried, but it didn’t work. I tried putting a test.pdf file into /home/cserhati/data/server/default/deploy/data.war/ but I cannot see it. Is this the place, by the way, where I have to put all my isatab files?

  5. Eamonn Maguire

    Which version of JBoss are you using? A few people have followed this guide now and it works.

    The ISATab files are placed in these directories automatically by the loader – the last step in the above post shows a fragment of the data-locations.xml file that resides in the BII Data Manager config directory – you edit that file to tell it where your data.war directory is.

    There is an alternative, which is straightforward if you use Apache for load balancing etc. in that you can use apache to handle the files, or something more suited to media such as nginx.

Comments are closed.