Forums Register Login

Compiling the servlet

+Pie Number of slices to send: Send
Iam using JRun 3.0 Developer's Edition for Windows2000 and when i try to compile the servlet getting an error as
package javax.servlet does not exist
Here is my code
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class HelloWeb extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<HTML>");
out.println("<HEAD>");
out.println("<TITLE>");
out.println("Hello Web");
out.println("</TITLE>");
out.println("</HEAD>");
out.println("<BODY>");
out.println("Hello Web!");
out.println("</BODY>");
out.println("</HTML>");
out.close();
}
public void doPost (HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException {
doGet(request, response);
}
}
I try to compile the servlet under
E:\<JRun directory>\servers\default\default-app\WEB-INF\classes \HelloWeb.java
Any followup???
+Pie Number of slices to send: Send
Make sure that j2ee.jar is in your classpath.
+Pie Number of slices to send: Send
I did not find any j2ee.jar under jrun, how should i go on with it.
+Pie Number of slices to send: Send
And also when i try to start the JRun Default Server getting a prompt as JRun exited abnormally.
Please check the JRun event log file.
Where is the JRun event log file placed under JRun.
Any help would be very much appreciated.
+Pie Number of slices to send: Send
Sorry, I've never used JRun.
But if you're getting package javax.servlet package does not exist, you need to include j2ee.jar in your CLASSPATH.
I have no idea if this ships with JRun, but can be downloaded from sun.
+Pie Number of slices to send: Send
Hi Neem Red,
You have to add
servlet.jar to your class path. Then it will works fine(According to my knowledge). You can find servlet jar in JRun directory/lib/ext. Try it and send me the result.
Padmaja Kalimireddy.
+Pie Number of slices to send: Send
Hey Padmaja ,
Iam able to compile the servlet but when i try to start the JRun Default Server getting a prompt as JRun exited abnormally.
Please check the JRun event log file.
Where is the JRun event log file placed under JRun.
And also how do i go on looking a servlet in the browser.
Any help Padmaja?
+Pie Number of slices to send: Send
Hey thanks alot padmaja now iam able to compile the servlets and
also able to open the servlet in the browser.
I have to specify the following URL http://localhost:8100/servlet/MyFirstServlet
But one thing is when i try to open the
JRun Default Server under JRun getting the same prompt as
JRun exited abnormally.
Please check the JRun event log file.
Look at this url: http://localhost:8000/quickStart/howdoi/servletStart.jsp it asks us to Ensure that the JRun default server is running.
before opening a http://localhost:8100/servlet/MyFirstServlet in the browser.
Any help???
+Pie Number of slices to send: Send
Hi Neem Red,
Good to know that you are able to compile. I think if you can see the servlet in browser it means it is working. Am I correct? I am not sure about the abmormally exit of jrun. When I got similar error I reinstalled Jrun and somehow the problem has gone. I don't think that is the right solution.
Let me know if you find anything.

+Pie Number of slices to send: Send
Usually when we have gotten the JRun has exited abnormally message it means that somewhere there is another instance of JRun running on the same port. So if you installed JRun as a service that starts up automatically on port 8100, then you try and manually start JRun again on the same port, you will get this message.
If it doesn't look like there are are any other instances of JRun running, make sure and check in your task manager and see if there are any instances running that just didn't get shut down properly by the OS.
HTH
BRian
+Pie Number of slices to send: Send
Hi there,
When I compile servlet, I got the similar error. I already include the jsdk.jar in classpath. What's the problem could be?
Thanks,
Mike
My honeysuckle is blooming this year! Now to fertilize this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1052 times.
Similar Threads
Error when compiling servlet.
Servlet not being called
Package not found error on running servlet !
Servlet HelloWorld problem
New to servlets
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 07:09:04.