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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:29:17+00:00 2026-06-12T03:29:17+00:00

i have the following Problem when querying a select from a remote client to

  • 0

i have the following Problem when querying a select from a remote client to apache cayenne server.

For testing purpose i generated only one independent class from one table. I generated the cleint classes (the super- and sub-class) and the Server classes. I started the server like shown in the cayenne tutorial. The log shows me that everythings fine. Now i try to connect with the client like shown in the cayenne tutorial:

    ClientConnection connection = new HessianConnection(
            "http://localhost:8080/hdlist_cayeene_javafx/cayenne-service");
    DataChannel channel = new ClientChannel(connection);
    ObjectContext context = new CayenneContext(channel);

    SelectQuery select = new SelectQuery(Source.class);
    List<Source> sources= context.performQuery(select);
    System.out.println(sources);

When it comes to the line:

    List<Source> sources= context.performQuery(select);

then i get an Exception like this:
java.lang.NoSuchFieldException: id
at java.lang.Class.getDeclaredField(Class.java:1899)
at org.apache.cayenne.reflect.FieldAccessor.lookupFieldInHierarchy(FieldAccessor.java:156)
at org.apache.cayenne.reflect.FieldAccessor.lookupFieldInHierarchy(FieldAccessor.java:165)
at org.apache.cayenne.reflect.FieldAccessor.prepareField(FieldAccessor.java:103)
at org.apache.cayenne.reflect.FieldAccessor.(FieldAccessor.java:49)
at org.apache.cayenne.reflect.PersistentDescriptorFactory.createAccessor(PersistentDescriptorFactory.java:355)
at org.apache.cayenne.reflect.PersistentDescriptorFactory.createAttributeProperty(PersistentDescriptorFactory.java:147)

the crazy thing about it is when i empty the table “Source” then everything works fine and i get an empty list back without any exception.

Also its unclear for me that i can query against all 10 objects in my class set and the exception always hit the first attribute of the selected class. If i look into these classes the field are there. They are inside the abstract classes that the cayenne modeler generates and they have the exact name that the exception gives.

here is the source class on the client:

public abstract class _Source extends PersistentObject {

public static final String ID_PROPERTY = "id";
public static final String NAME_PROPERTY = "name";

protected Long id;
protected String name;

public Long getId() {
    if(objectContext != null) {
        objectContext.prepareForAccess(this, "id", false);
    }

    return id;
}
public void setId(Long id) {
    if(objectContext != null) {
        objectContext.prepareForAccess(this, "id", false);
    }

    Object oldValue = this.id;
    this.id = id;

    // notify objectContext about simple property change
    if(objectContext != null) {
        objectContext.propertyChanged(this, "id", oldValue, id);
    }
}

public String getName() {
    if(objectContext != null) {
        objectContext.prepareForAccess(this, "name", false);
    }

    return name;
}
public void setName(String name) {
    if(objectContext != null) {
        objectContext.prepareForAccess(this, "name", false);
    }

    Object oldValue = this.name;
    this.name = name;

    // notify objectContext about simple property change
    if(objectContext != null) {
        objectContext.propertyChanged(this, "name", oldValue, name);
    }
}

}

and this is the corresponding server class:

public abstract class _Source extends CayenneDataObject {

public static final String ID_PROPERTY = "id";
public static final String NAME_PROPERTY = "name";

public static final String ID_PK_COLUMN = "ID";

public void setId(Long id) {
    writeProperty("id", id);
}
public Long getId() {
    return (Long)readProperty("id");
}

public void setName(String name) {
    writeProperty("name", name);
}
public String getName() {
    return (String)readProperty("name");
}

}

I use Cayenne Server and Client 3.0RC3 on a Jetty WebServer like shown in the cayenne
tutorial.

Does anybody knows why this exception happens?

  • 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-12T03:29:18+00:00Added an answer on June 12, 2026 at 3:29 am

    So i found it out myself:
    The most common reason for this error is you forgot to supply the server with the client-entities as stated here inside the cayenne tutorial:

    https://cwiki.apache.org/CAYDOC12/remote-object-persistence-tutorial-webservice.html

    "As of version 1.2, both client and server persistent classes need to be present on the server (client of course only needs client classes). This is a minor inconvenience that will be addressed in the future releases."
    

    So simply create share-project and do a maven dependency inside the client- and server-project

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

Sidebar

Related Questions

I have the following problem, from c++ I send huge string[] to java. huge
I have the following scenario: I am parsing a JSON Response from a server
I have following problem: I have to make a ASP.NET Webapplication with a two-row
I have following problem: I have built a tabbar application with 4 tabs. I
I have following problem, Code: String a=Yeahh, I have no a idea what's happening
Hi i have following Problem. I write a Mediawiki Extension where i need some
I am using GWT/JAVA for development. I have following problem: I want to remove
I have the following problem. I have embedded a map using Google Maps' API.
I have the following problem in Cakephp: I maded a CMS to edit the
if have the following problem: I have a List which i am going through

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.