|
I am reading Core Servlets and JSP and trying to run a servlet
in a package. I have put "package test; " in the source code and compiled
it in the dos using javac -d c:\jakarta\webapps\root\web-inf\classes
HelloWorld.java with no problem. After running that command, I have this
class file in the c:\jakarta\webapps\root\web-inf\classes\test. However,
when I type "localhost/servlet/test.HelloWorld" in the explorer, I get the
following error.
Internal Servlet Error:
java.lang.NullPointerException
at java.lang.ClassLoader.resolveClass0(Native Method) at java.lang.ClassLoader.resolveClass(ClassLoader.java:588) at org.apache.tomcat.loader.AdaptiveClassLoader.loadClass(AdaptiveClassLoader.java:430) at org.apache.tomcat.loader.AdaptiveServletLoader.loadClass(AdaptiveServletLoader.java:174) at org.apache.tomcat.core.ServletWrapper.loadServlet(ServletWrapper.java:265) at org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:289) at org.apache.tomcat.core.Handler.service(Handler.java:254) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:166) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501) at java.lang.Thread.run(Thread.java:484) Please tell me what I am doing wrong. The Apache server
and the tomcat are running just fine, because I can run this servlet(without the
package statement) by typing localhost/servlet/HelloWorld with no
problem.
Cheers, June |
- Re: running servlet in package June
- Re: running servlet in package Dung Le
- Re: running servlet in package Goulas, Theodor
- Re: running servlet in package Goulas, Theodor
- Re: running servlet in package Lindsay, William (USPC.PCT.Hopewell)
- Re: running servlet in package June
- Re: running servlet in packa... Goulas, Theodor
- Re: running servlet in package June
- Re: running servlet in packa... Geeta Ramani
