Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to deploy JSP/Servlet in Jboss3.2

 
arnav prateek
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
arnav prateek
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic