You cannot see this page without javascript.




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:

    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:


Your web service will be accessible through the following URI:



  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
번호 제목 글쓴이 날짜 조회 수
188 [ubuntu] mysql 풀 백업 full backup 가을의 곰을... 2012.09.04 4438
187 일본의 클라우드 대란에서 얻는 교훈 file 가을의 곰을... 2012.09.03 4123
186 ITIL을 통한 효과적인 장애·문제 관리 가을의 곰을... 2012.09.03 2877
185 Ubuntu Samba UTF-8 파일 이름 인코딩 문제 가을의 곰을... 2012.08.28 4476
184 GTK+ 개괄 가을의 곰을... 2012.08.27 4772
183 우분투 에서 smtp 설정 가을의 곰을... 2012.08.27 5158
182 OpenStack 사용기 -우수 공개SW 사례 file 가을의 곰을... 2012.08.27 4387
181 우분투] 12.04 LAMP 서버 설치 file 가을의 곰을... 2012.08.27 4202
180 Ubuntu 복구 가을의 곰을... 2012.08.26 4162
179 인터넷 통계자료가 많은 사이트 모음 가을의 곰을... 2012.08.23 4208
178 넷북 EeePC T101MT에서 Windows 8 구동시키기 가을의 곰을... 2012.08.23 3823
» Ubuntu 12.04에서 Tomcat7과 eclipse 설정하기 가을의 곰을... 2012.08.22 11890
176 그 외 OpenAPI 가을의 곰을... 2012.08.22 3864
175 이통사 OpenAPI 가을의 곰을... 2012.08.22 4125
174 포털 OpenAPI 가을의 곰을... 2012.08.22 4048
173 공공기관 OpenAPI 가을의 곰을... 2012.08.22 3225
172 멀티부팅시 우분투 GRUB 복구하기.. 가을의 곰을... 2012.08.21 5858
171 Hadoop HDFS BASIC Usage Over View : 하둡 사용 개요 가을의 곰을... 2012.08.20 5308
170 HDFS 테스트 file 가을의 곰을... 2012.08.20 4417
169 클라우드 기반의 재해복구 시스템 (DRS system) 구축 분석에 대한 논문 가을의 곰을... 2012.08.20 4508