Tom --

It sounds like the fully qualified external java class name (including
the classloader) is different depending on whether the init() method is
called by the load-on-startup routine or whether the init() method is
called upon first hit.

I would include the following statement in both the init() method and
the doGet() method immediately before the Xalan calls:

  System.err.println("My classloader is " +
this.class.getClassLoader());

I think that this will help in unraveling the mystery.  Also, you might
want to include a class to EnvironmentCheck and see what that reveals.

Are you using XSLTC or the traditional XalanJ?  What JDK version are you
using?

If you're unable to figure things out, please post all of the output
here and we'll get to the bottom of it.

Gary

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, March 01, 2002 7:11 AM
> To: [EMAIL PROTECTED]
> Cc: craig mcclanahan
> Subject: load-on-startup and finding external classes with Tomcat 4.x
> 
> 
> Hi,
> 
> Situation: A Xalan servlet whose init method  creates a template 
> for a stylesheet that references an external java class and does 
> the transformation in a doGet method.
> 
> Problem: With Tomcat 4.x, if you configure the web.xml to 
> load the servlet at 
> startup, when it runs, the external java class cannot be 
> found. However, 
> if you do not load on startup, when the server is first hit, the init 
> method is invoked and the external java class is found and 
> the transformation 
> works.
> 
> -- 
>  Tom Amiro -- SQA Engineer
>  Sun XML Technology Development
>  voice: 781-442-0589 Fax: 781-442-1437
>  eMail: [email protected]
> 

Reply via email to