RCP, RAP 해본지 5일하고, 4일째

배포방법 찾느라 이틀을 검색, 검색, 검색...

삽질 하지 말자.. 그 누구도 이런일 때문에.. 제발!!

 

 

환경 : 리눅스, eclipse indigo, rap 1.5

 

복잡하게 ant 작성하고 이러저러하기엔 시간이 모자르다.

이클립스에서 rap 배포툴을 만들어 두었습니다.

여러 시행착오 끝에 이클립스의 말을 듣고 RCP & RAP 전용 이클립스를 다운받았음에도 불구하고 제대로 안되었던 RAP 배포.  하지만 여태껏 링크걸어둔 싸이트와 검색에 검색을 더해 성공.

 

 

정리된 내용 :

1. rap Demo소스 사용법

2. WAR products Tooling을 이용하여 간단하게 war파일 생성

3. 톰캣 설치

4. war 톰캣에 배치후 실행

5. rap는 어떻게 작동하는 것일까..

 

웹하는 사람이 아니라 모르는 용어들이나 도움될만한 것들을 적다보니 서두 없이 지저분합니다. 

하여 목차를 생각해보면 위와 같습니다.                       

 


 

  •  rap Demo소스 사용법

rap에서 제공 하는 Demo소스를 이용하였습니다.  아래그림은 Rap 환경을 제대로 구축하였을 시 볼수 있는 장면입니다.

 

  • Select the org.eclipse.rap.demo plug-in and use the command Import As > Source Project from the context menu to import org.eclipse.rap.demo as project in your workspace.
  • Import RAP demo project

     

     

     

    프로젝트 war 변형(WAR products Tooling을 사용합니다.) - 그림대로 따라하면 됨

     

     * 하지만 아래 그림의 tool이 없다?

    indigo Update Site, In "Web, XML, Java EE and OSGi Enterprise Development" category, named as "WAR Products (Incubation)"

     

    indigo update 사이트에서 ->

    카테고리 : Web, XML, Java EE and OSGi Enterprise Development

    이름 : WAR Products (Incubation)

    가 깔려 있지 않을 것임.

     

    RCP & RAP 전용 이클립스를 다운받았음에도 이 항목이 존재하지 않았다.

     

    다시 아래 그림대로.

     

     

    • WAR products Tooling을 이용하여 간단하게 war파일 생성

     

    Open the New WAR Product Configuration wizard.
    WAR product wizard

  • Enter a name for the war configuration file and select the RAP Workbench Demo from the available launch configurations.
    WAR pruct configuration
  • The rapdemo.warproduct configuration

    WAR Products tooling provides a form-based multi-page editor to manage a .warproduct configuration. The editor has the following pages:

    • Overview: on this page you can enter additional information like ID, Name, Version but they are not needed to export a war archive. Also the WAR Product export wizard can be started from the Overview page.
      WAR Product editor

    Id, version, Name 적고 아래 Exporting 탭의 Validate 검사후, export wizard 실행 하면 war 파일이 바로 생성됨. 그 전에 아래그림에서 Add Required Plug-ins를 눌러준다.

    • Configuration: Here you can manage which plug-ins and libraries to be included into the war archive.
      WAR Product editor configuration
    • Web.xml: On this page the web.xml of the war archive can be edited.
      WAR Product editor web.xml

     


     

    • 톰캣 설치

    톰캣 설치는 알아서..

    흠. 이클립스를 이용하여 다운 받는 법을 글로만 쓰자면

     

    import project에서

    Web-> WAR file 후 타겟을 선택하는 곳이 있다.

    옆에 New버튼이 있는데 그곳에서 설치하고싶은 버전의 톰캣을 선택후, finish를 누르면 tomcat이 설치된다.

    당황스럽게도 다운받는지 아닌지를 모르겠지만, 하단에 보면 다운중인 표시가 떴던기억이 난다.

     

    암튼 이렇게 대충 설치 후,

     

     흠.. 톰캣 실행 법은 bin폴더에 실행파일이 있다.

    그곳의 .sh로 끝나는 파일을 모두 실행가능 권한을 준다.

     

    startup.sh 과 shutdown.sh 을 통해서 톰캣을 실행/중지 할수 있다.


     

    • war 톰캣에 배치후 실행

     

    Tomcat에 배치

    현재는 Tomcat이 포트 1234에서 실행되도록 구성되어 있지만, Tomcat은 포트 8080에서 실행되는 것이 일반적이다. 내장된 Tomcat 관리자를 사용하여 만들어진 .war 파일을 배치할 수 있다. http:localhost:8080/manager/html로 이동한다.

     

     

    localhost:8080/ 으로 들어가면 tomcat gui에 접속하여 위의 방식으로 war를 배치 할수 있다.

    하지만 아래와 같은 계정설정을 해야 할 것이다.

    conf 폴더 안에 tomcat-users.xml 파일에 아래와 같이 삽입

    <tomcat-users> <user name="admin" password="admin" roles="admin-gui,manager-gui" /> </tomcat-users>

     


    그림 45. Tomcat 관리자를 사용하여 WAR 배치
    Tomcat 관리자를 사용하여 WAR 배치

    "WAR file to deploy" 섹션에 방금 작성한 .war의 파일 이름과 경로를 입력하고 Deploy를 클릭한다. Tomcat에서 WAR을 배치하는 작업을 완료하면localhost:8080/로 이동하여 개인용 태스크 관리 애플리케이션을 실행할 수 있다.

     

     

    http://localhost:8080/rapdemo/rap 로 접속할수 있다.

     

     

     


     

    •  rap는 어떻게 작동하는 것일까.

     

    더 생각해 보자. 이놈의 RAP는 어떻게 작동하는것일까.

     

     

    qooxdoo는 자바스크립트 프레임워크로 UI 스타일이라고 보면 될듯하다.

    http://www.xenomity.com/69

    서버 : tomcat과 war

    클라이언트 : 브라우저(qooxdoo)

     

    1. 서블렛 컨테이너(like tomcat)에 들어오는 HTTP request를 핸들하고 tomcat과 같은 server에게 전달해주는 Servlet Bridge(이 역시 jar며 class 파일의 집합이다)가 존재한다.

     

    2. request를 RWT와 같은 라이브러리 혹은 자신이 연동한(작성한) 프로그램으로 처리한다.

     

    3. 그 결과를 Http Servlet으로 exposing한다.

     

    Servlet Bridge (org.eclipse.equinox.servletbridge) status:green
    Low level hook servlet installed in an existing traditional application server. This servlet launches an embedded Equinox and enables it to handle incoming HTTP requests originally sent to the underlying server.
    HTTP Servlet (org.eclipse.equinox.http.servlet) status:green
    Generic support for exposing another servlet facility (e.g., an underlying application server) as an OSGi HTTP service.

     

    내부적으로는 여튼, 이렇게 통신을 하는것 같다.

     

    조금더 외부적인 동작은 이름따라 RAP는 ajax paltform이다.

    Asynchronous JavaScript + XML의 약어로 음..

     

    http://blog.naver.com/jhoh86?Redirect=Log&logNo=10133727118

     

    이와 같이 돌아가겠지요.

     

     

     

    이것은 이클립스의 equinox에 대한 사이트이다. equinox에 사용된 플러그인(번들)에 대한 설명이 간략하게나마 리스팅 되어있다.

     

    http://eclipse.org/equinox/server/

     

     

    ----------------------------------------------------------------

    [ibm에 정리되어 있는 내용]

    org.eclipse.equinox.servletbridge
    프레임워크를 실행하고 프레임워크를 서블릿 컨테이너로 다시 끌어들일 위치를 제공한다.
    org.eclipse.equinox.servletbridge.http
    서블릿 브릿지로 다시 끌어들이고, OSGi HttpService를 제공할 서블릿 컨테이너로 요청을 프록시한다.
    org.eclipse.equinox.http.servlet
    초기화될 때 OSGi HttpService를 등록하는 http.servletbridge에 의해 사용되는 HttpServiceServlet을 제공한다.
    org.eclipse.equinox.http.registry
    OSGi HttpService를 기반으로 하는 HTTP 컨텍스트 확장점과 서블릿 및 자원을 제공한다.

    http://www.ibm.com/developerworks/kr/opensource/tutorials/os-eclipse-ganymede-pt2/section5.html

     


    링크 -

     

    Rap dev 가이드(deploy 부분) :

    http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.rap.help%2Fhelp%2Fhtml%2Fadvanced%2Fdeployment.html

     

    Rap product Configuration 이 항목에 없을때 :

    http://www.eclipse.org/forums/index.php/m/704357/#msg_704357:

    WAR Product tooling is available from indigo Update Site, In "Web, XML, Java EE and OSGi Enterprise Development" category, named as "WAR Products (Incubation)"

     

    tomcat에 올리기 :

    http://www.ibm.com/developerworks/kr/opensource/tutorials/os-eclipse-ganymede-pt2/section5.html

     

    tomcat 주소에 쓸 주소 :

    http://blog.naver.com/waitzero?Redirect=Log&logNo=70025111691

     

    tomcat gui manager 사용방법

    http://blog.naver.com/artofdata?Redirect=Log&logNo=110149615328

     

     

    qooxdoo 간단 설명 :

    http://www.xenomity.com/69

     

    ajax 간단 설명:

    http://blog.naver.com/jhoh86?Redirect=Log&logNo=10133727118

     

    이클립스 equinox 사이트(서버단에 사용된 플러그인 리스트와 설명) :

    http://eclipse.org/equinox/server/

     

    posted by cozyboy
    :