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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:10:54+00:00 2026-06-13T07:10:54+00:00

Just started to write my JSON webservices for a carpool engine. I am getting

  • 0

Just started to write my JSON webservices for a carpool engine. I am getting a HTTP 404 error as I try to write my registration API’s.

This is where my problem is

"http://localhost:8081/mCruiseOnCarPool4All/carpool4all/Registration"
HTTP/1.1 405 Method Not Allowed
"http://localhost:8081/mCruiseOnCarPool4All/carpool4all/Registration/Request"
HTTP/1.1 500 Internal Server Error
"http://localhost:8081/mCruiseOnCarPool4All/Registration/Request"
HTTP/1.1 404 Not Found
"http://localhost:8081/mCruiseOnCarPool4All/Registration"
HTTP/1.1 404 Not Found

I know I am missing something really silly here.

Web.xml (Jersey Library)

<servlet>
    <servlet-name>Jersey REST Service</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>com.mcruiseon.carpool4all</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>Jersey REST Service</servlet-name>
    <url-pattern>/carpool4all/*</url-pattern>

RegistrationService.java, only coded the Post method. I am returning errors on all exceptions and ok with sessionkey when successful. You can ignore the code in the post method, I just wanted to share so that you understand my error handling.

package com.mcruiseon.carpool4all;

@Path("/Registration")
public class RegistrationService {
    private ClientSession clientSession ;
    private String sessionKey ;
    private SessionManager sessionManager ;

    @Context
    UriInfo uriInfo;
    @Context
    Request request;

    @POST
    @Path ("Request")
    @Consumes({ MediaType.APPLICATION_JSON })
    public Response post(JAXBElement<AMessageStrategy> element) {
            try {
            clientSession = new ClientSession(God.mCruiseOnServer) ;
        } catch (InvalidServerDNSorIPException e) {
            e.printStackTrace();
            return Response.serverError().build() ;
        }
        sessionKey = sessionManager.setClientSession(clientSession) ;
        clientSession.setSessionKey(sessionKey) ;

        clientSession.getSendQueue().sendRequest(element.getValue()) ;
        try {
            clientSession.waitAndGetResponse(element.getValue()) ;
        } catch (WaitedLongEnoughException e) {
            return Response.serverError().build() ;
        } catch (UnableToResolveResponseException e) {
            return Response.serverError().build() ;
        }
    return Response.ok(sessionKey).build();
    }
}

Junit test case (removed all the HttpConnection code)

ClientIdentityConcrete clientIdentity = new ClientIdentityConcrete("username", "password", "secretkey") ;
RegistrationRequest register = new RegistrationRequest(clientIdentity);
String jsonStr = mapper.writeValueAsString(clientIdentity);
HttpPost request = new HttpPost("http://localhost:8081/mCruiseOnCarPool4All/Registration/Request");
  • 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-13T07:10:56+00:00Added an answer on June 13, 2026 at 7:10 am

    The relevant connection is /mCruiseOnCarPool4All/carpool4all/Registration/Request
    and it return a 500 error so you must have an error stacktrace on your server console.

    The other URLs that you’re showing are hitting 404 cause the URLs are not pointing to your Jersey servlet which seemed to be mapped to /carpool4all

    Your URL pattern is :

     <host>/<app>/<jerseyservlet>/<xml resource>/<method path>
    

    with

     - host = localhost:8081/ (obviously)
     - app = mCruiseOnCarPool4All
     - jerseyservlet = carpool4all
     - xml resource = Registration
     - method path = Request
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just started tinkering with Dart and I decided to write a simple Http Server
I just started with a project that requires me to write to PDF file.
I just started to translate a Matlab code to numpy, how can I write
I've just started learning about parsing, and I wrote this simple parser in Haskell
I have just started learning to write apps for android using Eclipse. Where can
I just started programming in Xcode and I'm trying to write an iphone application.
So I've just started to write tests for my in-progress javascript app, using sinon.js
I just started learning C++ and am currently using codeblocks. I want to write
I've just started using SQLite and I want to write all my application data
I've just started to write an application using the latest version of Rails and

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.