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

  • Home
  • SEARCH
  • 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 8061857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:28:54+00:00 2026-06-05T10:28:54+00:00

In an eclipse c2dm connected project, the c2dm-server.jar is generated for you and added

  • 0

In an eclipse c2dm connected project, the c2dm-server.jar is generated for you and added to your project. If you dig inside the source for it you’ll see that it’s pretty much the same as the source from the original chrometophone project:

http://code.google.com/p/chrometophone/source/browse/trunk/appengine/c2dm/com/google/android/c2dm/server/C2DMConfigLoader.java?r=2

But there’s one big difference: the InputStream line was changed from:

InputStream is = this.getClass().getClassLoader()
                                .getResourceAsStream("/dataMessagingToken.txt");

To

InputStream is = servletContext.getResourceAsStream("/dataMessagingToken.txt");

The big difference being that you now require a ServletContext and not just any class to grab that dataMessagingToken.txt resource out of the war. The only reason I ask is because I’m trying to reinstate that old style line thus not requiring a ServletContext to get that resource, but for whatever reason that line no longer works and it can never find the file. (to be clear, I’ve tried putting that file in the war’s base directory as the default project had it, and also in the /WEB-INF/classes directory also as others have suggested)

One last thing, for those wondering why I want to do this and not just pass a ServletContext. It’s because I want to do the sending from the task queue and not from any user interaction. So I’m probably going about this all the wrong way, but I feel I’m close .

Thanks!

  • 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-05T10:28:56+00:00Added an answer on June 5, 2026 at 10:28 am

    You can fight this, or I think you will find that tasks in a task queue are executed as servlets and will also have a ServletContext.

    Also, if not passed down through your calls, you should be able to get it anywhere via:

    getThreadLocalRequest().getSession().getServletContext()

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

Sidebar

Related Questions

Eclipse is really bugging me with this. I have an Android project that is
Eclipse has stopped compiling the jar files to my android project, when i deploy
Eclipse project, I have Subversion set to ignore the bin directory, and also within
Eclipse is complaining about my Android project saying all my references to resources are
Eclipse STS is reporting I have problem with my spring project. It's a fresh
Eclipse has a feature Add unimplemented methods that adds the unimplemented methods for a
Eclipse has pretty cool JPA Structure and JPA Detail views along with a persistence.xml
Problem with the new App engine connected android application projects for the google eclipse
Eclipse Helios: 40+ project working set, using maven (mvn-eclipse plugin) to generate eclipse project
eclipse has a very nice feature. that is when you debug, it reloads changes

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.