• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

struts/jboss/tomcat application not working

Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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="dirs.build" value="${dirs.base}/build"/>
<property name="src" value="${dirs.base}/src"/>
<property name="web" value="${dirs.base}/web"/>

<property name="deploymentdescription" value="${dirs.build}/deploymentdescriptors"/>
<property name="classdir" value="${dirs.build}/src"/>
<property name="jardir" value="${dirs.build}/jar"/>
<property name="earDir" value="${dirs.build}/ear"/>
<property name="warDir" value="${dirs.build}/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" "http://java.sun.com/dtd/web-app_2_3.dtd">
<!-- 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....

Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic