본문 바로가기

Development/Spring

외부 인터넷이 연결되지 않은 경우 application-context 설정하기.

관공서 등과 같이 외부 인터넷이 안되는 환경인 경우 spring application 을 실행할때 schemaLocation 오류가 발생한다.

 

이때는 xsd 를 url 이 아닌 classpath 를 통해서 가져오도록 수정한다.

 

 

 

<beans xmlns="http://www.springframework.org/schema/beans"

       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

       xmlns:context="http://www.springframework.org/schema/context"

       xsi:schemaLocation="http://www.springframework.org/schema/beans classpath:org/springframework/beans/factory/xml/spring-beans-4.2.xsd

http://www.springframework.org/schema/context classpath:org/springframework/context/config/spring-context-4.2.xsd

http://www.springframework.org/schema/tool classpath:org/springframework/beans/factory/xml/spring-tool-4.2.xsd

">

 

 

 

물론 처음 빌드는 인터넷이 되는 환경에서 모든 maven 라이브러리들을 다운로드 받은 상태여야 한다.

Intellij 에서는 schemaLocation 의 classpath syntax 를 인식하지 못해서 빨간색의 오류로 출력되지만 정상적으로 빌드되고 실행된다.

 

 

 

 

 

 

 

 

'Development > Spring' 카테고리의 다른 글

Spring Framework 과 ActiveMQ 연동  (0) 2017.07.25
Spring Security  (0) 2017.07.20
Cause: java.util.NoSuchElementException 오류 수정..  (0) 2013.03.06
Spring Security.  (0) 2009.09.07
Message Bundle 사용하기  (0) 2009.01.29