Hello, 

i created a .war file with a WEB-INF/web.xml file:


  | <?xml version="1.0" encoding="ISO-8859-1"?>
  | <!DOCTYPE web-app
  |     PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
  |     "http://java.sun.com/dtd/web-app_2_3.dtd";>
  | <web-app>
  | <servlet>
  |   <servlet-name>PlainServlet</servlet-name>
  |   <servlet-class>uls.PlainServlet</servlet-class>
  | </servlet>
  |   
  | <servlet-mapping>
  |  <servlet-name>PlainServlet</servlet-name>
  |  <url-pattern>/servlet/*</url-pattern>
  | </servlet-mapping>
  | </web-app>
  | 

Now, when i want to access my servlet i get the following error: 


  | exception
  | 
  | javax.servlet.ServletException: Error instantiating servlet class uls.PlainServlet
  |     at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:912)
  |     at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:668)
  |     at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
  | ...
  | 
and somewhat lower:

  | root cause
  | 
  | java.lang.Error: Unresolved compilation problems: 
  |     HttpServlet cannot be resolved or is not a valid superclass
  |     HttpServletRequest cannot be resolved (or is not a valid type) for the 
argument request of the method doGet
  |     HttpServletResponse cannot be resolved (or is not a valid type) for the 
argument response of the method doGet
  | 
  |     at uls.PlainServlet.(PlainServlet.java:17)
  | ...
  | 



Why can't jboss find the servlet.jar? I am using the default configuration, isn't 
tomcat in the path by default? Should i put my servlet.jar somewhere? 

Thanks in advance, 
Ulrich



Here is the code for my servlet: 


  | 
  | /*
  |  * Created on May 9, 2004
  |  *
  |  * To change the template for this generated file go to
  |  * Window - Preferences - Java - Code Generation - Code and Comments
  |  */
  | package uls;
  | 
  | import javax.servlet.*;
  | import javax.servlet.http.*;
  | 
  | /**
  |  * @author us
  |  *
  |  * To change the template for this generated type comment go to
  |  * Window - Preferences - Java - Code Geneqration - Code and Comments
  |  */
  | public class PlainServlet extends HttpServlet{
  |     
  |     public void doGet(HttpServletRequest request, HttpServletResponse response){
  |             try{
  |                     java.io.PrintWriter out = response.getWriter();
  |                     out.println("<html><body>hello world.</body></html>");
  |             }
  |             catch(Exception e){
  |                     e.printStackTrace();
  |             }
  |             
  |     }
  |     
  | }
  | 
  | 
  | 
Of course it compiles.

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3834307#3834307

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3834307


-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to 
deliver higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to