3 Replies Latest reply on May 10, 2011 9:32 AM by wolfgangknauf

    javax.servlet.http.HttpServletRequest cannot be resolved.

    samwun9988

      Hello,

       

      I am wondering where is server-api.jar for jboss?

      I got this compile-time error in Eclipse (with jboss 6 AS).

       

      Thanks

      Sam

        • 1. javax.servlet.http.HttpServletRequest cannot be resolved.
          alesj

          Here:

           

          Skywalker:lib alesj$ pwd

          /Users/alesj/jboss/build/target/jboss-6.1.0-SNAPSHOT/common/lib

          Skywalker:lib alesj$ jar -tf jboss-servlet-api_3.0_spec.jar

          META-INF/

          META-INF/MANIFEST.MF

          javax/

          javax/servlet/

          javax/servlet/descriptor/

          javax/servlet/annotation/

          javax/servlet/http/

          javax/servlet/descriptor/JspPropertyGroupDescriptor.class

          javax/servlet/descriptor/JspConfigDescriptor.class

          javax/servlet/descriptor/TaglibDescriptor.class

          javax/servlet/ServletResponseWrapper.class

          javax/servlet/ServletConfig.class

          javax/servlet/ServletInputStream.class

          javax/servlet/ServletRequestAttributeEvent.class

          javax/servlet/SingleThreadModel.class

          javax/servlet/ServletRegistration.class

          javax/servlet/FilterConfig.class

          javax/servlet/FilterChain.class

          javax/servlet/ServletRequest.class

          javax/servlet/DispatcherType.class

          javax/servlet/Registration$Dynamic.class

          javax/servlet/SessionTrackingMode.class

          javax/servlet/ServletRequestWrapper.class

          javax/servlet/ServletContainerInitializer.class

          javax/servlet/ServletException.class

          javax/servlet/Servlet.class

          javax/servlet/HttpConstraintElement.class

          javax/servlet/LocalStrings_ja.properties

          javax/servlet/ServletContextListener.class

          javax/servlet/LocalStrings.properties

          javax/servlet/FilterRegistration$Dynamic.class

          javax/servlet/AsyncEvent.class

          javax/servlet/Registration.class

          javax/servlet/ServletSecurityElement.class

          javax/servlet/HttpMethodConstraintElement.class

          javax/servlet/SessionCookieConfig.class

          javax/servlet/ServletRequestListener.class

          javax/servlet/ServletRequestAttributeListener.class

          javax/servlet/ServletContextAttributeListener.class

          javax/servlet/FilterRegistration.class

          javax/servlet/AsyncListener.class

          javax/servlet/UnavailableException.class

          javax/servlet/RequestDispatcher.class

          javax/servlet/ServletResponse.class

          javax/servlet/MultipartConfigElement.class

          javax/servlet/LocalStrings_fr.properties

          javax/servlet/Filter.class

          javax/servlet/ServletContextEvent.class

          javax/servlet/annotation/ServletSecurity$EmptyRoleSemantic.class

          javax/servlet/annotation/WebInitParam.class

          javax/servlet/annotation/ServletSecurity$TransportGuarantee.class

          javax/servlet/annotation/ServletSecurity.class

          javax/servlet/annotation/HttpMethodConstraint.class

          javax/servlet/annotation/WebFilter.class

          javax/servlet/annotation/HandlesTypes.class

          javax/servlet/annotation/WebListener.class

          javax/servlet/annotation/MultipartConfig.class

          javax/servlet/annotation/WebServlet.class

          javax/servlet/annotation/HttpConstraint.class

          javax/servlet/AsyncContext.class

          javax/servlet/ServletContext.class

          javax/servlet/ServletOutputStream.class

          javax/servlet/GenericServlet.class

          javax/servlet/http/NoBodyResponse.class

          javax/servlet/http/HttpSessionBindingEvent.class

          javax/servlet/http/HttpSessionActivationListener.class

          javax/servlet/http/Part.class

          javax/servlet/http/LocalStrings_es.properties

          javax/servlet/http/HttpServlet.class

          javax/servlet/http/LocalStrings_ja.properties

          javax/servlet/http/NoBodyOutputStream.class

          javax/servlet/http/HttpSessionAttributeListener.class

          javax/servlet/http/LocalStrings.properties

          javax/servlet/http/Cookie.class

          javax/servlet/http/HttpServletRequest.class

          javax/servlet/http/HttpSessionEvent.class

          javax/servlet/http/HttpSession.class

          javax/servlet/http/HttpSessionBindingListener.class

          javax/servlet/http/HttpUtils.class

          javax/servlet/http/LocalStrings_fr.properties

          javax/servlet/http/HttpSessionListener.class

          javax/servlet/http/HttpServletResponse.class

          javax/servlet/http/HttpServletResponseWrapper.class

          javax/servlet/http/HttpServletRequestWrapper.class

          javax/servlet/http/HttpSessionContext.class

          javax/servlet/ServletRequestEvent.class

          javax/servlet/ServletContextAttributeEvent.class

          javax/servlet/ServletRegistration$Dynamic.class

          META-INF/maven/

          META-INF/maven/org.jboss.spec.javax.servlet/

          META-INF/maven/org.jboss.spec.javax.servlet/jboss-servlet-api_3.0_spec/

          META-INF/maven/org.jboss.spec.javax.servlet/jboss-servlet-api_3.0_spec/pom.xml

          META-INF/maven/org.jboss.spec.javax.servlet/jboss-servlet-api_3.0_spec/pom.properties

          Skywalker:lib alesj$

          • 2. javax.servlet.http.HttpServletRequest cannot be resolved.
            peterj

            Sounds like you need some tools that will help you locate classes:

            http://www.coderanch.com/t/536956/vc/find-jar-file-which-contains

            • 3. javax.servlet.http.HttpServletRequest cannot be resolved.
              wolfgangknauf

              Hi Sam,

               

              it sounds as if you are programming a plain "Java project" in Eclipse. Why not using plugins like "JBoss Tools" (http://www.jboss.org/tools) or at least the "Web Tools Platform" plugin (http://www.eclipse.org/webtools/)? They both provide project types especially crafted for work with JavaEE applications (including servlets), and for those project types the JAR files bundled with the application server will automatically be added to the classpath.

               

              Best regards

               

              Wolfgang