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???
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.
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.
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.
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?
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???
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.
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