Hi Tom,

I'm using VAJ 3.5.2 with Tomcat 3.2.1 with no problems at all. Here is my 
setup:

Get rid of any IBM WTE stuff
Import the servlet.jar from tomcat into it's own project
Import all the struts source and resources into its own project
Create a class in a package in another project called 'TomcatRunner' (code 
follows at the end of this mail)
right click on tomcat runner and set the properties
in properties set tomcat.home=c:\yourwebhome

on the class path page set the 'extra directories' path to be
c:\TomcatLocal\lib\webserver.jar;
c:\TomcatLocal\lib\ant.jar;
c:\TomcatLocal\lib\jasper.jar;
c:\TomcatLocal\lib\jaxp.jar;
c:\TomcatLocal\lib\parser.jar;

(or whatever your directories are)

And in the project path add the VAJ projects for the servlet API and struts, 
plus whatever your own app project is. And that should be it, you can edit 
and debug your own code and the struts source in VAJ.

Your problems will come if you try to import Tomcat into VAJ. That I have 
not managed to do sucessfully!

Hope that helps!
Ned

TomcatRunner.java:

import java.lang.reflect.*;

public class TomcatRunner {

  public TomcatRunner() {
        super();
  }

  public static void main(java.lang.String[] args) {
        TomcatRunner runner = new TomcatRunner();
        runner.start(args, "org.apache.tomcat.startup.Tomcat");   }

  public void start(String[] args, String className) {
        try {
          Class cls = Class.forName(className);
          if (cls != null) {
                Method main = cls.getMethod("main",new Class[] {new 
String[]{}.getClass()});
                if(main != null) {
                  Object [] mainArgs = new Object [] {args};
                  main.invoke(null,mainArgs);
                }
          }
        } catch (ClassNotFoundException e) {
          System.out.println("Unable to find the class "+className);       
System.out.println("Set properties as described in this class' javadoc.");
        } catch (Exception e) {
          e.printStackTrace();
        }
  }
}



>From: Tom Miller <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: [EMAIL PROTECTED]
>Subject: Problem w/ Struts and VA for Java
>Date: Tue, 20 Feb 2001 10:14:27 -0600
>
>Struts people
>
>I had great success using VAJ to develop Struts applications a few
>months ago, but recently upgraded my Tomcat to 3.2.1 and Struts to
>recent releases. I lost the ability to develop and debug my Struts
>application classes within VAJ.
>
>Craig's excellently clear message of Feb. 13th (#4566) entitled
>'Classpaths and the "struts.jar" file' gave, I believe, the reason.
>Craig explained that containers (esp. Tomcat 3.x and 4.x) use custom
>class loaders that *must* find struts.jar and application classes in the
>WEB-INF directories of the web app itself, in the file system. (See
>Craig's message if you want to understand the reasons thoroughly)
>
>VAJ is a self-contained environment and needs to be able to work with
>imported source and internally generated classes. Unless there is
>something that I am not understanding, it appears to me that after
>Tomcat 3.x, Struts applications cannot be developed in VAJ. I'm very
>aware that one can debug into classes external to VAJ, but that is far
>short of being able to use all of the extremely powerful features of the
>IDE.
>
>A perhaps naive question would be whether there is any way for VAJ users
>to temporarily inhibit Tomcat from employing specialized classloaders
>for webapps just during development.
>
>If anyone knows another workaround for this, I would love to hear it.
>TIA
>--
>Tom Miller
>Miller Associates, Inc.
>[EMAIL PROTECTED]
>641.469.3535 Phone
>413.581.6326 FAX

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Reply via email to