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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:15:35+00:00 2026-06-06T09:15:35+00:00

I’m trying to run Jersey on Jetty on Android. I’ve created an Android that

  • 0

I’m trying to run Jersey on Jetty on Android.

I’ve created an Android that instantiate a Jetty Server with a Jersey Servlet. Anyway when I start Jetty and visit a REST resource (in my case: http://192.168.1.12:8080/api/hello) I get a ContainerException with message: The ResourceConfig instance does not contain any root resource classes. (see exception stack trace below).

Any idea why?

MORE DETAILS:

Logcat is giving the following SEVER WARNINGS.

The following errors and warnings have been detected with resource and/or provider classes:

SEVERE: Missing dependency for field: private java.lang.ThreadLocal com.sun.jersey.server.impl.container.servlet.JSPTemplateProcessor.requestInvoker
SEVERE: Missing dependency for field: private java.lang.ThreadLocal com.sun.jersey.server.impl.container.servlet.JSPTemplateProcessor.requestInvoker

This is strange cause java.lang.ThreadLocal is available for Android and HttpServletRequest and HttpServletResponse should be available since I’ve included servlet-api-2.5.jar in the libs folder.

Jersey is dependent on some javax libraries (jaxb-api-2.2.2.jar,jndi-1.2.1.jar,stax-api-1.0-2.jar) which I had to add to project and set the –core-library parameter temporary to ignore dex warning about javax packages as dependencies.

I also removed the following classes (RenderedImageProvider,DataSourceProvider,MimeMultipartProvider from package com.sun.jersey.core.impl.provider.entity from jersey core jar) to avoid dependencies on java.awt and javax.mail.

EXCEPTION trace:

javax.servlet.UnavailableException: com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.
at org.eclipse.jetty.servlet.ServletHolder.makeUnavailable(ServletHolder.java:409)
at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:450)
at org.eclipse.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:331)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:476)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:517)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:935)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:404)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:184)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:870)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
at org.eclipse.jetty.server.Server.handle(Server.java:346)
at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:596)
at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:1051)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:592)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:214)
at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:426)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:520)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:40)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:528)
at java.lang.Thread.run(Thread.java:1019)

Start Server Android Activity:

public class StartServerActivity extends Activity {

private Server webServer;

private final static String LOG_TAG = "Jetty";


/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.main);

    System.setProperty("java.net.preferIPv4Stack", "true");
    System.setProperty("java.net.preferIPv6Addresses", "false");

    webServer = new Server(8080);

    ServletHolder servletHolder = new ServletHolder(com.sun.jersey.spi.container.servlet.ServletContainer.class);
    servletHolder.setInitParameter("com.sun.jersey.config.property.packages", "com.famenu.server.resources");

    ServletContextHandler servletContextHandler = new ServletContextHandler(webServer, "/api", true, false);
    servletContextHandler.addServlet(servletHolder, "/hello");

    webServer.setHandler(servletContextHandler);


    try {
        webServer.start();
        Log.d(LOG_TAG, "started Web server");

    }
    catch (Exception e) {
        Log.d(LOG_TAG, "unexpected exception starting Web server: " + e);
    }

}

}

Jersey Resource:

package com.famenu.server.resources;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;

@Path(“/”)
public class HelloResource {

@GET
@Produces("text/plain")
public String getMsg() {

    return "Hello Resource";

}

}

I’m using Jetty 7.3.0.v20110203 , Jersey 1.12 , Android 1.6
I arrived till this point after another exception explained here

  • 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-06T09:15:37+00:00Added an answer on June 6, 2026 at 9:15 am

    don’t use package/any other scanning on .. not supported platforms.

    Classnames property: com.sun.jersey.config.property.classnames should work for you (you need to explicitly declare all your root resource (@Path annotated) classes).

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
Specifically, suppose I start with the string string =hello \'i am \' me And
I am doing a simple coin flipping experiment for class that involves flipping a

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.