File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem In Deploying servlets in JBoss4.2.2GA

 
Dilip Mallik
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 *
 
Dilip Mallik
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can go for ExplodedDeployment. Remember to give the folder a .war extension.
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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."
 
Dilip Mallik
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am really Thankful to all you guys
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic