为什么我的servlet在weblogic6.1中跑不起来?

03-06-01 framework

我用jcreator写的一个hello world的servlet但是不能运行

在url输入http://localhost:7001/DefaultWebApp/MyHelloWorld时出现

Error 500--Internal Server Error

From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:

10.5.1 500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the

request

的错误提示,我在jcreator中的jdk的设置为d:\bea\jdk131,我包含了weblogic_sp.jar和

weblogic.jar两个包编译成.class。

不知道我错在什么地方,请高手们相助,下面是配置文件和源代码

我的配置文件

web.xml:

<?xml version="1.0" ?>

<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 1.2//EN"

"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

<web-app>

<welcome-file-list>

<welcome-file>index.html</welcome-file>

</welcome-file-list>

<servlet>

<servlet-name>HelloWorld2</servlet-name>

<servlet-class>examples.servlets.HelloWorld2</servlet-class>

</servlet>

<servlet-mapping>

<servlet-name>HelloWorld2</servlet-name>

<url-pattern>/HelloWorld2</url-pattern>

</servlet-mapping>

<servlet>

<servlet-name>MyHelloWorld</servlet-name>

<servlet-class>examples.servlets.MyHelloWorld</servlet-class>

</servlet>

<servlet-mapping>

<servlet-name>MyHelloWorld</servlet-name>

<url-pattern>/MyHelloWorld</url-pattern>

</servlet-mapping>

</web-app>

MyHelloWorld.java内容:

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;



public class MyHelloWorld extends HttpServlet{
private int counter=0;	
	public MyHelloWorld(){
		super();
		System.out.println("My Hello world example");
	}
	
	public void init() throws ServletException{
		System.out.println("My Hello world init");
	}
	
	public void service(HttpServletRequest request, HttpServletResponse response)
	throws IOException{
		counter++;
		String userName = request.getParameter("username");
		response.setContentType("text/html");
		PrintWriter out = response.getWriter();
		out.println("<html>");
		out.println("<head><title>My Hello World</title></head>");
		out.println("<body>");
		out.println("<p>Hello ,"+ userName + "!</p>");
		out.println("This servlet has been invoked"+ counter + " times");
		out.println("</body></html>");
		System.out.println("HelloServlet.doGet() invoked");
	}
	
	public void destroy(){
		System.out.println("My Hello world destroyed");
	}
	
}