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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:13:55+00:00 2026-05-23T18:13:55+00:00

Following the example here On deploying a sample resource using the Grizzly container. It

  • 0

Following the example here On deploying a sample resource using the Grizzly container.
It uses a resource that is defined as a class, instead I would like to define an interface with the annotations and have the resource class implements that interface.

The problem now is that Grizzly complains that it can’t find the resource:

com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not     contain any root resource classes.

On Main class, where “com.mycompany.pack” is the package containing the implementation class:

final String baseUri = "http://localhost:9999/";
final Map<String, String> initParams = new HashMap<String, String>();
initParams.put("com.sun.jersey.config.property.packages", "com.mycompany.pack");

[Edit]: It works however when adding the annotations on the class as well.
If there is a way to have the annotations declared only at the interface level.

  • 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-23T18:13:57+00:00Added an answer on May 23, 2026 at 6:13 pm

    You can’t do it with package scanning because that only looks for classes with the JAX-RS annotations on them. You’ll have to use a different approach: either one of the configuration options mentioned in the Jersey user guide that lets you explicitly declare your resource classes, or you could also use jersey-spring to manage your instances. With jersey-spring, there are no extra steps to be able to use an interface like you want to. You just annotate the interface, make the implementation a Spring bean, and it works.

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

Sidebar

Related Questions

Consider the following example : HTML: <div class=wrapper> <div class=left>Some text here</div><div class=right>Hello Stack
Background here . In the above link, the following example is given: class <<
I'm following this example here: http://erikonrails.snowedin.net/?p=230 I added: lib/delayed_job_spec_helper.rb Then in my rspec I
Why in the following example the height of the inner div is not like
Consider the following example: <Grid HorizontalAlignment=Stretch VerticalAlignment=Top> <Line Stroke=Red X1=0 X2=100 Y1=50 Y2=50/> <Line
I lifted the following example from Josh Susser def strip_accents params thunk = lambda
Given the following example code: somefile = new URL(http://somefile.rar); ReadableByteChannel rbc = Channels.newChannel(somefile.openStream()); FileOutputStream
In the following example whenever Grid size is changed, the clipping region size remains
I have am trying to modify the following example and make vertical tabs I
The Debian wiki gives the following example for 'INIT INFO`: ### BEGIN INIT INFO

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.