현재 Spring maven 에 tomcat lib 를 추가하여 생기는 에러이다.

2가지 방법이 있다.


첫번째.

http://stackoverflow.com/questions/8487048/java-lang-linkageerror-javax-servlet-jsp-jspapplicationcontext-getexpressionfac  글 참고

That will happen when you include server-specific libraries of a different server make/version in the/WEB-INF/lib of your web application, such as jsp-api.jarel-api.jarservlet-api.jar, etc. You need to remove them all. The /WEB-INF/lib should not contain any server-specific libraries. They belongs in the specific server itself (Tomcat has them in its /lib folder already).


자신의 톰캣 서버의 lib를 사용하면 에러가 나지 않는다.

Project -> Properties -> JAVA Build Path -> Libraries -> Add Library -> Server Runtime

Server 추가 한다.



두번째.


pom.xml 에 


<dependency>

<groupId>org.apache.tomcat</groupId>

<artifactId>tomcat-coyote</artifactId>

<version>7.0.39</version>

<scope>provided</scope>

</dependency>



provided - 컴파일 할 때 필요하지만, 실제 런타임 때에는 컨테이너 같은 것에서 기본으로 제공되는 모듈임을 의미한다. 예를 들어, 서블릿이나 JSP API 등이 이에 해당한다. 배포시 제외된다.

 

실제 런타임때에는 컨테이너(JVM)에서 제공되는 api 를 사용해야 하기 때문에 provided 를 사용한다.

ex) tomcat 안에 있는 jar 파일들

'개발자 > Spring' 카테고리의 다른 글

Spring 에서 File Dowload 하는 예제 및 설정  (0) 2013.06.12
스프링 프레임웍 jar 파일  (1) 2013.03.05
Spring 에서 context부분...  (0) 2013.03.04
Spring 기본 환경설정 프로젝트  (0) 2013.03.04
applicationContext.xml  (0) 2013.03.04
블로그 이미지

김진리

,