First of all, I had to decompile your class since you didn't send the
source.
------------------------------------------------------
package WEB;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.ServletResponse;
import javax.servlet.http.*;
public class HelloWorld extends HttpServlet
{
public HelloWorld()
{
}
public void doGet(HttpServletRequest request, HttpServletResponse
response)
throws IOException, ServletException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<body>");
out.println("<head>");
out.println("<title>Hello World! Yoyu little sweeti</title>");
out.println("</head>");
out.println("<body>");
out.println("<h1>Hello World!</h1>");
out.println("</body>");
out.println("</html>");
}
}
--------------------------------------------------
Your problem is the package of your HelloWorld class.
I'm guessing that your IDE did this for you.
Either change the package to nothing or change the web.xml to deploy the
correct one.
Also, you go through a few more tutorials and find a basic, working sample
to work off of.
Your .war file doesn't appear to be able to deploy even if you hadn't put
WEB as the package.
Hope that helps.
James Mitchell
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Christian
> Gr�ndemann
> Sent: Saturday, May 25, 2002 12:50 PM
> To: [EMAIL PROTECTED]
> Subject: [JBoss-user] Getting crazy with "Error allocating a servlet
> instance"
>
>
> Hey Guys,
>
> I would heaviliy appreciate your help to find that error that makes me
> really ill ;-).
> I am trying to get a Servlet work with Jboss3.0.0.RC1 +
> tomcat4.0.3 . But it
> doesen't work for me at all,
> and I do not know what I should do with that error I have for the last 6
> hours. Google didn't help and even
> your documentation I bought online didn't solve my problem. :-((
>
> What am I doing:
> I modified just a little the Interest example. I can deploy the
> ear-file and
> the engine tells me that this is fine.
> The servlet is only a simple Hello World one, but if I try to enter it at
> http://localhost:8080/interest123/foo . I get the following error:
>
> javax.servlet.ServletException: Error allocating a servlet instance
> at
> org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.
> java:657)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapp
> erValve.ja
> va:214)
>
> [ ... ]
> root cause:
>
> java.lang.NoClassDefFoundError: HelloWorld (wrong name: WEB/HelloWorld)
> at java.lang.ClassLoader.defineClass0(Native Method)
> at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
> at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
> at
> org.apache.catalina.loader.WebappClassLoader.findClassInternal(Web
> appClassLo
> ader.java:1631)
> [ ...]
>
>
> I guess I made a directory mistake? Where is that damn mistake??
> I attached the ear file for better understanding...
> Thanks a lot in advance and of I course I did the right cross at the right
> place :-))
>
> cheers,
> Christian
>
>
>
>
>
>
_______________________________________________________________
Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user