[출처] http://lackovic.wordpress.com/2012/05/31/set-up-eclipse-and-tomcat-7-on-ubuntu-12-04-to-create-java-restful-web-services-with-jersey/

Set up Eclipse and Tomcat 7 on Ubuntu 12.04 to create Java RESTful Web Services with Jersey

EclipseApache TomcatJersey
  1. Download Eclipse;
  2. use the Eclipse Update Manager to install all packages from the category Web, XML, Java EE Development and OSGi Enterprise Development, except “PHP Development” and the “RAP” Tooling;
  3. while you wait for the installation of the packages you can install tomcat7 by running from terminal:
    sudo apt-get install tomcat7 tomcat7-docs tomcat7-examples tomcat7-admin -y
  4. configure WTP to use Tomcat:
    1. select Windows -> Preferences -> Server -> Runtime Environments;
    2. press Add…;
    3. select “Apache Tomcat v7.0″;
    4. enter “/usr/share/tomcat7″ into the “Tomcat installation directory” field;
    5. press Ok;
  5. create a new “Dynamic Web Project”
    • as Target Runtime select “Apache Tomcat v7.0″;
    • press twice Next;
    • select the “Generate the web.xml deployment descriptor” option at the final dialog;
    • press Finish;
  6. close Eclipse;
  7. to fix the error “Cannot create a server using the selected type” run the following:
    cd ~/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/
    rm org.eclipse.jst.server.tomcat.core.prefs
    rm org.eclipse.wst.server.core.prefs
  8. to fix the error “Could not load the Tomcat server configuration at /usr/share/tomcat7/conf. The configuration may be corrupt or incomplete. /usr/share/tomcat7/conf/catalina.policy (No such file or directory)” run the following commands:
    cd /usr/share/tomcat7
    sudo ln -s /var/lib/tomcat7/conf conf
    sudo ln -s /etc/tomcat7/policy.d/03catalina.policy conf/catalina.policy
    sudo ln -s /var/log/tomcat7 log
    sudo chmod -R 777 /usr/share/tomcat7/conf
  9. log out and log back in;
  10. open Eclipse;
  11. open the server view:
    • go to Window->Show View->Other…;
    • choose the Servers under the Server category;
  12. click on “new server wizard”;
    • choose Apache / Tomcat v7.0 Server and press Next;
    • enter “/usr/share/tomcat7″ into the “Tomcat installation directory” field;
    • press Next;
    • select your project on the left pane under “Available” and press Add> to move it to the right pane under “Configured”;
    • press Finish”;
  13. to be able to start the Tomcat server from Eclipse you need first to stop the one running in background:
    sudo service tomcat7 stop

    and to disable Tomcat to automatically start at boot run:

    경축! 아무것도 안하여 에스천사게임즈가 새로운 모습으로 재오픈 하였습니다.
    어린이용이며, 설치가 필요없는 브라우저 게임입니다.
    https://s1004games.com

    sudo update-rc.d tomcat7 disable
  14. download the zip of Jersey;
  15. put the the jersey jars into the folder “WEB-INF/lib” and add them to the project build path;
  16. create your first RESTful Webservice by following this tutorial by Lars Vogel.

Your web services will be automatically deployed in the following folder:

~/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/

Your web service will be accessible through the following URI:

http://localhost:8080/EclipseProjectName/x/y/z

Where:

  1. x = the root of your service set inside the tag url-pattern in web.xml;
  2. y = the path set for your class
  3. z = the path set for your method
본 웹사이트는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
번호 제목 글쓴이 날짜 조회 수
1195 ePub 의 개요 [전자책 표준] 가을의 곰을... 2009.09.03 30229
1194 ubuntu에서 tcl/tk 설치 가을의 곰을... 2010.08.08 25232
1193 ProGuard - 자바 역컴파일 방지 [1] 가을의 곰을... 2010.01.14 22719
1192 안드로이드 구조분석 wiki file 가을의 곰을... 2010.01.10 22130
1191 C Programming Links 가을의 곰을... 2009.09.02 21174
1190 자바에서 x86 어셈블리로 프로그래밍: x86 Assembly Programming in Java Platform 가을의 곰을... 2011.11.15 20535
1189 ubuntu에서 wxPython 설치하기 가을의 곰을... 2010.08.08 19730
1188 Programatically retrieving data from a website into a database file 졸리운_곰 2017.02.26 18864
1187 ▣ Emacs 사용법 ver 3.0 [1] 가을의 곰을... 2010.01.02 18685
1186 GOF 디자인패턴 file 가을의 곰을... 2009.12.05 17690
1185 emacs 사용법 file 가을의 곰을... 2010.01.03 17418
1184 미래 네트워크 연구 동향 file 가을의 곰을... 2009.12.13 17234
1183 소스인사이트 단축키 (2) 가을의 곰을... 2010.10.11 17003
1182 Android 빌드하여 AVD 생성 및 시뮬에 올리기 file 가을의 곰을... 2010.08.15 16946
1181 기계학습 (머신러닝:Machine Learning) 참고자료 링크 : 머신러닝 : 기계 학습 프로그래밍 자료 졸리운_곰 2014.11.29 16075
1180 Overview of MS Fortran Compiler 가을의 곰을... 2009.09.04 15743
1179 Java GUI 프로그래밍 가을의 곰을... 2011.06.05 15694
1178 < 목표성취의 7단계 > 가을의 곰을... 2009.08.17 15465
1177 JQuery의 힘으로 제작된 17 가지 오픈소스 웹 게임들 가을의 곰을... 2013.01.02 15343
1176 Spring 3 MVC Hello World Example file 가을의 곰을... 2011.11.01 14983
대표 김성준 주소 : 경기 용인 분당수지 U타워 등록번호 : 142-07-27414
통신판매업 신고 : 제2012-용인수지-0185호 출판업 신고 : 수지구청 제 123호 개인정보보호최고책임자 : 김성준 sjkim70@stechstar.com
대표전화 : 010-4589-2193 [fax] 02-6280-1294 COPYRIGHT(C) stechstar.com ALL RIGHTS RESERVED