You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Bob Jamison <rj...@lincom-asg.com> on 2000/10/13 14:39:36 UTC

Q for tc4: Servlet.jar

On rebuilding this morning with the jaxp-1.1 stuff,
I noticed that servlet.jar does not seem to be making
it into /build or /dist.    This produces a NoClassDefFoundError
for  javax/servlet/ServletRequest.   Is there something
I'm missing? It runs fine if I manually copy
servlet.jar into /dist/lib.


Bob Jamison
LinCom Corp



Re: Q for tc4: Servlet.jar

Posted by Bob Jamison <rj...@lincom-asg.com>.

"Craig R. McClanahan" wrote:

>
> The startup scripts (catalina.sh and catalina.bat) were also modified to
> include this JAR on the classpath.  Are you sure that your versions of
> everything got updated correctly?  What does your console window say the
> classpath is when it starts TC4 for you?
>
>

Yes, I have been finding a lot of the changes this morning.  The
server seems to be up and running now (and your Embedded
class runs OK from my C wrapper,  yaaay!).   Now I am
getting into some of the minor details, like commenting out
the <filter> placeholder in /example's web.xml, and stuff.

I will probably get the servlet & jsp examples going by the
end of the day.  Thanks.

By the way, I made a JNI 'RegisterNatives' section in my C
wrapper for the ServletOutputStream/InputStreams to read
and write via C.  Currently it is just a simple char-by-char
read/write, but I was wondering,  do you think there is any
real speed increase overloading Input/OutputStreams'
byte[] buffer read/writes with natives?   It
would -seem- faster, although converting a Java byte
array to a C uchar array is not cheap;
it might burn up any efficiency savings.  Any opinions?


Bob





Re: Q for tc4: Servlet.jar

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Bob Jamison wrote:

> On rebuilding this morning with the jaxp-1.1 stuff,
> I noticed that servlet.jar does not seem to be making
> it into /build or /dist.    This produces a NoClassDefFoundError
> for  javax/servlet/ServletRequest.   Is there something
> I'm missing? It runs fine if I manually copy
> servlet.jar into /dist/lib.
>

Recently the distribution location of the "servlet.jar" file got moved
from the "lib" subdirectory to the "bin" subdirectory.  This is because
the servlet classes are among the very few that need to be on the system
classpath and thus visible to both the Catalina class loader and the
class loaders for webapps to avoid class cast problems.

The startup scripts (catalina.sh and catalina.bat) were also modified to
include this JAR on the classpath.  Are you sure that your versions of
everything got updated correctly?  What does your console window say the
classpath is when it starts TC4 for you?

>
> Bob Jamison
> LinCom Corp
>

Craig

====================
See you at ApacheCon Europe <http://www.apachecon.com>!
Session VS01 (23-Oct 13h00-17h00):  Sun Technical Briefing
Session T06  (24-Oct 14h00-15h00):  Migrating Apache JServ
                                    Applications to Tomcat



Re: Q for tc4: now its running

Posted by Bob Jamison <rj...@lincom-asg.com>.

Bob Jamison wrote:

> Never mind.  It's in /bin.  Need sleep!
>
> Bob

In a 'pristine' /dist copy, not modified, running
any 'example' servlet  produces a ClassCastEx when setting
a new filter via newInstance():

java.lang.ClassCastException: filters.ExampleFilter
        at
org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:339,
Compiled Code)
        at
org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:117,
Compiled Code)

...etc....



Here is the offending code:

     if (filterClass.startsWith("org.apache.catalina."))
  classLoader = this.getClass().getClassLoader();
     else
  classLoader = context.getLoader().getClassLoader();

     // Instantiate a new instance of this filter
     Class clazz = classLoader.loadClass(filterClass);
     this.filter = (Filter) clazz.newInstance();    <--line 339
     filter.setFilterConfig(this);

I'm trying to run this thing via a debugger, so I can see what
filterClass can be....


Bob




Re: Q for tc4: Servlet.jar

Posted by Bob Jamison <rj...@lincom-asg.com>.

Never mind.  It's in /bin.  Need sleep!

Bob