Hi Darren,

we're using VAJ 3.5.2 Enterprise with Tomcat and Struts. First we tried to run Struts 
1.0b1 with Tomcat Test Env 3.1 but unfortunately Struts does not work with Tomcat 
3.1's XML-Parser. If you want you can make a XML (javax.xml.*) & SQL (javax.sql.*) 
package and put it into Tomcats ./lib directory and add it to VAJ's classpath. But if 
you use Tomcat 3.2.1, struts works out of the box - but not that comfortable as the 
Tomcat Test Env does, e.g. you can't debug JSP and Servlet Code anymore :(((
I did a hack (in Tomcats WebReaderXML.java to enable "jspPageCompiler" again) and 
added "com.ibm.ivj.tomcat.IJVJavaCompiler" again to re-enable in-workspace JSP and 
Servlet Debugging.

Running Tomcat 3.2.1 in VAJ 3.5.x
~~~~~~~~~~~~~~~~~~~~~~~~~~~
In short:
0.) Prerequisites:
      * latest jakarta-servlet-api _source_
      * tomcat 3.2.1 binary distribution (includes ./src already)
      * Tomcat 3.1 Test Environment from www.ibm.com/vadd (to get 
"com.ibm.ivj.tomcat.IVJJavaCompiler.java")
      * struts 1.0b1 source distribution
1.) Install Tomcat 3.1 Test Environment & look into 
/path/to/vaj35/ide/features/com.ibm.ivj.tomcat/... to find IVJJavaCompiler.java
2.) Start VAJ, do _not_ "Add feature Apache Test Env 3.1"!!!
3.) Create new Package, e.g. Apache_Tomcat_321
4.) Import all source from jakarta-servlet-api (do _not_ use servlet-api from VAJ or 
other precompiled javax.servlet.* - classes; they _must_ be compiled within VAJ 
Workspace to enable debugging of your own servlets and JSPs) into your Project
5.) import following --> compiled classes (not source!) <- from jasper.jar and 
webserver.jar  (both in tomcat-3.2.1/lib/)
jasper: all .class
webserver: org.apache.tomcat.logging.Logger, org.apache.tomcat.logging.LogHelper, 
org.apache.tomcat.util.SimplePool
If VAJ still complains about missing classes (you see this in "All Problems" - Tab) 
import compiled .class files from ./lib/*.jar until VAJ is happy.
6.) create two classes: StartTomcat & StopTomcat (code is the same for both!)

public class StartTomcat {
/**
 * StartTomcat constructor comment.
 */
public StartTomcat() {
     super();
}
/**
 * Starts the application.
 * @param args an array of command-line arguments
 */
public static void main(java.lang.String[] args) {
     // Insert code to start the application here.
     try {
          Class aClass = Class.forName("org.apache.tomcat.startup.Tomcat");
          java.lang.reflect.Method method = null;
          Class[] argsClass = new Class[] { String[].class };
          method = aClass.getMethod("main", argsClass);
          Object object = null;
          Object[] arguments = new Object[] { args };
          method.invoke(object, arguments);
     } catch (Exception e) {
          System.out.println("Exception occured: " + e.getMessage());
          e.printStackTrace();

     }
}
}

Right click StartTomcat in VAJ and goto "Properties-Classpath": have follwing files 
and dirs in classpath:

.;
..\Apache_Struts;
..\IBM IDE Utility class libraries;
..\JSP Page Compile Generated Code;
.\;
.\conf\;
.\src\;
.\lib\jaxp.jar;
.\lib\parser.jar;
.\lib\webserver.jar;
.\lib\jasper.jar;
.\webapps\;
.\webapps\admin\;
.\webapps\admin\WEB-INF\classes\;
.\webapps\examples\;
.\webapps\examples\WEB-INF\classes\;
..\IBM IDE Utility local implementation\;

And in Properties-Programm have no arguments for StartTomcat and "-stop" for 
StopTomcat. Also have "tomcat.home=." in "(java)Properties window"

7.) make new package and import all struts sources (org.apache.struts.*) into new 
package. Struts complains about missing javax.sql (get Binary distribution of 
jdbc-optional package from sun.com and import missing compiled .class files) and 
missing xml stuff (import missing compiled .class files from jaxp.jar and parser.jar 
(tomcat-3.2.1/lib/)
8.) Create Package "JSP Page Compile Generated Code"
9.) in tomcat-3.2.1/src/org.apache.tomcat.context.WebReaderXML.java goto line 51 or 52 
and uncomment "//sw.addInitParam("jspCompilerPlugin", 
"org.apache.jasper.compiler.JikesJavaCompiler")"
do not forget to replace "org.apache.jasper.compiler.JikesJavaCompiler" with 
"com.ibm.ivj.tomcat.IVJCompiler"
10.) recompile WebReaderXml.java and _update_ tomcat-3.2.1/lib/webserver.jar !!!!! 
Please make sure that update worked!
--
11.) import Stuts-Example (.java from struts-dir) into new VAJ Project and add it to 
VAJ Classpath (StartTomcat - Properties - Classpath 
(./webapps/struts-example/;./webapps/struts-example/WEB-INF/classes)
12.) copy struts-example.war into VAJ/ide/Project-Resources/Tomcat/webapps; copy 
"webapp_2_X.dtd and strus-config.dtd" from struts into 
"./webapps/struts-example/WEB-INF/classes/org/apache/struts/resources"
13.) start tomcat and test strus-example

Good luck!

J�rgen





[EMAIL PROTECTED] on 26.04.2001 20:59:22

Bitte antworten an [EMAIL PROTECTED]

An:   [EMAIL PROTECTED]
Kopie:     (Blindkopie: J�rgen Walter/HV18/Hermes/DE)
Thema:    RE: Visual Age 3.5.3 & Tomcat with Struts



Struts Users,

A little off topic, but I saw some discussion in prior messages
about Apache Test Environment & Visual Age.

Is anybody using VA 3.5.3 with Apache Tomcat?  Is there
a download available somewhere for the Apache Test
Env. that is compatible with VA 3.5.3?

- Darren







Reply via email to