On 3/15/02 8:03 PM, "Chris Dolan" <[EMAIL PROTECTED]> wrote:

> 
> 
> Hi,
> 
> Just thought I'd drop you a line to let you know that I
> tried to install apache and test the SampleServlet
> (servlet_example1) with TomCat-4.0.3 following instructions
> provided in the servlet_example1 directory. It didn't go
> as smoothly as could be hoped for in that:
> 
> it didn't describe setting up the web.xml file


Indeed, that's true.  There is one in the servlet_example2 - we'll fix that.
Thanks

> 
> once that was set up (and this is perhaps more a
> problem with TomCat docs) following the example
> provided in 
> http://jakarta.apache.org/tomcat/tomcat-4.0-doc/appdev/web.xml.txt
> I found I needed the commons-collections.jar.. no problem.
> I vaguely recall seeing that dependency mentioned somewhere in
> the tomcat docs (though not those included with the distribution).

You have two choices, which I think are well explained in the

  WHY_TWO_JARS.txt

File in the root directory of CVS and the distribution.

The upshot is that if you want all the dependencies includes, you use the
jar-dep target and build the jar with all the dependencies in it.

In the event you don't want it, you can use the regular jar target to make a
dependency free jar, but of course you have to supply the needed resources
in the classpath of your app.
 
> Slightly more troubling was that I ended up getting the
> error:
> 
> 002-03-15 16:44:06 StandardContext[/velexample]: Servlet /velexample
> threw load() exception
> javax.servlet.ServletException: Servlet.init() for servlet
> SampleServlet threw exception
>       at
> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:935)
>      <snip>
>       at java.lang.reflect.Method.invoke(Method.java:324)
>       at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)
> ----- Root Cause -----
> java.lang.NoClassDefFoundError:
> org/apache/log/output/AbstractOutputTarget
>       at java.lang.Class.forName0(Native Method)
>       at java.lang.Class.forName(Class.java:130)
>       at 
> 
org.apache.velocity.runtime.log.LogManager.createLogSystem(LogManager.java:104>
)
> 
> which apparenlty requires LogKit.  (log4j is in the classpath, that
> doesn't seem to satisfy it).

Yes, the auto-log4j is a 1.3 feature (which will be released this
weekend...)

> 
> Daniel Rall mentioned that velocity should not need LogKit anymore,
> so I thought I'd bring it to your attention.  Actually, it looks like
> if you copy velocity-dep-1.2.jar into the classpath, it solves that
> problem.  So maybe mentioning that (and the web.xml thing) in the
> sample_servlet docs would be enough.

Yes - with 1.2, it doesn't have the auto find feature, so you need to either
put the deps in the classpath, or use the -dep- jar, as you figured out.
1.3 will have the auto-find feature.

Thanks for the heads-up...

Geir



> Anyway, minor caveat.  Nice product.
> 
> Thanks,
> -Chris
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 

-- 
Geir Magnusson Jr.                                     [EMAIL PROTECTED]
System and Software Consulting
"The greatest pleasure in life is doing what people say you cannot do."
        - Walter Bagehot



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to