Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

servlet won't run under JRun 4.0

843840Aug 20 2002 — edited Aug 25 2002
Problem> when I attempt to run a successfully compiled servlet in IE, IE
could not locate the page. IE displays "Oops! We couldn't find your
document.", or a window with caption/title "HTTP 500 Internal server
error" and message "The page cannot be displayed. There is a problem
with the page you are trying to reach and it cannot be displayed."

The servlet is stored in C:\JRun4\servers\default\default-ear\default-
war\WEB-INF\classes\Servlet_Class1.class. The 'default' server was
running (via jrun -start default).

The following are the URLs I used in an attempt to run the servlet:
http://localhost:8100/Servlet_Class1
http://localhost:8100/servlet/Servlet_Class1
http://localhost:8100/default/servlet/Servlet_Class1
http://localhost:8100/classes/Servlet_Class1
http://localhost:8100/default/classes/Servlet_Class1

I entered the following servlet definition in
C:\JRun4\servers\default\default-ear\default-war\WEB-INF\web.xml:

<servlet>
<servlet-name>Servlet_Class1</servlet-name>
<servlet-class>Servlet_Class1</servlet-class>
</servlet>

I defined url pattern in web.xml:
<servlet-mapping>
<servlet-name>Servlet_Class1</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>

Here is a portion of the servlet I'm attempting to run:
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;

/* The servlet extends the HttpServlet class and overrides the doPost
method. The doPost method is called when a client makes a POST request
(<FORM name=... METHOD=post ...>), and results in the simple HTML page
being returned to the client. */

class Servlet_Class1 extends HttpServlet {

/* not sure if main() method is necessary for servlets? */

public static void main(String[] args) {
System.out.println("inside Servlet_Class1");
} // main() method

public void doPost(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException
{
... the usual


I successfully ran/accessed the following:
http://localhost:8100/index.jsp <-- worked; JRun installation default

http://localhost:8100/zhome2.jsp <-- worked; a simple JSP page I wrote


http://localhost:8100/ returns the standard IE page with the
caption/title "HTTP 500 Internal server error" and message
"The page cannot be displayed. There is a problem with the page you are
trying to reach and it cannot be displayed." index.jsp does exist under
C:\JRun4\servers\default\default-ear\default-war.

I successfully ran some servlets from the 'techniques' sample directly
by entering their URLs:
http://localhost:8200/techniques/servlet/ContextInfo <-- worked

http://localhost:8200/techniques/servlet/InitInfo <-- worked

I installed JRun as an "application", NOT as a "service".

My PC configuration:
java version "1.4.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0_01-b03)
Java HotSpot(TM) Client VM (build 1.4.0_01-b03, mixed mode)
JRun 4 (Build 47304)
WinNT 4.0 SP5
IE 5.50

CLASSPATH=.;D:\jakarta-tomcat-3.3.1\lib\common\servlet.jar;C:\JRun4\servers\defa
ult\default-ear\default-war\WEB-INF\classes
JAVA_HOME=C:\j2sdk1.4.0_01

Path=C:\j2sdk1.4.0_01\bin;C:\WINNT\system32;C:\WINNT;C:\Program Files\Network As
sociates\PGPNT;C:\Program Files\MTS;d:\MSSQL7\BINN

I previously installed Tomcat but gave up on it. But I am using it's
servlet.jar to cleanly compile servlets.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 22 2002
Added on Aug 20 2002
4 comments
156 views