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

  • Home
  • SEARCH
  • 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 8538045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:03:10+00:00 2026-06-11T11:03:10+00:00

I am trying to implement a jax-rs web service using jersey framework. I have

  • 0

I am trying to implement a jax-rs web service using jersey framework. I have written the web service but I don’t fully understand what the web.xml tags mean so I don’t know if I have configured it correct but when I try to access the service I get an error. Here is the web service:

package org.LMS.Controller;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

@Path ("/test")
public class Test {
    private String name = "Worked";

    @GET
    @Produces (MediaType.APPLICATION_XHTML_XML)
    public String getTest ()
    {
        return name;
    }
}

my web.xml is:

 <!-- Test web service mapping -->
  <servlet> 
    <display-name>Test</display-name>
    <servlet-name>Test</servlet-name>
    <servlet-class>org.LMS.Controller</servlet-class>
    <init-param>
        <param-name>org.LMS.Controller.Test</param-name>
        <param-value>eduscope</param-value>
    </init-param>
  </servlet>
  <servlet-mapping>
    <servlet-name>Test</servlet-name>
    <url-pattern>/test</url-pattern>
  </servlet-mapping>
<!--end Test web service mapping -->

and this is the error I’m getting when I try to access my application:
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: Wrapper cannot find servlet class org.LMS.Controller or a class it depends on
    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:859)
    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
    org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    java.lang.Thread.run(Thread.java:679)
root cause

java.lang.ClassNotFoundException: org.LMS.Controller
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
    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:859)
    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
    org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    java.lang.Thread.run(Thread.java:679)

Can you guys tell me what I’m doing wrong and explain what each tag in the web.xml file means has it relates to web services

  • 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-06-11T11:03:11+00:00Added an answer on June 11, 2026 at 11:03 am

    You’ve set the wrong servlet.
    Assuming that you’re using Jersey, You need to specify your servlet as follows:

    <servlet>
        <servlet-name>Rest</servlet-name>
        <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
        <init-param>
            <param-name>com.sun.jersey.config.property.packages</param-name>
            <param-value>org.LMS.Controller.Test</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Rest</servlet-name>
        <url-pattern>/rest/*</url-pattern>
    </servlet-mapping>
    

    And when you want to access it, you use the following url

    http://(host)[:port]/(context path)/rest/test
    e.g. 
    http://localhost:8080/MyRestProject/rest/test
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Jax-RS and jersey to implement a web service, I can use
I'm getting started in developing web services using JAX-WS. I'm trying to implement classes
Background I am trying to implement a RESTful web service using Apache-CXF that interacts
I have to make a web service using JAX-RPC for a project and I
I am a newbie in web services. I have a JAX-WS service which I
I'm trying to add a custom callback handler to a client web service (JAX-WS),
Im trying to implement pagination using multiple searching criteria. Supposed I Have student table.
Trying to implement Piwik using REST API over http but need a little help.
I am trying to use SharePoint Web service to retrieve list changes but there
I'm trying implement A* Start path finding in my games(which are written with JavaScript,

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.