tomcat launch by java application in eclipse ( http://myallforyou.blogspot.kr/2013/01/tomcat-launch-by-java-application-in.html ) 에 이어 resin 을 실행하는 방법을 설명합니다.
1. eclipse > Preferences > Java > Build Path > User Libraries 에서 New 버튼 클릭
2. 사용자 라이브러리명을 입력 ( LIBRARY_RESIN_4.0.32 )
3. Add External JARs... 버튼을 클릭
4. resin 경로의 lib 경로의 jar 파일 추가
5. Project 선택 후, Properties 선택
6. Java Build Path 선택 후, Libraries 탭의 Add Library 버튼 클릭
7. User Library 선택
8. 앞에서 추가한 LIBRARY_RESIN_4.0.32 선택
9. Project 에 resin configiration xml 를 위한 경로 폴더 추가 ( run > resin > resin.4.0.32 ) 후, resin.xml 작성
<!-- - Resin 4.0 configuration file. --> <resin xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin"> <log name="" level="info" path="stdout:" timestamp="[%H:%M:%S.%s] {%{thread}} " /> <logger name="com.caucho" level="info" /> <logger name="com.caucho.java" level="config" /> <logger name="com.caucho.loader" level="config" /> <class-loader> <tree-loader path="${resin.home}/lib" /> </class-loader> <dependency-check-interval>15s</dependency-check-interval> <character-encoding>utf-8</character-encoding> <javac compiler="internal" args="-source 1.6" /> <cluster-default> <resin:import path="${resin.home}/conf/app-default.xml" /> </cluster-default> <cluster id="app-tier"> <root-directory>${server.root}</root-directory> <server-default> <http port="${empty port ? 8080 : port}" /> <memory-free-min>1M</memory-free-min> <thread-max>256</thread-max> <socket-timeout>65s</socket-timeout> <keepalive-max>128</keepalive-max> <keepalive-timeout>15s</keepalive-timeout> </server-default> <server id="" port="6900" /> <host id="" root-directory="${server.root}"> <web-app id="/" document-directory="src/main/webapp"> <servlet-mapping url-pattern="*.html" servlet-name="resin-file" /> <servlet-mapping url-pattern="*.js" servlet-name="resin-file" /> </web-app> </host> </cluster> </resin>
10. Preference > Run/Debug > String Substitution 에 resin4_home 추가 ( resin4 home 경로 )
11. Run Configuration 선택
12. 신규 Java Application 생성 후, 아래와 같이 Main Class 지정
13. Arguments 지정
- Program Arguments
- VM Arguments
- Program Arguments
-conf ${workspace_loc:webapplication}/run/resin/resin.4.0.32/resin.xml
- VM Arguments
-Djava.util.logging.manager=com.caucho.log.LogManagerImpl -Dresin.home=${resin4_home} -Dserver.root=${workspace_loc:webapplication}
16. Run 실행