File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JBoss/WildFly and the fly likes How to deploy JSP/Servlet in Jboss3.2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "How to deploy JSP/Servlet in Jboss3.2" Watch "How to deploy JSP/Servlet in Jboss3.2" New topic
Author

How to deploy JSP/Servlet in Jboss3.2

arnav prateek
Greenhorn

Joined: Apr 06, 2006
Posts: 17
I am using Jboss3.2.
I have 1 servlet and 1 Jsp to deploy in Jboss..
I have created web.xml and WEB-INF directory and subsequently .war file.
.war file I put in server/default/deploy directory....but while deploying it is giving error....
Can any body help to deploy it..

Thanks in Advance
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

All you need to do to deploy on JBoss is build your WAR correctly and put it in the deploy directory of the server you are using. What is the error you see?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
arnav prateek
Greenhorn

Joined: Apr 06, 2006
Posts: 17
I put .war file in server/default/delpoy directory...
I get follwoing error...on Jboss console screen..
---------------------------------
13:47:43,539 ERROR [URLDeploymentScanner] Failed to deploy: org.jboss.deployment
.scanner.URLDeploymentScanner$DeployedURL@a3a73c29{ url=file:/C:/jboss-3.2.1/ser
ver/default/deploy/test.war, deployedLastModified=0 }
org.jboss.deployment.DeploymentException: Document root element "web-app", must
match DOCTYPE root "null".; - nested throwable: (org.xml.sax.SAXParseException:
Document root element "web-app", must match DOCTYPE root "null".)
at org.jboss.jetty.Jetty.deploy(Jetty.java:353)
at org.jboss.jetty.JettyService.performDeploy(JettyService.java:242)
at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:35
7)
----------------------------------
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


Document root element "web-app", must
match DOCTYPE root "null".; - nested throwable: (org.xml.sax.SAXParseException:
Document root element "web-app", must match DOCTYPE root "null".)

Looks like your web.xml is invalid. Check you have created this correctly. If you are not sure, post it here and we'll have a look.
arnav prateek
Greenhorn

Joined: Apr 06, 2006
Posts: 17
With Same web.xml...application is wrking in tomcat....pls find below web.xml

----web.xml--------
<web-app>
<display-name>City Directory Query</display-name>
<description>
Tomcat Example servlets and JSP pages.
</description>
<servlet>
<servlet-name>CDSAdminServlet</servlet-name>
<servlet-class>com.servlet.admin.CDSAdminServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>CDSAdminServlet</servlet-name>
<url-pattern>/CDSAdminServlet</url-pattern>
</servlet-mapping>
</web-app>
---------------------------------
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

You don't seem to have a DOCTYPE declaration. You'll need to add one that corresponds to the Servlet version you are using (Tomcat is being lax if it lets you get away without one, since it is a requirement of the spec. that all Servlet deployment descriptors must include a DOCTYPE).

A suitable DOCTYPE declaration might be:
 
 
subject: How to deploy JSP/Servlet in Jboss3.2