aspose file tools*
The moose likes JBoss/WildFly and the fly likes Problem In Deploying servlets in JBoss4.2.2GA Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Problem In Deploying servlets in JBoss4.2.2GA" Watch "Problem In Deploying servlets in JBoss4.2.2GA" New topic
Author

Problem In Deploying servlets in JBoss4.2.2GA

Dilip Mallik
Ranch Hand

Joined: Sep 19, 2008
Posts: 40
Hi all,

I have a problem in deploying servlet in the JBoss4.2.2GA

My directory structure is as follows

1)WEBTEST

under WEBTEST directory I have WEB-INF and a login form

2) inside WEB-INF directory I have my src and classes directory with package level structure.

I am using this command from command prompt to generate war file
jar -cvf test1.war WEBTEST.*

now when I deploy the war file in the server's default deploy directory
I am able to access the login form but when I press the submit button 404 error is comming . Even I have tried to just call servlet that will print hello world in the browser but the same 404 errror is comming .

any kind of suggestion is always welcome..

Thanks
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

If you look inside the WAR file, you will see that WEBTEST is the base directory for every file, which is not what you want. Do this instead:

cd WEBTEST
jar -cvf test1.war *


JBoss In Action
Dilip Mallik
Ranch Hand

Joined: Sep 19, 2008
Posts: 40
Thanks a lot Peter ..

It really helped me ...

One more thing is there any way to deploy the project folder directly instead of making war files and deploying them in server.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10033
    
163

You can go for ExplodedDeployment. Remember to give the folder a .war extension.


[My Blog] [JavaRanch Journal]
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

You can also keep your project folder in your development environment.

If you navigate to "JBOSS_HOME/server/INSTANCE/conf/" and open "jboss-service.xml", you will find a section like this:

Here you can add your own 'deploy' folder e.g. (remember to add a comma (,) between each entry)

In the folder 'webapp' you can have the same type of Applications as you would have in the 'normal' JBoss deploy folder.

As Jaikiran wrote "Remember to give the folder a .war extension."


Regards, Rene Larsen
Dropbox Invite
Dilip Mallik
Ranch Hand

Joined: Sep 19, 2008
Posts: 40
I am really Thankful to all you guys
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem In Deploying servlets in JBoss4.2.2GA