update:
http://theeye.pe.kr/222 아이님의 블로그 글 참고해서 해결했습니다.
답글 주신 yeoupooh님, kingdori님 감사합니다.
-------------

eclipse에서 다음 옵션을 바꿔줘야 합니다.

Validate Settings 버튼으로 확인을 해서 No Trac repository found at url: HTTP Error 404 가 나오면 tracxmlrpc설치가 완료되지 않은 것입니다.

성공한 경우는 "Authentication credentials are valid"라고 나옵니다.

연결은 되었지만 Attach Context 실행에서 [Errno 13] Permission denied: '.../attachments/ticket' while executing 'ticket.putAttachment()' 메시지가 나오면 해당 디렉토리의 권한을 바꿔줘야 합니다.

chmod 775 attachments 로 바꿔주었습니다.


-------------
답답합니다. 아직 해결법 찾는 중입니다.

이클립스를 사용해서 개발을 하는 것은 기존 텍스트 에디터를 이용해서 작업하는 것과 많은 차이를 갖고 있다. 특히 웹 애플리케이션 개발에서는 더 많은 차이가 있게 되는데, 우선 언급해 볼 것이 서비스에 구성된 디렉토리와 개발에 사용되는 디렉토리의 차이점이다.

웹 애플리케이션은 서블릿 스펙에 따라서 디렉토리가 정해진 규칙을 갖고 있다.

/WEB-INF/ 브라우저를 통해서 접근이 불가능한 웹 애플리케이션 핵심정보들을 포함하고 있는 디렉토리
/WEB-INF/classes/ 패키지에 따른 디렉토리별 class파일과 properties 파일이 위치하는 곳
/WEB-INF/lib/ 웹 애플리케이션에서 사용되는 jar 파일이 존재하는 곳
/META-INF/context.xml 톰캣에서 사용되는 manager를 통한 배포용 웹 애플리케이션 Context정보 파일
브라우저를 통해서 접근 가능한 리소스들은 그 외의 디렉토리에 놓으면 된다.
특히 브라우저의 JVM 위에서 돌아가는 애플릿 class와 관련 jar 들은 /WEB-INF/ 밖에 위치해야 한다.
이 디렉토리들을 묶어서 Context 라고 얘기한다.

서비스와 관련된 디렉토리 구조가 위와 같고, 개발용 디렉토리 구조는 java 파일이라는 특징 때문에 다음과 같이 구성한다.

/src 패키지에 따른 디렉토리별 java 파일과 properties 파일이 존재하는 곳
/WebContent/ 앞에 언급한 브라우저를 통해서 접근 가능한 리소스들. 웹 애플리케이션의 컨텍스트 루트 디렉토리에 해당.
/WebContent/WEB-INF/ 앞에 언급했던 /WEB-INF/ 디렉토리와 같은 성격
/build/classes  /src 하위 자바파일의 컴파일된 class 들이 놓이는 곳. properties 파일은 자동 복사되는 곳.


개발 디렉토리와 WAS의 서비스되는 디렉토리의 매핑 즉 자연스런 연결은 빌드 툴인 ant를 통하거나 Eclipse같은 IDE에서 자동으로 해준다.

이클립스의 경우 Servers 라는 프로젝트가 웹 프로젝트와 별개로 생성이 된다. 여기에서 설정되는 서버의 세팅은 기본적으로 설치된 세팅과 별도로 운영된다. 즉 톰캣이 설치된 디렉토리의 conf 에 있는 설정과는 별개로 Servers하위의 서버별 server.xml 의 파일에 설정된 내용으로 동작이 된다는 뜻이다.
<%= request.getRealPath("/") %> 를 통해서 확인해 보면 이클립스에서 운영하는 디렉토리가 완전히 엉뚱한 곳에 존재함을 알 수 있다. 웹 프로젝트에서 파일을 변경하면 자동으로 파일이 해당 위치로 복사된다.


관련자료:
http://tomcat.apache.org/tomcat-4.1-doc/appdev/index.html 영문
http://www.apache-korea.org/tomcat/tomcat-4.1-doc/appdev/index.html 번역문

context path 변경하는 곳입니다.
Dynamic Web Project 프로퍼티에서 Web Content Settings 를 보면 Context Path를 변경할 수 있습니다.
context path

context path


항목에 아무 것도 없으면 / 를 입력하면 default context 입니다. okjsp 라고 넣으면 주소줄에 자동으로 /okjsp 가 들어갑니다.
단 eclipse 3.3 , WTP2.0 만 됩니다. eclipse 3.2 에서 wtp1.5는 defaultContext가 안 됩니다.

인트로
Introduction

배치자는, 이름이 의미하듯이, 톰캣 서버에 웹 애플리케이션을, 정적으로(서버가 기동하기 전에 설치된 애플리케이션) 또는 동적으로 (톰캣 매니저 웹 애플리케이션이나 이미 배치된 애플리케이션들과 연계하여), 배치하거나 제거하는 역할을 합니다.
The deployer, which as its name imply, allows deploying and undeploying web applications to the Tomcat server, either statically (the application is setup before the server is started), or dynamically (in conjunction with the Tomcat Manager web application or manipulating already deployed applications).

컨텍스트 기술서
Context descriptors

컨텍스트 XML 기술서는 XML 데이터 조각입니다. 메인서버 설정 파일(conf/server.xml)에서 정상적으로 보여질 수 있는 유효한 컨텍스트 엘리먼트를 포함합니다. 그리고 이것은 톰캣에서 다양한 관리 도구를 통해서 쉽게 자동화된 조작이 가능합니다. 호스트에서 컨텍스트 기술서의 위치는 $CATALINA_HOME/conf/[enginename]/[hostname]/foo.xml 입니다. 주의할 것은 파일의 이름은 웹 애플리케이션 이름에 맞지 않아도 되지만, 톰캣이 컨텍스트 기술서를 생성하게 되면 컨텍스트 기술서의 이름은 웹 애플리케이션과 동일하게 맞춰집니다.
A Context XML descriptor is a fragment of XML data which contains a valid Context element which would normally be found in the main server configuration file (conf/server.xml), and allows easy and automated manipulation of web applications by the various management tools available in Tomcat. For a given host, the Context descriptors are located in $CATALINA_HOME/conf/[enginename]/[hostname]/foo.xml. Note that while the name of the file is not tied to the webapp name, Tomcat will create Context descriptors which match the webapp name whenever it will generate a Context descriptor.

컨텍스트 기술서는 컨텍스트의 모든 환경설정 파라미터의 정의가 가능합니다. 예를 들면 네이밍 자원과 세션 매니저 설정같은 것이죠. 또 한 가지 말하자면, 컨텍스트 엘리먼트에 있는 docBase 값은 .WAR 파일을 참조하거나 .WAR파일의 압축이 풀려진 디렉토리를 지정할 수 있습니다.
Context descriptors allow defining all aspects and configuration parameters of a Context, such as namign resources and session manager configuration. It should be noted that the docBase specified in the Context element can refer to either the .WAR or the directory which will be created when the .WAR is expanded or the .WAR itself.

from: http://tomcat.apache.org/tomcat-5.0-doc/deployer-howto.html

운영중인 톰캣에 배치
Deploying on a running Tomcat server

만약 host의 "autoDeploy" 프로퍼티가 true이면, 호스트는 필요할 때마다 동적으로 웹 애플리케이션을 배치 또는 업데이트하려고 시도합니다. host는 자동 리로딩 작업에 필요한 백그라운드 처리가 필요할 것인데, 기본적으로 설정되어 있습니다.
If the host "autoDeploy" property is true, the host will attempt to deploy and update web applications dynamically, as needed. The host will need to have background processing enabled for automatic reloading to work, which is the default.

다음을 포함합니다:

  • host appBase 폴더에 복사된 WAR파일의 배치
  • host appBase 폴더에 복사된 펼쳐진 웹 애플리케이션의 배치
  • WAR파일이 갱신되었을 경우 WAR파일로부터 배치된 웹 애플리케이션의 재배치:
    펼쳐있는 웹 애플리케이션이 제거되고, WAR파일이 다시 압축이 풀립니다. 만약 host의 옵션이 WAR파일은 압축해제되지 않도록 설정되었다면 그렇게 되지 않고, 그런 경우에는 웹 애플리케이션은 단순이 재배치 됩니다.
  • /WEB-INF/web.xml 파일이 갱신된 경우 웹 애플리케이션의 재배치
  • 배치된 웹 애플리케이션의 컨텍스트 XML 파일이 갱신된 경우 웹 애플리케이션의 재배치
  • $CATALINA_HOME/conf/[enginename]/[hostname]/ 폴더에 컨텍스트 XML 파일(이전에 배치된 애플리케이션의 컨텍스트 경로와 일치하는 이름을 가진)이 추가된 경우 웹 애플리케이션의 재배치

주의: 웹 애플리케이션 리로딩은 로더에서 설정될 수 있고, 그런 경우 로드된 클래스는 변경에 대해서 추적됩니다.

This includes:
Deployment of WARs which are copied to the host appBase.
Deployment of expanded web applications which are copied to the host appBase.
Redeployment of a web application which has been deployed from a WAR when the WAR is updated: the expanded web application is removed, and the WAR is expanded again. This will not happen if the host is configured so that WARs are not expanded, in which case the webapp will be simply redeployed.
Redeployment of the web application if the /WEB-INF/web.xml file is updated.
Redeployment of the web application if the context XML file from which the web application has been deployed is updated.
Redeployment of the web application if a context XML file (with a name corresponding to the context path of the previously deployed application) is added in the $CATALINA_HOME/conf/[enginename]/[hostname]/ folder.
Note: Web application reloading can also be configured in the loader, in which case loaded classes will be tracked for changes.
from: http://tomcat.apache.org/tomcat-5.0-doc/deployer-howto.html

클라이언트 디플로이어 패키지를 사용해서 디플로이하기
Deploying using the Client Deployer Package
번역 translated by kenu_AT_okjsp.pe.kr

클라이언트 디플로이어는 운영이나 개발 서버에 웹 애플리케이션을 검증, 컴파일, 배치시킬 수 있는 패키지입니다. 이 기능은 자동 배치를 위해서 톰캣 매니저를 사용한다는 것은 알아야 겠죠.
The client deployer is a package which can be used to validate, compile, and deploy a web application to a production or development server. It should be noted that this feature uses the Tomcat manager for automatic deployment.

이 디플로이어는 카탈리나 매니저 앤트 태스크, 배치 전에 JSP 컴파일을 하기 위한 재스퍼 페이지 컴파일러, 그리고 웹 애플리케이션 배치 기술서를 검증하는 태스크를 포함하고 있습니다. 검증 태스크(org.apache.catalina.ant.ValidatorTask 클래스)는 파라미터 하나만 받습니다: 웹 애플리케이션의 기본 경로
The deployer includes the Catalina manager Ant tasks, the Jasper page compiler for JSP compilation before deployment, as well as a task which validates the webapp's deployment descriptor. The validator task (class org.apache.catalina.ant.ValidatorTask) allows only one parameter: the base path of an expanded web application.

디플로이어는 입력으로 펼쳐진 웹 애플리케이션을 이용합니다(아래에 나와 있는 디플로이어의 프로퍼티 목록 참조). 디플로이어가 프로그램으로 배치하게 되는 웹 애플리케이션은 톰캣에 특화된 배치 설정을 포함할 수도 있습니다. /META-INF/context.xml 안에 있는 컨텍스트 설정 XML 파일이죠.
The deployer uses an unpacked web application as input (see the list of the properties used by the deployer below). A web application which is programatically deployed with the deployer may include Tomcat specific deployment configuration, by including a Context configuration XML file in /META-INF/context.xml.

디플로이어 패키지는 다음과 같은 앤트 스크립트 타겟을 사용할 수 있습니다:

  • compile (default): 웹 애플리케이션을 컴파일하고 검증합니다. 독립적으로 사용될 수 있고, 실행중인 톰캣 서버가 없어도 됩니다. 컴파일된 애플리케이션은 오직 관련된 톰캣 5.0.x버전의 서버에서만 실행됩니다. 다른 버전에서는 동작한다고 보장할 수 없습니다. 재스퍼에 의해 생성된 코드는 실행 컴포넌트에 의존하기 때문입니다. 또 하나 알아야 할 것은 이 compile 타겟은 웹 애플리케이션의 /WEB-INF/classes 폴더 안에 있는 모든 자바 소스는 자동으로 모두 컴파일 해 버린다는 것입니다.
  • deploy: (컴파일 되든 안되든) 웹 애플리케이션을 톰캣 서버로 배치합니다.
  • undeploy: 웹 애플리케이션을 제거.
  • start: 웹 애플리케이션을 시작.
  • reload: 웹 애플리케이션을 릴로드.
  • stop: 웹 애플리케이션을 정지.

The deployer package includes a ready to use Ant script, with the following targets:
compile (default): Compile and validate the web application. This can be used standalone, and does not need a running Tomcat server. The compiled application will only run on the associated Tomcat 5.0.x server release, and is not guaranteed to work on another Tomcat release, as the code generated by Jasper depends on its runtime component. It should also be noted that this target will also compile automatically any Java source file located in the /WEB-INF/classes folder of the web application.
deploy: Deploy a web application (compiled or not) to a Tomcat server
undeploy: Undeploy a web application
start: Start web application
reload: Reload web application
stop: Stop web application

다음 프로퍼티는 시스템 프로퍼티나 또는 디플로이어 패키지의 루트 폴더에 있는 deployer.properties 파일을 통해서 지정할 수 있습니다:

  • build: 기본적으로 사용되는 빌드 폴더는 ${build}/webapp${path} 입니다. compile 타겟의 실행이 마친 후, 웹 애플리케이션 WAR 파일은 ${build}/webapp${path}.war 에 만들어집니다.
  • webapp: 컴파일되고 검증되고, 압축이 풀린 웹 애플리케이션이 담길 폴더. 기본 폴더명은 myapp 입니다.
  • path: 웹 애플리케이션의 배치될 컨텍스트 경로. 기본값은 /myapp.
  • url: 실행중인 톰캣 서버의 매니저 웹애플리케이션에 접근할 수 있는 절대 URL. 여기를 통해서 웹 애플리케이션을 배치(설치) 또는 제거할 수 있습니다. 정해지지 않으면 디플로이어는 로컬호스트에서 돌아가는 톰캣인스턴스의 주소 http://localhost:8080/manager로 접근하려 할 것 입니다.
  • username: 톰캣 매니저 연결용 username.
  • password: 톰캣 매니저 연결용 password.

The following properties can be specified, either as system properties, or by using a deployer.properties file located in the root folder of the deployer package:
build: The build folder used will be, by default, ${build}/webapp${path}. After the end of the execution of the compile target, the web application WAR will be located at ${build}/webapp${path}.war.
webapp: Folder containing the expanded web application which will be compiled and validated. By default, the folder is myapp.
path: Deployed context path of the web application, by default /myapp.
url: Absolute URL to the manager web application of a running Tomcat server, which will be used to deploy and undeploy the web application. By default, the deployer will attempt to access a Tomcat instance running on localhost, at http://localhost:8080/manager.
username: Username to be used to connect to the Tomcat manager.
password: Password to be used to connect to the Tomcat manager.

from: http://tomcat.apache.org/tomcat-5.0-doc/deployer-howto.html

지난 포스트에 이미지만 작뜩 붙여놓고 설명을 하지 못했습니다.
하지만 김풍주님의 도움으로 더 좋은 방법을 알게 되었습니다. 그리고 근원적인 이유도 함께 말이죠.

http://www.eclipse.org/webtools/faq/TomcatServerFAQ.php#info_10
주소에 나와있는 것인데, 톰캣에 왜 META-INF 디렉토리가 있었나 생각했었는데, 컨텍스트 관련한 설치 정보를 넣을 수 있더군요.

곧 좋은 기사를 하나 내놓을 수 있을 듯 합니다. 급방긋 ^_^

+ Recent posts