Maven Cannot Find Symbol Error Symbol Class Httpservletrequest
Contents |
here for a quick overview of cannot find symbol symbol: class httpservletrequest the site Help Center Detailed answers to any questions
Package Javax.servlet.annotation Does Not Exist Maven
you might have Meta Discuss the workings and policies of this site About
Cannot Access Javax.servlet.filter Class File For Javax.servlet.filter Not Found
Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions
Maven Compilation Error Cannot Find Symbol
Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Maven compilation failes (but compilation under package javax.servlet.jsp does not exist maven Eclipse is successful) up vote 13 down vote favorite 2 While building my web project from Eclipse, everything is fine: no errors, no warnings. However while building project with Maven it failes. Below is the output form mvn compile: c:\Users\jwa\Desktop\tets\traffic_web>mvn compile -e + Error stacktraces are turned on. [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] Building traffic_web [INFO] task-segment: [compile] [INFO] ------------------------------------------------------------------------ [INFO] [resources:resources {execution: default-resources}] [WARNING] Using platform encoding (Cp1250 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory c:\Users\jwa\Desktop\tets\traffic_web\src\main\resources [INFO] [compiler:compile {execution: default-compile}] [INFO] Compiling 22 source files to c:\Users\jwa\Desktop\tets\traffic_web\target\classes [INFO] ------------------------------------------------------------------------ [ERROR] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Compilation failure c:\Users\jwa\Desktop\tets\traffic_web\src\traffic_web\tools\Encryptor.java:[7,15] sun.misc.BASE64Encoder is Sun propriet ary API and may be removed in a future release c:\Users\jwa\Desktop\tets\traffic_web\src\traffic_web\tools\Session.java:[3,25] package javax.servlet.http does not exis t c:\Users\jwa\Deskt
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta maven compilation error package does not exist Discuss the workings and policies of this site About Us Learn package javax.servlet.http does not exist more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack package javax.servlet does not exist Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, http://stackoverflow.com/questions/3135871/maven-compilation-failes-but-compilation-under-eclipse-is-successful helping each other. Join them; it only takes a minute: Sign up maven can not find package and symbol up vote 1 down vote favorite I have an app with these class: (part of class): @SessionScoped @Named public class UserSessionBean implements Serializable { @javax.ws.rs.core.Context private HttpServletRequest httpRequest; and during mvn compile, I have this error: [ERROR] Failed http://stackoverflow.com/questions/13457459/maven-can-not-find-package-and-symbol to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.1:compile (default-compile) on project highway-web: Compilation failure: Compilation failure: [ERROR] /home/kelevra/java/git/ttkHighway/highway-web/src/main/java/com/kmware/ttk/highway/beans/session/UserSessionBean.java:[28,25] package javax.servlet.http does not exist [ERROR] [ERROR] /home/kelevra/java/git/ttkHighway/highway-web/src/main/java/com/kmware/ttk/highway/beans/session/UserSessionBean.java:[40,38] cannot find symbol [ERROR] symbol : class HttpServletRequest [ERROR] location: class com.kmware.ttk.highway.beans.session.UserSessionBean [ERROR] -> [Help 1] While making in IDEA there is no such problems. What it could be? java maven share|improve this question asked Nov 19 '12 at 15:57 Kirill Bazarov 1,05921840 2 Show your pom.xml –Nikita Beloglazov Nov 19 '12 at 16:05 1 You have to add the dependency for the HttpServletRequest. –khmarbaise Nov 19 '12 at 16:06 add a comment| 1 Answer 1 active oldest votes up vote 9 down vote accepted Java file UserSessionBean can not find the class HttpServletRequest. You should check the dependencies declared in the pom file. Make sure that you include
Categories: Ajax (1)Ant (16)Apache Web Server (8)Bioinformatics http://www.avajava.com/tutorials/lessons/how-do-i-package-a-basic-maven-web-application.html (10)Cascading Style Sheets (47)Classes and Objects (14)Database (13)Design Patterns (22)Eclipse (39)Files (62)General Java (69)JSPs (9)Java Basics (11)Linux (23)Logging (5)Maven (88)Search (12)Servlets (20)Struts (1)Text (19)Tomcat http://books.sonatype.com/mvnex-book/reference/web-sect-adding-simple-servlet.html (8)Version Control (8)Windows (2)XML (1) How do I package a basic maven web application? Author: Deron Eriksson Description: This tutorial describes how to does not package a basic maven web application. Tutorial created using: Windows Vista || JDK 1.6.0_04 || Eclipse Web Tools Platform 2.0.1 (Eclipse 3.3.1) || Tomcat 6.0.14 Page: 1 2> In other tutorials, we created a mavenSW web application called "mywebapp" that we ran in TomcatSW via EclipseSW. does not exist We set up the classpathW to use an Eclipse user library that contained a set of Tomcat jarW files. The pom.xml file is shown here. Notice that it is set up so that the eclipse:eclipse goal generates a classpath with the TOMCAT_6.0.14_LIBRARY Eclipse user library that we created. pom.xml before update
Nexus Repository Manager/Lifecycle Nexus and NuGet Nexus Repository Manager OSS DevOps Engineering Team: Thoughts OpEd The Q&A Corner Support Nexus on StackOverflow Knowledge Base Nexus Issue Tracker Resources Books to Download Lists, Live Chat and Other Resources The Nexus Repository Manager Deployment Guidelines Continuous Delivery and DevOps: SlideShow Gallery Repository Health Check Application Health Check Downloads Nexus Repository Manager OSS Nexus Repository Manager - Free Trial How to Choose Documentation Maven: The Complete Reference Maven by Example Repository Management with Nexus Nexus IQ Server Documentation About Us Members Only About the Community Member Entrance Video Gallery Free Training: Sonatype Nexus and CLM Tips from the Trenches Free Training: Nexus Professional and Smart Proxy Free Training: Empowering Releases with the Nexus Staging Suite The Nexus 2 Minute Challenge Maven by Example - 5.5. Adding a Simple Servlet Prev : 5.4. Configuring the Jetty Plugin TOC Next : 5.6. Adding J2EE Dependencies 5.5. Adding a Simple Servlet A web application with a single JSP page and no configured servlets is next to useless. Let’s add a simple servlet to this application and make some changes to the pom.xml and web.xml to support this change. First, we’ll need to create a new package under src/main/java named org.sonatype.mavenbook.web: $ mkdir -p src/main/java/org/sonatype/mavenbook/web $ cd src/main/java/org/sonatype/mavenbook/web Once you’ve created this package, change to the src/main/java/org/sonatype/mavenbook/web directory and create a class named SimpleServlet in SimpleServlet.java, which contains the code shown in the SimpleServlet class: SimpleServlet Class. package org.sonatype.mavenbook.web; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class SimpleServlet extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out = response.getWriter(); out.println( "SimpleServlet Executed" ); out.flush(); out.close(); } } Our SimpleServlet class is just that: a servlet that prints a simple message to the responseâ