You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by santosh shedge <sg...@mahindrabt.com> on 2000/08/25 09:04:07 UTC

INVOKING SERVLETS FROM PACKAGE

Could you help me to solve the following problem:

I'm using  tomcat 3.1  as out of servlet container with Apache1.3.12  on

RedHat 6.2
I've created an "apps" directory in the root which contains "WEB-INF"
and  inside it "classes".
It also has "web.xml"
My sample servlet I can execute  by http calls from remote machine.  And

things are fine

                                                     But

my group has developed a java package in the form
com/mahindrabt/mobiassist/authenticate
in this authenticate contains the servlet ( here I'm specifying only
single for clarity purpose) Login.class
I can't execute this servlet

As given in the minimalistic user guide I created the above  hierarchy
in the /apps/WEB-INF/classes
i.e. /apps/WEB-INF/classes/com/mahindrabt/mobiassist/authenticate/<Here
Login.class is present>

I think I'm mistaking some entry so please help out.
Things that I've done:
___________________________________________
Entry in the /apps/WEB-INF/web.xml file

Servlet name -  Login
Servlet class - Login

url pattern - /Login
____________________________________________
Entry in the /usr/local/tomcat/conf/server.xml file

Context path - /authenticate       Document Root - /apps
____________________________________________
Entry in the /usr/local/tomcat/conf/tomcat.conf file

  ApJServMount  /authenticate  /apps
____________________________________________

NORMALLY I'M ABLE TO EXECUTE  SERVLETS FROM ANY DIRECTORY STRUCTURE
BUT  THIS JAVA PACKAGED  APPLICATION MUST BE CONTAINING SOME IMPORT
STATEMENTS OR SO.( ANYWAY) AS IN THE MINIM..STIC USER GUIDE IF YOU WANT
TO EXECUTE SERVLETS FROM A PACKAGED FORMAT YOU SHOULD INCLUDE  THAT
DIRECTORY STRUCTURE IN THE /classes DIRECTORY

IT GIVES THE FOLLOWING ERROR:

Error 500:

Location;/authenticate/Login

Internal Servlet Error

Java.Lang.NoClassDefFoundError:  Login (wrong nameL
com/mahindrabt/mobiassist/authenticate/Login


Please help Out

Thanx and regards





Re: INVOKING SERVLETS FROM PACKAGE

Posted by Jason Rumney <jr...@att.com>.
santosh shedge <sg...@mahindrabt.com> writes:

> Could you help me to solve the following problem:
> 
> I'm using  tomcat 3.1  as out of servlet container with Apache1.3.12  =
> on
> 
> RedHat 6.2
> I've created an "apps" directory in the root which contains "WEB-INF"
> and  inside it "classes".
> It also has "web.xml"
> My sample servlet I can execute  by http calls from remote machine.  =
> And
> 
> things are fine
> 
> But my group has developed a java package in the form
> com/mahindrabt/mobiassist/authenticate
> in this authenticate contains the servlet ( here I'm specifying only
> single for clarity purpose) Login.class
> I can't execute this servlet
>
> As given in the minimalistic user guide I created the above  hierarchy
> in the /apps/WEB-INF/classes
> i.e. /apps/WEB-INF/classes/com/mahindrabt/mobiassist/authenticate/<Here
> Login.class is present>
> 
> I think I'm mistaking some entry so please help out.
> Things that I've done:
> ___________________________________________
> Entry in the /apps/WEB-INF/web.xml file
> 
> Servlet name -  Login
> Servlet class - Login

This should be com.mahindrabt.mobiassist.authenticate.Login

> 
> url pattern - /Login
> ____________________________________________
> Entry in the /usr/local/tomcat/conf/server.xml file
> 
> Context path - /authenticate       Document Root - /apps
> ____________________________________________
> Entry in the /usr/local/tomcat/conf/tomcat.conf file
> 
>   ApJServMount  /authenticate  /apps
> ____________________________________________
> 
> NORMALLY I'M ABLE TO EXECUTE  SERVLETS FROM ANY DIRECTORY STRUCTURE
> BUT  THIS JAVA PACKAGED  APPLICATION MUST BE CONTAINING SOME IMPORT
> STATEMENTS OR SO.( ANYWAY) AS IN THE MINIM..STIC USER GUIDE IF YOU WANT
> TO EXECUTE SERVLETS FROM A PACKAGED FORMAT YOU SHOULD INCLUDE  THAT
> DIRECTORY STRUCTURE IN THE /classes DIRECTORY
> 
> IT GIVES THE FOLLOWING ERROR:
> 
> Error 500:
> 
> Location;/authenticate/Login
> 
> Internal Servlet Error
> 
> Java.Lang.NoClassDefFoundError:  Login (wrong nameL
> com/mahindrabt/mobiassist/authenticate/Login

I'm not sure where it is picking this class name from - is there
something in your config you have not posted? Looks like you've put
'/' where you meant '.' somewhere.


-- 
Jason Rumney <jr...@attlabs.att.com>
AT&T Labs (Redditch, UK)