This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

struts/jboss/tomcat application not working  RSS feed

ketandba shah
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am newbie in struts/jboss/tomcat..

I have develop the first web application....
1) My application development dir structure :

root : c:_\development\jakarata-struts-1.2.4\jakarata-struts-1.2.4\workspace\otsStruts
+ src
+ net
+ abc
+ otsStruts
+ webInvoiceInfo
all *.java files
+ web
all *.jsp
+ WEB-INF ---------->>> (under /web)
all *.tld, struts-config.xml, tiles-def.xml
all *.class
++ deploymentdescriptor
application.xml, web.xml
++ src
all *.class
++ jar
all *.jar
all *.jsp *.css
++++ classes
all *.class
++++ lib
all *.jar

+ WEB-INF ---------> (default output project path)
++ classes
***************end application directory structure *************
2) build.xml (ant 1.6 builder)

<?xml version="1.0"?>

<project name="otsStruts" default="all" basedir=".">
<!-- Main target -->
<target name="all" depends="init,clean,createDir,build,buildWar,buildEar"/>

<target name="init">
<property name="dirs.base" value="${basedir}"/>

<property name="" value="${dirs.base}/build"/>
<property name="src" value="${dirs.base}/src"/>
<property name="web" value="${dirs.base}/web"/>

<property name="deploymentdescription" value="${}/deploymentdescriptors"/>
<property name="classdir" value="${}/src"/>
<property name="jardir" value="${}/jar"/>
<property name="earDir" value="${}/ear"/>
<property name="warDir" value="${}/war"/>

<property name="warFile" value="lawyerInvoice.war"/>
<property name="earFile" value="lawyerInvoice.ear"/>

<property name="host" value="aziza" />
<property name="port" value="8080" />
<property name="jbossDeployDir" value="\\${host}\ketan-jboss-home\server\instance1\deploy"/>

<!-- The "clean" target deletes any previous "build" directory,
so that you can be ensured the application can be built from scratch. -->
<target name="clean"
description="Delete old WEB-INF and WEB-INF/classes,WEB-INF/lib and META-INF directories">
<delete dir="${warDir}/WEB-INF/classes"/>
<delete dir="${warDir}/WEB-INF/lib"/>
<delete dir="${warDir}/WEB-INF"/>
<delete dir="${earDir}/META-INF"/>

<!-- Create Web-inf & classes & lib directories -->
<target name="createDir">
<mkdir dir="${warDir}/WEB-INF"/>
<mkdir dir="${warDir}/WEB-INF/classes"/>
<mkdir dir="${warDir}/WEB-INF/lib"/>
<!-- Create Meta-inf directories -->
<mkdir dir="${earDir}/META-INF"/>

<!-- Compile Java Files and store in /build/src directory -->
<target name="build" >
<javac srcdir="${src}" destdir="${classdir}" debug="true" includes="**/*.java" />

<!-- Create the War File -->
<target name="buildWar" >
<copy todir="${warDir}">
<fileset dir="${web}" includes="**/*.jsp" />
<fileset dir="${web}" includes="**/*.css" />
<copy todir="${warDir}/WEB-INF">
<fileset dir="${deploymentdescription}" includes="web.xml" />
<copy todir="${warDir}/WEB-INF/classes/">
<fileset dir="${classdir}" includes="**/*.class" />
<copy todir="${warDir}/WEB-INF/lib">
<fileset dir="${jardir}" includes="**/*.jar" />
<!-- Create war file and place in ear directory -->
<jar jarfile="${earDir}/${warFile}" basedir="${warDir}" />
<!-- Create the Ear File -->
<target name="buildEar">
<copy todir="${earDir}/META-INF">
<fileset dir="${deploymentdescription}" includes="application.xml" />
<!-- Create ear file and place in ear directory -->
<jar jarfile="${dirs.base}/${earFile}" basedir="${earDir}" />

************ end of build.xml ***********

3) deployment dirctory structure on jboss server (jboss-3.2.5 along with tomcat 5.0)

z: \server\instance1\deploy

invoice.ear -------->>>> (copied after succesfull buid)

+ otsStruts
+++ classes
+++ lib
+ jbossweb-tomcat50.sar
4) here web.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "">
<!-- Action Servlet Mapping -->
<!-- The Welcome File List -->
5) here application.xml

<?xml version="1.0" encoding="ISO-8859-1"?>

<display-name> Invoice</display-name>

6) after succesful build .ear file is generated.

Copy this .ear file in deploy dir structure(i.e z:\server\instance1\deploy)
restart jboss-3.2.5 server.....

for testing :

http://ipAddress:8080/otsStruts/index.jsp -----

errorr message : page cannot display....wrong uri....

pl. help me out.....
I am suspecting some error in.....
1) may be some setting on tomcat...
2) wrong directory structure.....
3) wrong deployment ...setting some parameters on jboss-3.2.5

I have spent complete 4 days (almost 50 hrs....)...but can't get result......

Your help is appriciated......
Thanks in advance....

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!