Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6118205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:24:34+00:00 2026-05-23T15:24:34+00:00

I am getting the following error when i tried to run my Java REST

  • 0

I am getting the following error when i tried to run my Java REST WS on browser:

HTTP Status 500 –


type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Servlet.init() for servlet Jersey REST Service threw exception  
   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)  
   org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)  
   org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)  
   org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)  
   org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)  
java.lang.Thread.run(Unknown Source)  

root cause

com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.  
com.sun.jersey.server.impl.application.RootResourceUriRules.<init>(RootResourceUriRules.java:99)  
com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1298)  
com.sun.jersey.server.impl.application.WebApplicationImpl.access$700(WebApplicationImpl.java:169)  
com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:775)  
com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:771)  
com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193)
com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:771)  
com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:766)  
com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:488) 
com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:318)  
com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:609)
com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:210)
com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:373)  
com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:556)  
javax.servlet.GenericServlet.init(GenericServlet.java:212)  
   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)  
   org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)  
   org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)  
   org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)  
   org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)  
java.lang.Thread.run(Unknown Source)  

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.20 logs.


Apache Tomcat/6.0.20

Let me please know what is the problem?

Do i have to create any servlet for the same??

My java class is as follows:

import javax.ws.rs.GET;  
import javax.ws.rs.Path;  
import javax.ws.rs.Produces;  
import javax.ws.rs.core.MediaType;  


//POJO, no interface no extends  

//The class registers its methods for the HTTP GET request using the @GET annotation.   
//Using the @Produces annotation, it defines that it can deliver several MIME types,  
//text, XML and HTML.   

//The browser requests per default the HTML MIME type.  

//Sets the path to base URL + /hello  
@Path("/hello")  

public class Welcome {  
    // This method is called if TEXT_PLAIN is request  
    @GET  
    @Produces(MediaType.TEXT_PLAIN)  
    public String sayPlainTextHello() {  
        return "Hello Jersey";  
    }  

    // This method is called if XML is request  
    @GET  
    @Produces(MediaType.TEXT_XML)  
    public String sayXMLHello() {  
        return "<?xml version=\"1.0\"?>" + "<hello> Hello Jersey" + "</hello>";  
     }  

    // This method is called if HTML is request  
    @GET  
    @Produces(MediaType.TEXT_HTML)  
    public String sayHtmlHello() {  
        return "<html> " + "<title>" + "Hello Jersey" + "</title>"  
            + "<body><h1>" + "Hello Jersey" + "</body></h1>"   + "</html> ";  
    }  

 }

and web.xml :

http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&#8221; id=”WebApp_ID” version=”2.5″>
Hello

index.html

Jersey REST Service
com.sun.jersey.spi.container.servlet.ServletContainer

<init-param>  
  <param-name>com.sun.jersey.config.property.packages</param-name>  
  <param-value>Hello</param-value>  
</init-param>  

<load-on-startup>1</load-on-startup>  

Jersey REST Service
/rest/*

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T15:24:35+00:00Added an answer on May 23, 2026 at 3:24 pm

    I made the following change in my web.xml and the problem got resolved:

     <init-param>  
          <param-name>com.sun.jersey.config.property.packages</param-name>  
          <param-value>**myPkgName**</param-value>  
        </init-param>  
    

    Regards,
    Sneha

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Am getting following error message on calling WCF service: The formatter threw an exception
I keep getting the following error message when I run my code in debug.
I am getting following error message when using Doctrine ORM in Codeigniter. ( !
I have done simple java app for blackberry, while building am getting following error.
I am getting following error each time I tried to select database. The database
I keep getting the following error when I run the project in Visual Studio
I am getting following error when I am trying to get WebResponse using WebResponse
SOLVED in the last answer im getting following error, dunno where and why? cause
Am trying to insert XML into XML Column.. getting following error: . Msg 6819,
Getting the following error when trying to start a session: Warning: session_start() [function.session-start]: Node

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.