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

The Archive Base Latest Questions

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

I have a restfull implementation using Jersey and Tomcat7. I have 3 resources called

  • 0

I have a restfull implementation using Jersey and Tomcat7. I have 3 resources called RegionService, ClientService and NoteService defined in my campher.rest package.

When I try to add another resource called TestResource, and Tomcat starts, it gives me the following error below. I don’t understand how /{notes} conflicts with /{test}??
Please help, my hair will thank you.

Aug 22, 2012 2:23:39 AM com.sun.jersey.api.core.ScanningResourceConfig logClasses
INFO: Root resource classes found:
  class campher.rest.NoteService
  class campher.rest.ClientService
  class campher.rest.TestResource
  class campher.rest.RegionService
Aug 22, 2012 2:23:39 AM com.sun.jersey.api.core.ScanningResourceConfig init
INFO: No provider classes found.
Aug 22, 2012 2:23:40 AM com.sun.jersey.server.impl.application.WebApplicationImpl _initiate
INFO: Initiating Jersey application, version 'Jersey: 1.12 02/15/2012 04:51 PM'
Aug 22, 2012 2:23:40 AM com.sun.jersey.spi.inject.Errors processErrorMessages
SEVERE: The following errors and warnings have been detected with resource and/or provider classes:
  SEVERE: Conflicting URI templates. The URI template /{test} for root resource class campher.rest.TestResource and the URI template /{notes} transform to the same regular expression /([^/]+?)(/.*)?
Aug 22, 2012 2:23:40 AM org.apache.catalina.core.ApplicationContext log
SEVERE: StandardWrapper.Throwable

Here are the skeleton implementations of those 4 services.

package campher.rest;
@Path("regions")
public class RegionService {
    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public Response regions() {}

    @POST
    @Consumes(MediaType.APPLICATION_JSON)
    public Region addRegion(Region region){}

    @PUT
    @Consumes(MediaType.APPLICATION_JSON)
    public Region updateRegion(Region region){}

    @GET @Path("{id}")  
    @Produces(MediaType.APPLICATION_JSON)
    public Response getRegion(@PathParam("id") long id) {}

    @DELETE @Path("{id}")   
    @Produces(MediaType.APPLICATION_JSON)
    public Response deleteRegion(@PathParam("id") long id) {}

    @GET @Path("{id}/clients")  
    @Produces(MediaType.APPLICATION_JSON)
    public Response getClients(@PathParam("id") long id) {}
}



package campher.rest;
@Path("clients")
public class ClientService {
    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public Response clients() {}

    @GET @Path("{id}")  
    @Produces(MediaType.APPLICATION_JSON)
    public Response getClient(@PathParam("id") long id) {}

    @GET @Path("{id}/notes")    
    @Produces(MediaType.APPLICATION_JSON)
    public Response getNotes(@PathParam("id") long id) {}

    @GET @Path("{id}/alerts")   
    @Produces(MediaType.APPLICATION_JSON)
    public Response getAlerts(@PathParam("id") long id) {}

    @POST
    @Consumes(MediaType.APPLICATION_JSON)
    public Client addClient(Client client){}

    @PUT
    @Consumes(MediaType.APPLICATION_JSON)
    public Client updateClient(Client client){}

    @DELETE @Path("{id}")   
    @Consumes(MediaType.APPLICATION_JSON)
    public Response deleteClient(@PathParam("id") long id){}
}

package campher.rest;
@Path("{notes}")
public class NoteService {  
    @GET @Path("{id}")  
    @Produces(MediaType.APPLICATION_JSON)
    public Response getNote(@PathParam("id") long id) {}

    @POST
    @Consumes(MediaType.APPLICATION_JSON)
    public Note addNote(Note note){}

    @PUT
    @Consumes(MediaType.APPLICATION_JSON)
    public Note updateNote(Note note){}

    @DELETE @Path("{id}")   
    @Produces(MediaType.APPLICATION_JSON)
    public Response deleteNote(@PathParam("id") long id) {}     
}

package campher.rest;
import javax.ws.rs.Path;
@Path("{test}")
public class TestResource {

}
  • 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-10T04:11:27+00:00Added an answer on June 10, 2026 at 4:11 am
    @Path("test") 
    

    will match <web-root>/test

    @Path("{test}")
    

    will match <web-root>/foo and <web-root>/bar. The word test here is merely the path-param map key to associate foo and bar values.

    Notice the presence and absence of {} around the names. They completely change the meaning of the expression. Their presence indicates that you want to extract that out and put it in an instance variable annotated with @PathParam("name-between-brackets").

    Your @Path("{test}") and @Path("{notes}") both are essentially asking Jersey to look for root URLs of the form http://<host:port>/<webapp>/{capture-text} and copy the capture-text into test and notes path variables respectively. This is ambiguous.

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

Sidebar

Related Questions

I have a RESTful resource in my Rails app called Photo. I'm using Paperclip
I'm using Apache CXF for my restful web services. I have a service defined
I have a custom implementation of a RESTful API for a PHP application that
I have a RestFull grails api that i expose through grails Controller. I need
I have a restfull webservice that requires loading trained model files and to create
I have an WCF RESTFull Service which i need to deploy on IIS6. I
Right now I'm using Controller_Template would like to have RESTful URLs though, is it
I am using restEasy(Restful implementation for jboss) ejb3.0, Jboss5.1.1 AS I did restful service
I have been trying to wrap my head around creating a RESTFul API using
I have a RESTFULL type of web service which can return both xml 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.