You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "James C. McMaster (Jim)" <mc...@tatanka.stortek.com> on 2003/08/20 23:23:17 UTC

Tomcat cannot find subclass

I am having a problem with Tomcat 3.3, running on Solaris 8.

I have written a framework for asking questions and getting responses through 
a browser.  The package is called com.stortek.ilm.userresponse.  The classes 
live in a .jar file which resides in $TOMCAT_HOME/lib/apps.

One of the classes in that package, ServletSelectAnswerFormatter, generates 
an HTML select.  I get the options by invoking a method designed to be 
overridden in a subclass.

My current project has such a subclass, CountryServletSelectAnswerFormatter, 
which resides in WEB-INF/classes/com/stortek/ilm/userresponse for the correct 
context.

When the servlet runs, I get a ClassNotFoundException:

Class not found: com.stortek.ilm.userresponse.CountrySelectServletAnswerFormat
ter

Does anyone know what is wrong?  Is it possible to subclass part of a 
framework, and store the subclass and its parent this way?

Thank you for any help you can provide.
-- 
Jim McMaster
mailto:mcmasjc@tatanka.stortek.com



Re: Tomcat cannot find subclass

Posted by Pablo Mayrgundter <pa...@reeltwo.com>.
> One of the classes in that package, ServletSelectAnswerFormatter, generates
> an HTML select.  I get the options by invoking a method designed to be
> overridden in a subclass.
>
> My current project has such a subclass,
> CountryServletSelectAnswerFormatter, which resides in
> WEB-INF/classes/com/stortek/ilm/userresponse for the correct context.
>
> When the servlet runs, I get a ClassNotFoundException:
>
> Class not found:
> com.stortek.ilm.userresponse.CountrySelectServletAnswerFormat ter

Is this mistyped?  Above, you have "CountrySelectServlet..." not found, but 
you say it's actually called "CountryServletSelect..." (Servlet and Select 
are swapped), so it's right that it not be found.

-- 
Pablo Mayrgundter
Director of Applications and Services
www.reeltwo.com


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Tomcat cannot find subclass

Posted by Pablo Mayrgundter <pa...@reeltwo.com>.
> One of the classes in that package, ServletSelectAnswerFormatter, generates
> an HTML select.  I get the options by invoking a method designed to be
> overridden in a subclass.
>
> My current project has such a subclass,
> CountryServletSelectAnswerFormatter, which resides in
> WEB-INF/classes/com/stortek/ilm/userresponse for the correct context.
>
> When the servlet runs, I get a ClassNotFoundException:
>
> Class not found:
> com.stortek.ilm.userresponse.CountrySelectServletAnswerFormat ter

Is this mistyped?  Above, you have "CountrySelectServlet..." not found, but 
you say it's actually called "CountryServletSelect..." (Servlet and Select 
are swapped), so it's right that it not be found.

-- 
Pablo Mayrgundter
Director of Applications and Services
www.reeltwo.com


Re: Tomcat cannot find subclass

Posted by Bill Barker <wb...@wilshire.com>.
Unlike Tomcat 4, Tomcat 3 uses a delegating ClassLoader.  This means that
jars in lib/apps can't see classes in WEB-INF/classes.  Also, as long as the
jar is in lib/apps, Tomcat 3 will load classes from there in preference to
the same jar in WEB-INF/lib.

"James C. McMaster (Jim)" <mc...@tatanka.stortek.com> wrote in message
news:3258.1061416752@tatanka.stortek.com...
> Yes, the jar was in WEB-INF/lib, and I took it out in case that was a
> problem.  There was no change in the result when I did.
>
> I also suspect a ClassLoader issue.  What I would like to know is why?
When
> I subclass a member of a framework, do I have to put my project-unique
> subclass in the same jar as the common classes?  If so, that really sucks.
> -- 
> Jim McMaster
> mailto:mcmasjc@tatanka.stortek.com
>
>
> In message <00...@BALTHAZAR>, "Mike Curwen" said:
> > Have you tried placing your library in WEB-INF/lib?
> > There is probably a classloader issue at work.
> >
> >
> > > -----Original Message-----
> > > From: James C. McMaster (Jim) [mailto:mcmasjc@tatanka.stortek.com]
> > > Sent: Wednesday, August 20, 2003 4:23 PM
> > > To: tomcat-user@jakarta.apache.org
> > > Subject: Tomcat cannot find subclass
> > >
> > >
> > > I am having a problem with Tomcat 3.3, running on Solaris 8.
> > >
> > > I have written a framework for asking questions and getting
> > > responses through
> > > a browser.  The package is called
> > > com.stortek.ilm.userresponse.  The classes
> > > live in a .jar file which resides in $TOMCAT_HOME/lib/apps.
> > >
> > > One of the classes in that package,
> > > ServletSelectAnswerFormatter, generates
> > > an HTML select.  I get the options by invoking a method
> > > designed to be
> > > overridden in a subclass.
> > >
> > > My current project has such a subclass,
> > > CountryServletSelectAnswerFormatter,
> > > which resides in WEB-INF/classes/com/stortek/ilm/userresponse
> > > for the correct
> > > context.
> > >
> > > When the servlet runs, I get a ClassNotFoundException:
> > >
> > > Class not found:
> > > com.stortek.ilm.userresponse.CountrySelectServletAnswerFormat
> > > ter
> > >
> > > Does anyone know what is wrong?  Is it possible to subclass part of a
> > > framework, and store the subclass and its parent this way?
> > >
> > > Thank you for any help you can provide.
> > > -- 
> > > Jim McMaster
> > > mailto:mcmasjc@tatanka.stortek.com
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >




Re: Tomcat cannot find subclass

Posted by Bill Barker <wb...@wilshire.com>.
Unlike Tomcat 4, Tomcat 3 uses a delegating ClassLoader.  This means that
jars in lib/apps can't see classes in WEB-INF/classes.  Also, as long as the
jar is in lib/apps, Tomcat 3 will load classes from there in preference to
the same jar in WEB-INF/lib.

"James C. McMaster (Jim)" <mc...@tatanka.stortek.com> wrote in message
news:3258.1061416752@tatanka.stortek.com...
> Yes, the jar was in WEB-INF/lib, and I took it out in case that was a
> problem.  There was no change in the result when I did.
>
> I also suspect a ClassLoader issue.  What I would like to know is why?
When
> I subclass a member of a framework, do I have to put my project-unique
> subclass in the same jar as the common classes?  If so, that really sucks.
> -- 
> Jim McMaster
> mailto:mcmasjc@tatanka.stortek.com
>
>
> In message <00...@BALTHAZAR>, "Mike Curwen" said:
> > Have you tried placing your library in WEB-INF/lib?
> > There is probably a classloader issue at work.
> >
> >
> > > -----Original Message-----
> > > From: James C. McMaster (Jim) [mailto:mcmasjc@tatanka.stortek.com]
> > > Sent: Wednesday, August 20, 2003 4:23 PM
> > > To: tomcat-user@jakarta.apache.org
> > > Subject: Tomcat cannot find subclass
> > >
> > >
> > > I am having a problem with Tomcat 3.3, running on Solaris 8.
> > >
> > > I have written a framework for asking questions and getting
> > > responses through
> > > a browser.  The package is called
> > > com.stortek.ilm.userresponse.  The classes
> > > live in a .jar file which resides in $TOMCAT_HOME/lib/apps.
> > >
> > > One of the classes in that package,
> > > ServletSelectAnswerFormatter, generates
> > > an HTML select.  I get the options by invoking a method
> > > designed to be
> > > overridden in a subclass.
> > >
> > > My current project has such a subclass,
> > > CountryServletSelectAnswerFormatter,
> > > which resides in WEB-INF/classes/com/stortek/ilm/userresponse
> > > for the correct
> > > context.
> > >
> > > When the servlet runs, I get a ClassNotFoundException:
> > >
> > > Class not found:
> > > com.stortek.ilm.userresponse.CountrySelectServletAnswerFormat
> > > ter
> > >
> > > Does anyone know what is wrong?  Is it possible to subclass part of a
> > > framework, and store the subclass and its parent this way?
> > >
> > > Thank you for any help you can provide.
> > > -- 
> > > Jim McMaster
> > > mailto:mcmasjc@tatanka.stortek.com
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: Tomcat cannot find subclass

Posted by Mike Curwen <gb...@gb-im.com>.
Have you tried placing your library in WEB-INF/lib?
There is probably a classloader issue at work.


> -----Original Message-----
> From: James C. McMaster (Jim) [mailto:mcmasjc@tatanka.stortek.com] 
> Sent: Wednesday, August 20, 2003 4:23 PM
> To: tomcat-user@jakarta.apache.org
> Subject: Tomcat cannot find subclass
> 
> 
> I am having a problem with Tomcat 3.3, running on Solaris 8.
> 
> I have written a framework for asking questions and getting 
> responses through 
> a browser.  The package is called 
> com.stortek.ilm.userresponse.  The classes 
> live in a .jar file which resides in $TOMCAT_HOME/lib/apps.
> 
> One of the classes in that package, 
> ServletSelectAnswerFormatter, generates 
> an HTML select.  I get the options by invoking a method 
> designed to be 
> overridden in a subclass.
> 
> My current project has such a subclass, 
> CountryServletSelectAnswerFormatter, 
> which resides in WEB-INF/classes/com/stortek/ilm/userresponse 
> for the correct 
> context.
> 
> When the servlet runs, I get a ClassNotFoundException:
> 
> Class not found: 
> com.stortek.ilm.userresponse.CountrySelectServletAnswerFormat
> ter
> 
> Does anyone know what is wrong?  Is it possible to subclass part of a 
> framework, and store the subclass and its parent this way?
> 
> Thank you for any help you can provide.
> -- 
> Jim McMaster
> mailto:mcmasjc@tatanka.stortek.com
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 


RE: Tomcat cannot find subclass

Posted by Mike Curwen <gb...@gb-im.com>.
Have you tried placing your library in WEB-INF/lib?
There is probably a classloader issue at work.


> -----Original Message-----
> From: James C. McMaster (Jim) [mailto:mcmasjc@tatanka.stortek.com] 
> Sent: Wednesday, August 20, 2003 4:23 PM
> To: tomcat-user@jakarta.apache.org
> Subject: Tomcat cannot find subclass
> 
> 
> I am having a problem with Tomcat 3.3, running on Solaris 8.
> 
> I have written a framework for asking questions and getting 
> responses through 
> a browser.  The package is called 
> com.stortek.ilm.userresponse.  The classes 
> live in a .jar file which resides in $TOMCAT_HOME/lib/apps.
> 
> One of the classes in that package, 
> ServletSelectAnswerFormatter, generates 
> an HTML select.  I get the options by invoking a method 
> designed to be 
> overridden in a subclass.
> 
> My current project has such a subclass, 
> CountryServletSelectAnswerFormatter, 
> which resides in WEB-INF/classes/com/stortek/ilm/userresponse 
> for the correct 
> context.
> 
> When the servlet runs, I get a ClassNotFoundException:
> 
> Class not found: 
> com.stortek.ilm.userresponse.CountrySelectServletAnswerFormat
> ter
> 
> Does anyone know what is wrong?  Is it possible to subclass part of a 
> framework, and store the subclass and its parent this way?
> 
> Thank you for any help you can provide.
> -- 
> Jim McMaster
> mailto:mcmasjc@tatanka.stortek.com
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org