If your servlet is named foo.bar.Servet, package it in a war file, named foobar.war, as follows:
Copy foobar.war to the server/default/deploy directory.
If you have a welcome file set up in web.xml to access the servlet, you can access it as http://localhost:8080/foobar.
Rats, should have previewed the war file contents:
WEB-INF/ + web.xml + classes/ + foo/ + bar/ + Servlet.class
Ohh ok let me try converting it to .WAR file but before doing that my JBoss server is not starting up. i tried running the "run.bat" file but it does not display anythign on the command prompt.
i have set the env variables as follows.
CLASSPATH : C:\Program Files\jboss-4.0.5.GA\bin\run.jar:\lib\tools.jar
JAVA_HOME : C:\Program Files\Java\j2re1.4.2_04\bin\client\jvm.dll
JBOSS_HOME : C:\Program Files\jboss-4.0.5.GA
Thanks for your help.
1) I recommend against placing any Java applications within Program Files. Various Java libraries have problems with spaces in the directory name, and unless you enjoy chasing down weird problems, you should put JBoss elsewhere. On my PC, JBoss is at f:\jboss\jboss-4.0.5.GA.
2) You do not need a classpath, the run.bat will set it up for you. I recommend that you never set a global CLASSPATH, it will only cause problems.
3) Your JAVA_HOME is incorrect. First, it references a JRE, your really should have a JDK. And your JRE is really old. You should download and use the latest 1.4 or 1.5 JDK from Sun and install it (do not use JDK 6, JBoss is not yet qualified to run with that and it can cause problems). Do not install the JDK in Program Files. Mine is at d:\apps\jdk1.5.0_11. (Yeah, I have a lot of disk drives, but on my laptop at home I use the same naming convention but everything is on the c: drive). Second, set JAVA_HOME to the installation directory, not to the jvm.dll. For example, on my PC I have:
4) It is not necessary to set JBOSS_HOME.
Thanks for the information Peter, let me do it as you have instructed and will get back to you.
i downloaded the latest JDK and changed the env variables and was able to start the server successfully.
Thanks for your help Peter and everybody who replied.