[JBoss-user] HELP!? Works in JBoss-3.0.4 with JBossWeb (Jetty), and Tomcat 4.1.12 Standalone - not in JBoss-3.0.4+Tomcat-4.1.12-LE-jdk14
JBoss Elite! I have tried any number of ways to get the JBoss-3.0.4/Tomcat 4.1.12-LE-jdk14 Integrated bundle to serve up a simple jsp/servlet web application. Each of the approaches has been unsuccessful. The deployed JSP works, but the called servlet does not. I have successfully taken the example.war file and copied it into my standalone tomcat and it worked. I have installed the JBoss-3.0.4 with JBossWeb (Jetty) and deployed the example.war and had it work. Could someone please take a look at the included .war file and my steps and tell me what I did wrong? Thanks, Will Here's the readme that I created... 1. Create the following 4 directories wherever you like: 1. example 2. example\src 3. example\web 4. example\descriptors 2. Cut and paste the contents of the following 5 files saving them in the appropriate directories - the content is at the bottom of this file: 1. example\build.xml 2. example\descriptors\application.xml 3. example\descriptors\web.xml 4. example\src\HelloWorld.java 5. example\web\index.jsp 3. Open a command prompt in the example directory and type: ant note: you might have to set the classpath for the servlet.jar, ie. set classpath=D:\jboss-3.0.4\tomcat-4.1.x\common\lib\servlet.jar before calling ant if it complains. 4. Should have had no errors and created a build directory with the structure: build\deploy build\descriptors build\ear build\ear\META-INF build\src build\war build\war\WEB-INF build\war\WEB-INF\classes 5. To deploy the Web Application on Tomcat, simply copy the file: build\deploy\example.war into the %TOMCAT_HOME%\webapps directory 5a. To deploy the Web Application on JBoss, simply copy the file: build\deploy\example.war into the jboss-3.0.4\server\default\deploy directory. 6. To test the deployment of the JSP browse to: http://localhost:8080/example/index.jsp 7. To test the deployment of the Servlet, browse to: http://localhost:8080/example/index.jsp and click the hyperlink: Click here to execute the Servlet or browse to: http://localhost:8080/example/servlet/HelloWorld 8. Good job and well done! (Cry if it's JBoss + Tomcat) example\build.xml ---snip project name=Example Application default=all basedir=. target name=init property name=dirs.base value=${basedir}/ property name=classdir value=${dirs.base}/build/src/ property name=src value=${dirs.base}/src/ property name=web value=${dirs.base}/web/ property name=deploy value=${dirs.base}/build/deploy/ property name=deploymentdescription value=${dirs.base}/build/descriptors/ property name=warFile value=example.war/ property name=earFile value=example.ear/ property name=earDir value=${dirs.base}/build/ear/ property name=warDir value=${dirs.base}/build/war/ property name=srcDir value=${dirs.base}/build/src/ property name=srcDeploymentdescription value=${dirs.base}/descriptors/ !-- Create build/src directory to hold the output classes-- mkdir dir=${srcDir}/ !-- Create build/src directory to hold the output classes-- mkdir dir=${deploymentdescription}/ !-- Create build/deploy directory to hold the output war and ear files-- mkdir dir=${deploy}/ !-- Create Web-inf and classes directories -- mkdir dir=${warDir}/WEB-INF/ mkdir dir=${warDir}/WEB-INF/classes/ !-- Create Meta-inf and classes directories -- mkdir dir=${earDir}/META-INF/ !-- Copy the application.xml and web.xml files from descriptors to build/descriptors -- copy todir=${deploymentdescription} fileset dir=${srcDeploymentdescription} includes=**/*.xml / /copy /target !-- Main target -- target name=all depends=init,build,buildWar,buildEar/ !-- Compile Java Files and store in /build/src directory -- target name=build javac srcdir=${src} destdir=${classdir} debug=true includes=**/*.java / /target !-- Create the War File -- target name=buildWar depends=init copy todir=${warDir}/WEB-INF/classes fileset dir=${classdir} includes=**/*.class / /copy copy todir=${warDir}/WEB-INF fileset dir=${deploymentdescription} includes=web.xml / /copy copy todir=${warDir} fileset dir=${web} includes=**/*.* / /copy !-- Create war file and place in ear directory -- jar jarfile=${earDir}/${warFile} basedir=${warDir} / !-- Copy the war file to the deploy directory -- copy todir=${deploy} fileset dir=${earDir} includes=**/*.war / /copy /target !-- Create the War File -- target name=buildEar depends=init copy todir=${earDir}/META-INF fileset dir=${deploymentdescription} includes=application.xml /
Re: [JBoss-user] HELP!? Works in JBoss-3.0.4 with JBossWeb (Jetty),and Tomcat 4.1.12 Standalone - not in JBoss-3.0.4+Tomcat-4.1.12-LE-jdk14
Your problem is that you didn't define nor map your servlet in your web.xml file. The fact that other web containers let you get away with that is extra and not per spec. I got your example web app working by changing 2 files: web.xml: ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN http://java.sun.com/j2ee/dtds/web-app_2_2.dtd; web-app servlet servlet-nameHelloWorld/servlet-name servlet-classHelloWorld/servlet-class /servlet servlet-mapping servlet-nameHelloWorld/servlet-name url-pattern/HelloWorld/*/url-pattern /servlet-mapping /web-app and index.jsp (to match the url-pattern I defined in web.xml in the href): html head titleDeployment Example/title /head body H1Deployment Example/H1 The deployment of the JSP worked!brbr a href=HelloWorldClick here to execute the Servlet/a /body /html Hope this helps, David -- Will Senn wrote: JBoss Elite! I have tried any number of ways to get the JBoss-3.0.4/Tomcat 4.1.12-LE-jdk14 Integrated bundle to serve up a simple jsp/servlet web application. Each of the approaches has been unsuccessful. The deployed JSP works, but the called servlet does not. I have successfully taken the example.war file and copied it into my standalone tomcat and it worked. I have installed the JBoss-3.0.4 with JBossWeb (Jetty) and deployed the example.war and had it work. Could someone please take a look at the included .war file and my steps and tell me what I did wrong? Thanks, Will Here's the readme that I created... 1. Create the following 4 directories wherever you like: 1. example 2. example\src 3. example\web 4. example\descriptors 2. Cut and paste the contents of the following 5 files saving them in the appropriate directories - the content is at the bottom of this file: 1. example\build.xml 2. example\descriptors\application.xml 3. example\descriptors\web.xml 4. example\src\HelloWorld.java 5. example\web\index.jsp 3. Open a command prompt in the example directory and type: ant note: you might have to set the classpath for the servlet.jar, ie. set classpath=D:\jboss-3.0.4\tomcat-4.1.x\common\lib\servlet.jar before calling ant if it complains. 4. Should have had no errors and created a build directory with the structure: build\deploy build\descriptors build\ear build\ear\META-INF build\src build\war build\war\WEB-INF build\war\WEB-INF\classes 5. To deploy the Web Application on Tomcat, simply copy the file: build\deploy\example.war into the %TOMCAT_HOME%\webapps directory 5a. To deploy the Web Application on JBoss, simply copy the file: build\deploy\example.war into the jboss-3.0.4\server\default\deploy directory. 6. To test the deployment of the JSP browse to: http://localhost:8080/example/index.jsp 7. To test the deployment of the Servlet, browse to: http://localhost:8080/example/index.jsp and click the hyperlink: Click here to execute the Servlet or browse to: http://localhost:8080/example/servlet/HelloWorld 8. Good job and well done! (Cry if it's JBoss + Tomcat) example\build.xml ---snip project name=Example Application default=all basedir=. target name=init property name=dirs.base value=${basedir}/ property name=classdir value=${dirs.base}/build/src/ property name=src value=${dirs.base}/src/ property name=web value=${dirs.base}/web/ property name=deploy value=${dirs.base}/build/deploy/ property name=deploymentdescription value=${dirs.base}/build/descriptors/ property name=warFile value=example.war/ property name=earFile value=example.ear/ property name=earDir value=${dirs.base}/build/ear/ property name=warDir value=${dirs.base}/build/war/ property name=srcDir value=${dirs.base}/build/src/ property name=srcDeploymentdescription value=${dirs.base}/descriptors/ !-- Create build/src directory to hold the output classes-- mkdir dir=${srcDir}/ !-- Create build/src directory to hold the output classes-- mkdir dir=${deploymentdescription}/ !-- Create build/deploy directory to hold the output war and ear files-- mkdir dir=${deploy}/ !-- Create Web-inf and classes directories -- mkdir dir=${warDir}/WEB-INF/ mkdir dir=${warDir}/WEB-INF/classes/ !-- Create Meta-inf and classes directories -- mkdir dir=${earDir}/META-INF/ !-- Copy the application.xml and web.xml files from descriptors to build/descriptors -- copy todir=${deploymentdescription} fileset dir=${srcDeploymentdescription} includes=**/*.xml / /copy /target !-- Main target -- target name=all depends=init,build,buildWar,buildEar/ !-- Compile Java Files and store in /build/src directory -- target name=build javac srcdir=${src}
Re: [JBoss-user] HELP!? Works in JBoss-3.0.4 with JBossWeb (Jetty), and Tomcat 4.1.12 Standalone - not in JBoss-3.0.4+Tomcat-4.1.12-LE-jdk14
You are relying on the deprecated invoker servlet to map anonymous servlets to the /servlet/* URL namespace. The mapping for the invoker servlet is commented out in the tomcat-4.1.x/conf/web.xml, so the a href=servlet/HelloWorldClick here to execute the Servlet/a fails. Fix your web.xml to provide the servlet and servlet-mapping tags and it just works. Else read why the invoker servlet is deprecated and if you still want to use it uncomment its servlet-mapping and your unmodified example.war just works. Scott Stark Chief Technology Officer JBoss Group, LLC - Original Message - From: Will Senn [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, December 06, 2002 10:18 AM Subject: [JBoss-user] HELP!? Works in JBoss-3.0.4 with JBossWeb (Jetty), and Tomcat 4.1.12 Standalone - not in JBoss-3.0.4+Tomcat-4.1.12-LE-jdk14 JBoss Elite! I have tried any number of ways to get the JBoss-3.0.4/Tomcat 4.1.12-LE-jdk14 Integrated bundle to serve up a simple jsp/servlet web application. Each of the approaches has been unsuccessful. The deployed JSP works, but the called servlet does not. I have successfully taken the example.war file and copied it into my standalone tomcat and it worked. I have installed the JBoss-3.0.4 with JBossWeb (Jetty) and deployed the example.war and had it work. Could someone please take a look at the included .war file and my steps and tell me what I did wrong? Thanks, Will --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] HELP!? Works in JBoss-3.0.4 with JBossWeb (Jetty),and Tomcat 4.1.12 Standalone - not in JBoss-3.0.4+Tomcat-4.1.12-LE-jdk14
Thanks Scott and Dave, my original question must've posted at an off time. I appreciate the brevity and clarity of your responses. Will Scott M Stark wrote: (sic) David Ward wrote: (sic) --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] HELP!? Works in JBoss-3.0.4 with JBossWeb (Jetty), and Tomcat 4.1.12 Standalone - not in JBoss-3.0.4+Tomcat-4.1.12-LE-jdk14
JBoss Elite! I have tried any number of ways to get the JBoss-3.0.4/Tomcat 4.1.12-LE-jdk14 Integrated bundle to serve up a simple jsp/servlet web application. Each of the approaches has been unsuccessful. The deployed JSP works, but the called servlet does not. I have successfully taken the example.war file and copied it into my standalone tomcat and it worked. I have installed the JBoss-3.0.4 with JBossWeb (Jetty) and deployed the example.war and had it work. Could someone please take a look at the included .war file and my steps and tell me what I did wrong? Thanks, Will Here's the readme that I created... 1. Create the following 4 directories wherever you like: 1. example 2. example\src 3. example\web 4. example\descriptors 2. Cut and paste the contents of the following 5 files saving them in the appropriate directories - the content is at the bottom of this file: 1. example\build.xml 2. example\descriptors\application.xml 3. example\descriptors\web.xml 4. example\src\HelloWorld.java 5. example\web\index.jsp 3. Open a command prompt in the example directory and type: ant note: you might have to set the classpath for the servlet.jar, ie. set classpath=D:\jboss-3.0.4\tomcat-4.1.x\common\lib\servlet.jar before calling ant if it complains. 4. Should have had no errors and created a build directory with the structure: build\deploy build\descriptors build\ear build\ear\META-INF build\src build\war build\war\WEB-INF build\war\WEB-INF\classes 5. To deploy the Web Application on Tomcat, simply copy the file: build\deploy\example.war into the %TOMCAT_HOME%\webapps directory 5a. To deploy the Web Application on JBoss, simply copy the file: build\deploy\example.war into the jboss-3.0.4\server\default\deploy directory. 6. To test the deployment of the JSP browse to: http://localhost:8080/example/index.jsp 7. To test the deployment of the Servlet, browse to: http://localhost:8080/example/index.jsp and click the hyperlink: Click here to execute the Servlet or browse to: http://localhost:8080/example/servlet/HelloWorld 8. Good job and well done! (Cry if it's JBoss + Tomcat) example\build.xml ---snip project name=Example Application default=all basedir=. target name=init property name=dirs.base value=${basedir}/ property name=classdir value=${dirs.base}/build/src/ property name=src value=${dirs.base}/src/ property name=web value=${dirs.base}/web/ property name=deploy value=${dirs.base}/build/deploy/ property name=deploymentdescription value=${dirs.base}/build/descriptors/ property name=warFile value=example.war/ property name=earFile value=example.ear/ property name=earDir value=${dirs.base}/build/ear/ property name=warDir value=${dirs.base}/build/war/ property name=srcDir value=${dirs.base}/build/src/ property name=srcDeploymentdescription value=${dirs.base}/descriptors/ !-- Create build/src directory to hold the output classes-- mkdir dir=${srcDir}/ !-- Create build/src directory to hold the output classes-- mkdir dir=${deploymentdescription}/ !-- Create build/deploy directory to hold the output war and ear files-- mkdir dir=${deploy}/ !-- Create Web-inf and classes directories -- mkdir dir=${warDir}/WEB-INF/ mkdir dir=${warDir}/WEB-INF/classes/ !-- Create Meta-inf and classes directories -- mkdir dir=${earDir}/META-INF/ !-- Copy the application.xml and web.xml files from descriptors to build/descriptors -- copy todir=${deploymentdescription} fileset dir=${srcDeploymentdescription} includes=**/*.xml / /copy /target !-- Main target -- target name=all depends=init,build,buildWar,buildEar/ !-- Compile Java Files and store in /build/src directory -- target name=build javac srcdir=${src} destdir=${classdir} debug=true includes=**/*.java / /target !-- Create the War File -- target name=buildWar depends=init copy todir=${warDir}/WEB-INF/classes fileset dir=${classdir} includes=**/*.class / /copy copy todir=${warDir}/WEB-INF fileset dir=${deploymentdescription} includes=web.xml / /copy copy todir=${warDir} fileset dir=${web} includes=**/*.* / /copy !-- Create war file and place in ear directory -- jar jarfile=${earDir}/${warFile} basedir=${warDir} / !-- Copy the war file to the deploy directory -- copy todir=${deploy} fileset dir=${earDir} includes=**/*.war / /copy /target !-- Create the War File -- target name=buildEar depends=init copy todir=${earDir}/META-INF fileset dir=${deploymentdescription} includes=application.xml /