Standalone server needs dependencies?


When I connect to embedded server it works good.  But when I connect to a standalone server, it will have invocation errors like can't find getters and setters.  To solve this I had to export my persistence classes to a jar in the server and add it to the class path when starting the server.  There is nothing in the Docs that mention this, so I am wondering if I'm doing it wrong?


The classes are normally not needed on the server. They are needed if you use methods in queries (which is not very efficient and not portable), and the server needs the code to execute the queries.

ObjectDB Support

How do I control whether the queries use methods or not?  My query was a simple select statement with a where clause like where and t.range=:range. In fact I just removed all queries and simply called EntityManager em = emf.createEntityManager(); and it threw the exception 

Exception in thread "main" [ObjectDB 2.8.3] javax.persistence.PersistenceException
Failed to locate set method for field property using reflection (error 363)
    at com.objectdb.jpa.EMF.createEntityManager(
Caused by: com.objectdb.o.UserException: Failed to locate set method for field property using reflection
    at com.objectdb.o.MSG.a(
    at com.objectdb.o.UMR.s(
    at com.objectdb.o.UMR$k.y(
    at com.objectdb.o.MMM.<init>(
    at com.objectdb.o.UTY.g(
    at com.objectdb.o.UTY.C(
    at com.objectdb.o.TYS.k(
    at com.objectdb.o.TYM.Z(
    at com.objectdb.o.TYM.<init>(
    at com.objectdb.o.MST.aA(
    at com.objectdb.o.SHN.X(
    at com.objectdb.o.SHN.Q(
    at com.objectdb.o.SHN.w(
Caused by: java.lang.NoSuchMethodException:
    at java.lang.Class.getDeclaredMethod(
    at com.objectdb.o.UMR$k.y(

Sorry for tripple post, something is wrong with forum.  After edit, it does not save.


It doesn't seem to be related to methods in queries.

Is the stack trace in #3 above generated when the entity classes are not added to the server?

What can you tell about the field: ActionMessage.trackerType, which is mentioned in the exception?

ObjectDB Support

Actually I removed all queries and simply called EntityManager em = emf.createEntityManager(); 

And it still happens.  That method is simply:


    public String getTrackerType() {
        return trackerType;
    public void setTrackerType(String trackerType) {
        this.trackerType = trackerType;

OK I got it working, I had to move the @Id annotation from the getter getUserId() to the field userId.  Then reset the database, then it does not need the POJO in the class path after!


Thank you for the update. This is still unexpected, as the server should work with property access as well, with no need for access to the classes. Anyway, if you are happy with the solution then that is good. If not, you will have to post a minimal runnable example that demonstrates the issue for further investigation of this issue.

ObjectDB Support