Posted by ddevore
on April 20, 2006 at 1:52 PM PDT
This is the basics of working with JBoss. It is intended for the JBoss beginner not the experienced user.
This is not for the experienced JBoss application server user. It is meant to give the JBoss beginner the basics to running and deploying applications to JBoss 4.0.3 SP1. There is also information on how to improve efficiency when working with NetBeans and Creator.
JBoss is easy to understand if you know the way the directories are setup and how to work with them. First everything you will do to JBoss is in the install directory.
The most important one here is the run.bat or run.sh. This will run the application server and display debug and information messages to the user in the session it is started in. To start JBoss simply use the run command from this directory. To stop the server do a CTRL-C in the session it was started in. There are also some other files there but this is the basics only so I will not discuss them.
This is the "root" server lib directory. You don't usually have to nor want to do anything with these libs.
This is where the directories for the server instances are. This is where you will do most of your work.
The default directory is the directory for the default instance. This is the instance which is started if you do not specify an instance. If you are in need of multiple instances then you will need to duplicate this directory. So if you think that you will need more instances do yourself a favor and make a backup of this directory before doing anything else.
I will go through this directory and tell you a little about it and give you a little information which may come in handy in the future.
This is where all the configuration files for the paticular instance reside. These are more or less needed but you don't need to do much with them to work with the server. The only one I have changed in this directory is the log4j.xml because I wanted to add some different appenders to keep more concise logs.
This directory I have never done anything in and never even navigated to tell I decided to write this. The only think I could see of any interest is the wsdl directory which will hold a sub directory for each archive which holds a web service which holds the wsdl and wsdd files for each service.
This is the most important directory. It contains all the deployed applications archive files and the jbossweb-tomcat55.sar directory, if you ready my other blogs you will see references to the jbossweb-tomcat55.sar directory. The most important thing in the jbossweb-tomcat55.sar directory is the server.xml. This is the file which will need to be modified if you are going to have multiple instances running. If you do run multiple instances make sure you change the listening ports in the server.xml, refeer to the JBoss site for information on changing ports. To run a server with a different name use this command run -c instance_name. The next important directory is lib. It is where the archive files need to be put for the instance to find them. For instance if you are going to be using databases the database lib goes here. The log directory is next, it is where the logs for the instance get put. The temp and work are where the applications get expanded to and run from.
There are other directories but these are all you really need to worry about when getting started.
Under my normal development I use NetBeans and Creator with JBoss. I don't normally use the deploy ability of NetBeans, Creator does not currently support JBoss, because of the ease of doing a manual deployment. I have found that if I open a command prompt and run the copy command it is faster to deploy than through NetBeans. Since JBoss hot deploys new applications it works very will for me. I simply build the project and then use a script to deploy it from a command prompt. If you are going to use this method do not have the command prompt open in the dist directory because it will lock the directory and cause a Clean and Build to fail.
If you have any questions or need any more information please see JBoss.org or add a comment.