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 6817167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:00:56+00:00 2026-05-26T21:00:56+00:00

My server side code:- @ApplicationPath(/externalpartnerws) public class ExternalPartnerApplication extends javax.ws.rs.core.Application { public Set<Class<?>> getClasses()

  • 0

My server side code:-

@ApplicationPath("/externalpartnerws")
public class ExternalPartnerApplication extends javax.ws.rs.core.Application {
    public Set<Class<?>> getClasses() {
        return  new HashSet<Class<?>>() { { add(ExternalPartnerApplicationResource.class); } };
  }
}

@Path(value="/retrievetier2")
public class ExternalPartnerApplicationResource {

  /**
   * public constructor according to JSR-3.1.2 specification.
   */
  public ExternalPartnerApplicationResource() {}

  @GET
  @Path("/bycountry/{distributorId}/{countryCd}")
  // type "text/plain"  
  @Produces("application/xml")
  public String retrieveTier2ByCountry(
  @PathParam("distributorId") String distributorId, 
  @PathParam("countryCd") String countryCd
  ) {
      if(distributorId == null && countryCd == null)
          return null;
      else //Moving logic from Controller to (Business) Model.
          return "<?xml version=\"1.0\" encoding=\"UTF-8\"?><retrieveTier2ByCountry/>";
  }

web.xml

<servlet>
    <description>JAX-RS Tools Generated - Do not modify</description>
    <servlet-name>RestServlet</servlet-name>
    <servlet-class>org.apache.wink.server.internal.servlet.RestServlet</servlet-class>
<init-param>
    <param-name>javax.ws.rs.Application</param-name>
    <param-value> 
        com.ibm.drit.lib.extws.ExternalPartnerApplication
    </param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>RestServlet</servlet-name>
    <url-pattern>/retrievetier2/bycountry/*</url-pattern>
</servlet-mapping>

Client:- On Was 7.0 with RAD 8.0.3

RestClient restClient = new RestClient();
Resource resource = restClient.resource("http://localhost:9080/externalpartnerws/retrievetier2/bycountry/distributorId/2/countryCd/2");
resource.contentType(props.getProperty("text/plain"));
resource.accept(props.getProperty("application/xml"));
ClientResponse response = resource.get();
String responseXml = response.getEntity(String.class);   

I am new in Jax-RS and now on a dead-lock condition with small code in Jax-RS.

I am getting

The following error occurred during the invocation of the handlers chain: 404 - Not Found with message ''null'' while processing GET request sent to ......

Am I doing any basic mistake? Last two days I am spending on this.
Please let me know if you require anymore information.

  • 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-26T21:00:57+00:00Added an answer on May 26, 2026 at 9:00 pm

    Looks like either your path or path template is wrong. In the example you are giving, you are sending request to the following path (relative to your app root):

    /bycountry/distributorId/2/countryCd/2
    (i.e. 5 path segments in total: bycountry, distributorId, 2, countryCd, 2)

    However, the template on your resource says:

    /bycountry/{distributorId}/{countryCd}
    (i.e. only 3 path segments: bycountry, {distributorId}, {countryCd})

    That does not match – so you are getting 404.

    Either you should change the URL you are sending your request to like this:
    /bycountry/2/2

    Or you should change the path template on your resource to this: /bycountry/distributorId/{distributorId}/countryCd/{countryCd}

    Then it should work.

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

Sidebar

Related Questions

My question is pretty simple: If you have two web-application components: Server-side (secret-capable) code
In a web application, when your server side code screws up and experiences an
I have a server side code to process uploaded binary files: class UploadHandler(webapp.RequestHandler): def
I am developing one application with GWT as client and my server side code
My server side code: [WebMethod(CacheDuration = 0, EnableSession = true)] public static int UserID()
This is my Server side code: public void ReceivingData(object sender, EventArgs e) { while
The following Server-Side code works: [OperationContract] public IEnumerable<object> GetBooks() { var people = new
i am developing a c2dm server side application and my code like this; string
Developing server side code i finally got my eyes X-crossed trying to write -
When writing server-side code you need to explicitly stop execution after sending a Location:

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.