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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:39:24+00:00 2026-06-05T18:39:24+00:00

I’m building a REST application with AppEngine Datastore as persistence layer. However I have

  • 0

I’m building a REST application with AppEngine Datastore as persistence layer. However I have a problem using the com.google.appengine.api.datastore.Key within my Resource Class when parsing they key to create a new entry.

Error message is following:
SEVERE: Missing dependency for method public com.acolsolutions.loyaltycard.persistence.entities.Card com.acolsolutions.loyaltycard.resources.CardResource.findByKey(com.google.appengine.api.datastore.Key) at parameter at index 0
SEVERE: Method, public com.acolsolutions.loyaltycard.persistence.entities.Card com.acolsolutions.loyaltycard.resources.CardResource.findByKey(com.google.appengine.api.dat astore.Key), annotated with GET of resource, class com.acolsolutions.loyaltycard.resources.CardResource, is not recognized as valid resource method.

It seems like the problem happens here. Seems that the value cant get converted in to a Key type:


    public Card findByKey(@PathParam("key") Key key) {
    ...
    }

My REST class looks as follows:
import java.util.List;

import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import com.acolsolutions.loyaltycard.dataobjects.CardDAO;
import com.acolsolutions.loyaltycard.persistence.entities.Card;
import com.google.appengine.api.datastore.Key;

@Path("/cards")
public class CardResource {
CardDAO dao = new CardDAO();

@GET
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public List<Card> findAll() {
    System.out.println("findAll");
    return dao.findAll("creationDate desc");
}

@GET
@Path("search/{query}")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public List<Card> findByName(@PathParam("query") String query) {
    System.out.println("findByName: " + query);
    return dao.findByName(query, "creationDate desc");
}


@GET
@Path("{key}")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public Card findByKey(@PathParam("key") Key key) {
    //System.out.println("findByKey " + key.toString());
    return dao.findByKey(key);
}

Can somebody tell me what I have to do to get this working?

Thanks,
Chris

  • 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-05T18:39:25+00:00Added an answer on June 5, 2026 at 6:39 pm

    You can try changing the parameter to String instead of Key and then use com.google.appengine.api.datastore.KeyFactory.stringToKey(String stringKey) to get the Key.

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

Sidebar

Related Questions

I'm making a simple page using Google Maps API 3. My first. One marker
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
We're building an app, our first using Rails 3, and we're having to build
I have thousands of HTML files to process using Groovy/Java and I need to
Thanks in advance for your help. I have a need within an application to
I am using parse_ini_file to read the contents of a file however it is
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 just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't

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.