You'll need to understand where the webapp's context is coming from (everything between the end of the host:port/ and the beginning of the servlet-mapping spec (found in your web.xml)).
In standalone TC it is probably held in a configuration file somewhere ??? or maybe it uses the name of your .war ?
In JBoss, if you are deploying a .war it will be the name of the .war, or be specified in the optional jboss-web.xml. If an.ear it will be in the application.xml (I figure this probably overrides anything in jboss-web.xml).
I suspect that the context configuration differs between your two deployments.
If this is not the case then either something really basic has changed like the portnumber or deployment has failed (since you haven't given me much to go on I can't be specific).
Otherwise perhaps you have different servlet-mapping specs.
In any case, if you are planning to move webapps around from container to container you should look at this stuff or it will bite you again and again.
In Tomcat you specify application-level contexts in server.xml.
If you just drop the war into jboss, then the context will be the name of the war file, eg. ABC.war will have a URL of
If you put the war in an ear file, then you can specify the context in the application.xml. A good example of this comes with JBoss in the form of webtest.ear in the default deploy directory.
I tried deploying the .war file, which in my case is called sampleTest.war. The message JBoss gives is:
[INFO,AutoDeployer] Auto deploy of file:/D:/JBTomcat/jboss/deploy/sampleTest.war
[INFO,J2eeDeployer] Deploy J2EE application: file:/D:/JBTomcat/jboss/deploy/sampleTest.war
[INFO,J2eeDeployer] Create application sampleTest.war
[INFO,J2eeDeployer] inflate and install WEB module sampleTest.war
[INFO,ContainerFactory] Deployed application: file:/D:/JBTomcat/jboss/tmp/deploy/Default/sampleTest.war
[INFO,J2eeDeployer] Starting module sampleTest.war
[INFO,EmbeddedCatalinaServiceSX] deploy, ctxPath=/sampleTest, warUrl=file:/D:/JBTomcat/jboss/tmp/deploy/Default/sampleTest.war/web1005/
[INFO,EmbeddedCatalinaServiceSX] WebappLoader[/sampleTest]: Deploying class repositories to work directory D:\JBTomcat\catalina\work\localhost\sampleTest
[INFO,EmbeddedCatalinaServiceSX] StandardManager[/sampleTest]: Seeding random number generator class java.security.SecureRandom
[INFO,EmbeddedCatalinaServiceSX] StandardManager[/sampleTest]: Seeding of random number generator has been completed
[INFO,EmbeddedCatalinaServiceSX] ContextConfig[/sampleTest]: Added certificates -> request attribute Valve
[INFO,EmbeddedCatalinaServiceSX] StandardWrapper[/sampleTest:default]: Loading container servlet default
[INFO,EmbeddedCatalinaServiceSX] default: init
[INFO,EmbeddedCatalinaServiceSX] StandardWrapper[/sampleTest:invoker]: Loading container servlet invoker
[INFO,EmbeddedCatalinaServiceSX] invoker: init
[INFO,EmbeddedCatalinaServiceSX] jsp: init
[INFO,J2eeDeployer] J2EE application: file:/D:/JBTomcat/jboss/deploy/sampleTest.war is deployed.
Finally i tried accessing the servlet as:
but this take me to the directory listings of ApacheTomcat. Am still puzzled with the way it works. Any corrections i need to do?
Thanks for all the help guys. I figured out the solution. It was due one stupid mistake on my side. INstead of accessing as "http://localhost:8080/sampleTest/servlet/sampletest" i was accessing it as "http://localhost:8080/sampleTest/servlets/sampleTest"..:-). It works great now.