ClassNotFoundException : com.sun.jersey.spi.container.servlet.ServletContainer


In Jersey development, hit following error message on Tomcat.

SEVERE: Servlet /RESTfulExample threw load() exception
  java.lang.ClassNotFoundException: com.sun.jersey.spi.container.servlet.ServletContainer
  at org.apache.catalina.loader.WebappClassLoader.loadClass(
  at org.apache.catalina.loader.WebappClassLoader.loadClass(

Here’s the Maven pom.xml



The “com.sun.jersey.spi.container.servlet.ServletContainer” is included in “jersey-server.jar“, not “jersey-core.jar“.

Actually, to develop REST service with Jersey, you just need to include “jersey-server.jar“, it will download the “jersey-core.jar” dependency automatically.

Tags :

About the Author

Founder of and, love Java and open source stuff. Follow him on Twitter, or befriend him on Facebook or Google Plus. If you like my tutorials, consider make a donation to these charities.


  • Pingback: weblink()

  • Pingback: here()

  • Pingback: water ionizer()

  • Pingback:

  • Pingback:

  • Pingback: loan payment plan()

  • Pingback: pay per day loans plan()

  • Pingback: pay day loans()

  • Pingback: adventure maps()

  • Pingback: payment plan()

  • Pingback: electrical tools for sale()

  • Pingback: electrical license questions()

  • Pingback: house blue()

  • Pingback: zak?ad szklarski piotrków trybunalski()

  • Pingback: h&s plumbers keighley()

  • Pingback: useful reference()

  • Pingback: locksmiths kent wa()

  • Pingback: 24/7 electricians mackay()

  • Pingback: water ionizer loan()

  • Pingback: bottled alkaline water()

  • Pingback: stop parking()

  • Pingback: car parking()

  • Pingback: water ionizer machines()

  • Pingback: laan penge nu og her()

  • Pingback: fue()

  • Pingback: call today()

  • Pingback: stream movies()

  • Pingback: how to loose weight()

  • Pingback: Blue Coaster33()


  • Deco Oliveira

    Thanks a lot

  • Ali Saleh


    I am using Jersey 1.17 and in this version, they moved the class to another Jar (jersey-servlet)

    so the POM must have 3 entries now:




    and that should solve the issue for new Jersey versions.


  • abhishek

    gr8 tutorial i can now able to create rest services for both xml and json.
    but when i tried with my services to support both type (XML + json )it is not working what extra jar and web-xml entry is needed to achive this.
    any one has any idea.

  • Naveen Babu


    I am using JDK 1.5. I am not able to find the jersey servlet jar which is compatible for JDK 1.5.

    Could you please help me on this.

  • Reza

    I’ve tried this tutorial using eclipse juno + maven 3.0 + tomcat7, but I’m still get the error even the jars (jersey-server, jersey-servlet, jersey-bundle) are already there.

    • Reza

      sorry, it seems I’ve made a typo on web.xml. And now everything works fine :)
      thank for your tutorial.

  • http://[email protected] Geoff

    @Suraj Chandran

    Your solution worked for me. Thanks a ton!

  • mazhar

    I tried to run the Hello world program but getting a
    java.lang.ClassNotFoundException: org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap

    please help

  • Naga

    Hey could you please post jersy example with embeded jetty i can find examples any where

  • Kausal Malladi

    I am trying to implement a Hello World application using Jersey but no luck.
    I am getting the following error. I am not using maven. Can you help me with a workaround?
    SEVERE: Servlet /NameSearch threw load() exception
    java.lang.ClassNotFoundException: com.sun.jersey.spi.container.servlet.ServletContainer
    For details of how I implemented the app, please visit the link:

  • http://[email protected] Jose Ayerdis

    The “com.sun.jersey.spi.container.servlet.ServletContainer” is included in “jersey-server.jar“, not “jersey-core.jar“.

    No this class is included in jersey-core but when you added to pom.xml it download the dependency jersey-core.

  • Suraj Chandran

    Note that the new versions of jersey-server does not contain this class, as they have abstracted out it in jersey-servlet.
    So you will have to explicitly add jersey-servlet:


    • Dev

      Thanks Suraj. This tip fixed my problem!

  • sapna

    thanks it helped me a lot :)

  • Juliet


  • Triguna

    Thanks that worked for me.

    • Triguna

      Hey It didnt work for me as I thought it worked. I am still getting the same error. Can you help me? I am using your RESTfulExample code.

  • Priyanka

    I added jersey-bundle1.12.jar and it started working.. you can try the same..

    • adekcz

      Yes, they moved some class, up to date solution is to add jersey-bundle1.12.jar or as name suggest jersey-servlet1.12.jar, both should work.