googleRon wrote:
> I tried to invoke a simple servlet "Test1" which is (just for testing
> purposes) part of the package "myPackage" and its class-file is in
> C:\apache-tomcat-5.5.15\webapps\testApp\WEB-INF\classes\myPackage
>
> I get from Tomcat the following error-report:
>
> exception:
> javax.servlet.ServletException: Error allocating a servlet instance
>
> root cause:
> java.lang.NoClassDefFoundError: Illegal name: myPackage/Test2
Tomcat is right: "myPackage/Test2" is not a legal class name.
[...]
> The first line in Test1.java is:
> package myPackage;
[...]
> I adapted/edit web.xml bij adding the following lines:
>
> <servlet>
> <servlet-name>Test1</servlet-name>
> <servlet-class>myPackage/Test2</servlet-class>
> </servlet>
The class name should be "myPackage.Test2".
[...]
> The interresting thing is that when I put the servlet (without the
> package declaration!) in
> the map "C:\apache-tomcat-5.5.15\webapps\testApp\WEB-INF\classes" it
> works fine. No problem at all.
I don't believe that. Specifically, I don't believe that Tomcat will
ever load the servlet class if you tell it the name is
"myPackage/Test2", no matter where you put the corresponding class file.
--
John Bollinger