Error 363 - Failed to read value of inverse relationship

#1

I've got two objects:

@Entity
public class EEvent {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private long id;

    @ManyToOne(optional=false)
    private ETown town;

    public ETown getTown() {
        return town;
    }
   
    public void setTown(ETown town) {
        this.town = town;
    }

}

And:

@Entity
public class ETown {
    @Id
    private String id;

    @OneToMany(mappedBy="town")
    private Set<EEvent> events;

    public Set<IEvent> getEvents() {
     Set<IEvent> events = new HashSet<IEvent>();
     if(this.events != null) {
      events.addAll(this.events);
     }
     return events;
    }
   
    public void setEvents(Set<EEvent> events) {
        this.events = events;
    }

}

Storing the objects works fine and the relationships (both forward and inverse) behave as expected in the Object DB Explorer, however when I try to read the Event type, I'm getting the following exception. As far as I can tell, I'm very closely mirroring the examples on this site. Any pointers?

 

[ObjectDB 2.2.0] javax.persistence.PersistenceException
Failed to read the value of field com.pvdc.model.entity.EEvent.town using reflection (error 363)
at com.objectdb.jpa.JpaQuery.getResultList(JpaQuery.java:580)
at com.pvdc.odb.ODBHelper.readAllByTypeInternal(ODBHelper.java:249)
at com.pvdc.odb.ODBHelper.access$1(ODBHelper.java:242)
at com.pvdc.odb.ODBHelper$3.execute(ODBHelper.java:126)
at com.pvdc.odb.ODBHelper.executeWrite(ODBHelper.java:158)
at com.pvdc.odb.ODBHelper.dropAllByType(ODBHelper.java:123)
at com.pvdc.odb.ODBHelper.dropAll(ODBHelper.java:117)
at com.pvdc.tests.model.entity.EventEntityTest.setUp(EventEntityTest.java:23)
at junit.framework.TestCase.runBare(TestCase.java:132)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:243)
at junit.framework.TestSuite.run(TestSuite.java:238)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: com.objectdb.o.UserException: Failed to read the value of field com.pvdc.model.entity.EEvent.town using reflection
at com.objectdb.o.MSG.d(MSG.java:74)
at com.objectdb.o.UMR.M(UMR.java:834)
at com.objectdb.o.UMR.z(UMR.java:563)
at com.objectdb.o.UML.v(UML.java:529)
at com.objectdb.o.MMM.af(MMM.java:1021)
at com.objectdb.o.UTY.aH(UTY.java:1239)
at com.objectdb.o.UTY.aG(UTY.java:1211)
at com.objectdb.o.ENH.b(ENH.java:99)
at com.objectdb.o.LDR.G(LDR.java:406)
at com.objectdb.o.LDR.B(LDR.java:153)
at com.objectdb.o.OBC.aK(OBC.java:992)
at com.objectdb.o.OBC.aI(OBC.java:890)
at com.objectdb.o.OBC.UF(OBC.java:789)
at com.objectdb.o.SRB.k(SRB.java:149)
at com.objectdb.o.QRR.m(QRR.java:487)
at com.objectdb.o.QRR.b(QRR.java:188)
at com.objectdb.jpa.JpaQuery.getResultList(JpaQuery.java:575)
... 21 more
Caused by: com.objectdb.o.UserException: Entity is not found: com.pvdc.model.entity.ETown#'002xtown-EventEntityTest'
at com.objectdb.o.MSG.d(MSG.java:61)
at com.objectdb.o.ENT.ab(ENT.java:1310)
at com.objectdb.o.OBC.aI(OBC.java:892)
at com.objectdb.o.OBC.UF(OBC.java:804)
at com.objectdb.o.TYR.aG(TYR.java:662)
at com.objectdb.o.TYR.completeRead(TYR.java:529)
at com.objectdb.o.TYR.readElement(TYR.java:263)
at com.objectdb.o.UTY.readAndAdjust(UTY.java:1318)
at com.objectdb.o.UMR$P.A(UMR.java:915)
at com.objectdb.o.UMR.z(UMR.java:557)
... 35 more

 

#2

It might be a bug.

Could you please attach a project that contains in addition to these two classes also a main with the failed query and a database (or code in the main that populates the database)?

ObjectDB Support
#3

I faced a similar problem with ObjectDB 2.2.7 and 2.2.8 and GlassFish 3.1. I have attached my NetBeans 7.0 project to this email. It is a test project and not the main project that I am doing for university. I have tested both objectdb.jar and objectdb-jee.jar. The same error comes up with both of them. If you help me to find the problem, I will be grateful. I need to know the answer as soon as possible due to time constraints and submission deadline. The error log is as follows:

 

WARNING: DTX5014: Caught exception in beforeCompletion() callback:
[ObjectDB 2.2.8_01] javax.persistence.PersistenceException
Failed to write the value of field property edu.um.fcsit.jpa.entity.Guest.phoneList using enhanced method (error 362)
at com.objectdb.jpa.EMImpl.beforeCompletion(EMImpl.java:338)
at com.sun.enterprise.transaction.JavaEETransactionImpl.commit(JavaEETransactionImpl.java:453)
at com.sun.enterprise.transaction.JavaEETransactionManagerSimplified.commit(JavaEETransactionManagerSimplified.java:867)
at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:5115)
at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:4880)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2039)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1990)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:222)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
at $Proxy127.create(Unknown Source)
at edu.um.fcsit.jpa.ejb.__EJB31_Generated__GuestFacade__Intf____Bean__.create(Unknown Source)
at edu.um.fcsit.jpa.controller.GuestController.create(GuestController.java:84)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.el.parser.AstValue.invoke(AstValue.java:234)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:43)
at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:56)
at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
at javax.faces.component.UICommand.broadcast(UICommand.java:315)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:409)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1534)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:170)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:662)
Caused by: com.objectdb.o.UserException: Failed to write the value of field property edu.um.fcsit.jpa.entity.Guest.phoneList using enhanced method
at com.objectdb.o.MSG.d(MSG.java:74)
at com.objectdb.o.UMR.M(UMR.java:858)
at com.objectdb.o.UMR.x(UMR.java:540)
at com.objectdb.o.UML.u(UML.java:516)
at com.objectdb.o.ENH.c(ENH.java:207)
at com.objectdb.o.ENT.R(ENT.java:729)
at com.objectdb.o.STA.W(STA.java:571)
at com.objectdb.o.STM.G(STM.java:479)
at com.objectdb.o.OBM.bG(OBM.java:871)
at com.objectdb.jpa.EMImpl.beforeCompletion(EMImpl.java:334)
... 54 more
Caused by: java.lang.IllegalArgumentException
at edu.um.fcsit.jpa.entity.Guest.__odbWriteMember(Guest.java:1)
at com.objectdb.o.UMR.y(UMR.java:553)
at com.objectdb.o.UMR.x(UMR.java:537)
... 61 more

#4

Thank you for this report. Please try version 2.2.8_03.

ObjectDB Support
#5

Thank you so much for the help. The problem was solved with 2.2.8_03.

#6

Hello.

I have got same problem:

[ObjectDB 2.4.1_07] javax.persistence.PersistenceException
Failed to write the value of field field org.dyndns.fzoli.mill.server.model.entity.Player.receivedMessages using reflection (error 363)
at com.objectdb.jpa.JpaQuery.getSingleResult(JpaQuery.java:723)
at org.dyndns.fzoli.mill.server.model.dao.PlayerDAO.getPlayer(PlayerDAO.java:44)

[...]

Caused by: com.objectdb.o.UserException: Failed to write the value of field field org.dyndns.fzoli.mill.server.model.entity.Player.receivedMessages using reflection
at com.objectdb.o.MSG.d(MSG.java:74)
at com.objectdb.o.UMR.M(UMR.java:907)
at com.objectdb.o.UMR.x(UMR.java:567)
at com.objectdb.o.UML.u(UML.java:536)
at com.objectdb.o.ENH.d(ENH.java:234)
at com.objectdb.o.ENT.T(ENT.java:851)
at com.objectdb.o.LDR.y(LDR.java:484)
at com.objectdb.o.LDR.x(LDR.java:448)
at com.objectdb.o.LDR.s(LDR.java:161)
at com.objectdb.o.OBC.aN(OBC.java:1076)
at com.objectdb.o.OBC.aM(OBC.java:1019)
at com.objectdb.o.OBC.aL(OBC.java:924)
at com.objectdb.o.OBC.UG(OBC.java:815)
at com.objectdb.o.SRB.l(SRB.java:149)
at com.objectdb.o.QRR.b(QRR.java:187)
at com.objectdb.jpa.JpaQuery.getSingleResult(JpaQuery.java:716)
... 31 more
Caused by: com.objectdb.o._PersistenceException: Failed to write the value of field field org.dyndns.fzoli.mill.server.model.entity.Player.receivedMessages using reflection
at com.objectdb.o._PersistenceException.b(_PersistenceException.java:45)
at com.objectdb.o.JPE.g(JPE.java:142)
at com.objectdb.o.ERR.f(ERR.java:60)
at com.objectdb.o.IVP.h(IVP.java:107)
at com.objectdb.o.IVP.g(IVP.java:87)
at com.objectdb.o.ILP.isEmpty(ILP.java:136)
at com.objectdb.o.TYW.av(TYW.java:477)
at com.objectdb.o.TYW.writeElement(TYW.java:305)
at com.objectdb.o.UMR$P.y(UMR.java:975)
at com.objectdb.o.UMR.x(UMR.java:564)
... 44 more [recursive repeat ...]

My entity classes are:

@Entity
public class Player implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue
    private Long id;

    private int permission = 0, activePermission = 0;

    private boolean validated = false, avatarEnabled = true;

    @Column(nullable = false)
    private String playerName, password, email;

    @Temporal(TemporalType.TIMESTAMP)
    private Date signUpDate = new Date(), signInDate;

    @Embedded
    @OneToOne
    private PersonalData personalData = new PersonalData();

    @Enumerated(EnumType.STRING)
    private OnlineStatus onlineStatus = OnlineStatus.ONLINE;

    @Enumerated(EnumType.STRING)
    private PlayerStatus playerStatus = PlayerStatus.NORMAL;

    @ManyToMany
    private List<Player> friendList = new ArrayList<Player>(),
                         friendWishList = new ArrayList<Player>(),
                         blockedUserList = new ArrayList<Player>();

    @ManyToMany(mappedBy = "friendWishList")
    private List<Player> possibleFriends;

    @ManyToMany(mappedBy = "blockedUserList")
    private List<Player> invisibleUsers;

    @ManyToOne
    private List<Message> postedMessages = new ArrayList<Message>();

    @OneToMany(mappedBy = "address")
    private List<Message> receivedMessages;

    private HashMap<Player, Date> messageReadDates = new HashMap<Player, Date>();

    protected Player() {
    }

[...]

}

@Entity
public class Message implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue
    private Long id;

    @Temporal(TemporalType.TIMESTAMP)
    private Date sendDate = new Date();

    private String text;

    @OneToMany(/*fetch=FetchType.LAZY, cascade=CascadeType.ALL, */mappedBy="postedMessages")
    private Player sender;

    @ManyToOne
    private Player address;

    protected Message() {
    }

[...]

}

 

The used method that read object from database and throws exception:

public Player getPlayer(String name) {
        if (name == null) return null;
        try {
            TypedQuery<Player> query = getEntityManager().createQuery("SELECT p FROM Player p WHERE upper(p.playerName) = upper(:name)", Player.class);
            return query.setParameter("name", name).getSingleResult();
        }
        catch (PersistenceException ex) {
            ex.printStackTrace();
            return null;
        }
    }

Some times other field is the problem that inverse mapped like possibleFriends.

What's the problem?

#7

The error message is similar but the cause may be different since the original problem was fixed.

Please post a working test case (following the posting instructions) in order to demonstrate the problem.

ObjectDB Support
#8

Here's my console test app.

I commented out every line that uses Message class because Player class already throws exception, but Message class will be usefull after Player class will work.

import java.io.Serializable;
import java.util.*;
import javax.persistence.*;

@Entity
class Player implements Serializable {
   
    private static final long serialVersionUID = 1L;
   
    @Id
    @GeneratedValue
    private Long id;
   
    private String playerName;

    @ManyToMany
    private List<Player> friendWishList = new ArrayList<Player>();
   
    @ManyToMany(mappedBy = "friendWishList")
    private List<Player> possibleFriends;
   
//    @ManyToOne
//    private List<Message> postedMessages = new ArrayList<Message>();
//   
//    @OneToMany(mappedBy = "address")
//    private List<Message> receivedMessages;
   
    protected Player() {
    }

    public Player(String playerName) {
        this.playerName = playerName;
    }
   
    public Long getId() {       
        return id;
    }

    public String getPlayerName() {
        return playerName;
    }
   
//    public List<Message> getReceivedMessages() {
//        return receivedMessages;
//    }
//   
//    public List<Message> getPostedMessages() {
//        return postedMessages;
//    }

    public List<Player> getFriendWishList() {
        return friendWishList;
    }

    public List<Player> getPossibleFriends() {
        return possibleFriends;
    }
   
    @Override
    public String toString() {
        return playerName + '#' + getId();
    }
   
}   

//@Entity
//class Message implements Serializable {
//
//    private static final long serialVersionUID = 1L;
//   
//    @Id
//    @GeneratedValue
//    private Long id;
//
//    @Temporal(TemporalType.TIMESTAMP)
//    private Date sendDate = new Date();
//
//    private String text;
//   
//    @OneToMany(mappedBy="postedMessages")
//    private Player sender;
//   
//    @ManyToOne
//    private Player address;
//   
//    protected Message() {
//    }
//   
//    public Message(Player address, String text) {
//        this.address = address;
//        this.text = text;
//    }
//   
//    public Long getId() {
//        return id;
//    }
//
//    public String getText() {
//        return text;
//    }
//
//    public Date getSendDate() {
//        return sendDate;
//    }
//
//    public Player getSender() {
//        return sender;
//    }
//
//    public Player getAddress() {
//        return address;
//    }
//
//    public void setText(String text) {
//        this.text = text;
//    }
//   
//    @Override
//    public String toString() {
//        return "Message#" + getId();
//    }
//   
//}

public class Main {

    private static final String PLAYER1 = "player1", PLAYER2 = "player2";
   
    private static EntityManager db;
   
    private static EntityManager createEntityManager() {
        Map<String, String> properties = new HashMap<String, String>();
        properties.put("javax.persistence.jdbc.user", "admin");
        properties.put("javax.persistence.jdbc.password", "admin");
        EntityManagerFactory emf = Persistence.createEntityManagerFactory("objectdb://localhost:6136/fzoli_bugreport.odb", properties);
        return emf.createEntityManager();
    }
   
    private static boolean isDatabaseEmpty() {
        try {
            return db.createQuery("SELECT count(p) = 0 FROM Player p", Boolean.class).getSingleResult();
        }
        catch (PersistenceException ex) {
            ex.printStackTrace();
            return false;
        }
    }
   
    private static Player getPlayer(String name) {
        if (name == null) return null;
        try {
            TypedQuery<Player> query = db.createQuery("SELECT p FROM Player p WHERE upper(p.playerName) = upper(:name)", Player.class);
            return query.setParameter("name", name).getSingleResult();
        }
        catch (PersistenceException ex) {
            ex.printStackTrace();
            return null;
        }
    }
   
//    private static List<Message> getMessages(String playerName) {
//        if (playerName == null) return null;
//        try {
//            TypedQuery<Message> query = db.createQuery("SELECT m FROM Message m WHERE m.sender.playerName = :name", Message.class);
//            return query.setParameter("name", playerName).getResultList();
//        }
//        catch (PersistenceException ex) {
//            ex.printStackTrace();
//            return null;
//        }
//    }
   
    private static boolean save(Object obj) {
        EntityTransaction tr = db.getTransaction();
        try {
            tr.begin();
            db.persist(obj);
            tr.commit();
        } catch (Exception ex) {
            ex.printStackTrace();
            return false;
        }
        return true;
    }
   
    public static void main(String[] args) {
        db = createEntityManager(); // create database connection
       
        if (isDatabaseEmpty()) { // database is empty, create entity classes
            System.out.println("Initialize test database.");
           
            // create two player
            Player p1 = new Player(PLAYER1);
            save(p1);
            Player p2 = new Player(PLAYER2);
            save(p2);
           
            // add player2 to player1's friend wish list
            p1.getFriendWishList().add(p2);
            save(p1);
           
            // add player1 to player2's friend wish list
            // IF YOU DON'T ADD, NO EXCEPTION SHOULD BE THROWN
            p2.getFriendWishList().add(p1);
            save(p2);
           
//            /* create new message to player1 from player2 */
//            Message m = new Message(p1, "test message");
//            p2.getPostedMessages().add(m);
//            save(m);
//            save(p2);
//           
//            /* create new message to player2 from player1 */
//            m = new Message(p2, "test message 2");
//            p1.getPostedMessages().add(m);
//            save(m);
//            save(p1);
           
            // create new database connection in order to cause exception
            db.close();
            db = createEntityManager();
        }
        else {
            System.out.println("Database already initialized.");
        }
       
        System.out.println("Get " + PLAYER1 + " from database.");
        System.out.println(getPlayer(PLAYER1)); // getPlayer() should cause exception
       
//        System.out.println("Get " + PLAYER1 + "'s messages.");
//        System.out.println(getMessages(PLAYER1)); // getMessages() should cause exception too
       
        db.close();
    }
   
}

And the result:

Database already initialized.
Get player1 from database.
[ObjectDB 2.4.1_07] javax.persistence.PersistenceException
Failed to write the value of field field testcase.Player.possibleFriends using reflection (error 363)
at com.objectdb.jpa.JpaQuery.getSingleResult(JpaQuery.java:723)
at testcase.Main.getPlayer(Main.java:155)
at testcase.Main.main(Main.java:230)
Caused by: com.objectdb.o.UserException: Failed to write the value of field field testcase.Player.possibleFriends using reflection
at com.objectdb.o.MSG.d(MSG.java:74)
at com.objectdb.o.UMR.M(UMR.java:907)
at com.objectdb.o.UMR.x(UMR.java:567)
at com.objectdb.o.UML.u(UML.java:536)
at com.objectdb.o.ENH.d(ENH.java:234)
at com.objectdb.o.ENT.T(ENT.java:851)
at com.objectdb.o.LDR.y(LDR.java:484)
at com.objectdb.o.LDR.x(LDR.java:448)
at com.objectdb.o.LDR.s(LDR.java:161)
at com.objectdb.o.OBC.aN(OBC.java:1076)
at com.objectdb.o.OBC.aL(OBC.java:976)
at com.objectdb.o.OBC.UG(OBC.java:815)
at com.objectdb.o.SRB.l(SRB.java:149)
at com.objectdb.o.QRR.b(QRR.java:187)
at com.objectdb.jpa.JpaQuery.getSingleResult(JpaQuery.java:716)
... 2 more
Caused by: com.objectdb.o._PersistenceException: Failed to write the value of field field testcase.Player.possibleFriends using reflection
at com.objectdb.o._PersistenceException.b(_PersistenceException.java:45)
at com.objectdb.o.JPE.g(JPE.java:142)
at com.objectdb.o.ERR.f(ERR.java:60)
at com.objectdb.o.IVP.h(IVP.java:107)
at com.objectdb.o.IVP.g(IVP.java:87)
at com.objectdb.o.ILP.isEmpty(ILP.java:136)
at com.objectdb.o.TYW.av(TYW.java:477)
at com.objectdb.o.TYW.writeElement(TYW.java:305)
at com.objectdb.o.UMR$P.y(UMR.java:975)
at com.objectdb.o.UMR.x(UMR.java:564)
... 14 more
Caused by: com.objectdb.o.UserException: Failed to write the value of field field testcase.Player.possibleFriends using reflection
at com.objectdb.o.MSG.d(MSG.java:74)
at com.objectdb.o.UMR.M(UMR.java:907)
at com.objectdb.o.UMR.x(UMR.java:567)
at com.objectdb.o.UML.u(UML.java:536)
at com.objectdb.o.ENH.d(ENH.java:234)
at com.objectdb.o.ENT.T(ENT.java:851)
at com.objectdb.o.LDR.y(LDR.java:484)
at com.objectdb.o.LDR.x(LDR.java:448)
at com.objectdb.o.LDR.s(LDR.java:161)
at com.objectdb.o.OBC.aN(OBC.java:1076)
at com.objectdb.o.OBC.aL(OBC.java:976)
at com.objectdb.o.OBC.UG(OBC.java:815)
at com.objectdb.o.SRB.l(SRB.java:149)
at com.objectdb.o.QRR.m(QRR.java:544)
at com.objectdb.o.QRR.b(QRR.java:206)
at com.objectdb.o.QRR.b(QRR.java:651)
at com.objectdb.o.UMR.u(UMR.java:516)
at com.objectdb.o.ENT.loadInverse(ENT.java:1394)
at com.objectdb.o.IVP.h(IVP.java:100)
... 20 more
Caused by: com.objectdb.o._PersistenceException: Failed to write the value of field field testcase.Player.possibleFriends using reflection
at com.objectdb.o._PersistenceException.b(_PersistenceException.java:45)
at com.objectdb.o.JPE.g(JPE.java:142)
at com.objectdb.o.ERR.f(ERR.java:60)
at com.objectdb.o.IVP.h(IVP.java:107)
at com.objectdb.o.IVP.g(IVP.java:87)
at com.objectdb.o.ILP.isEmpty(ILP.java:136)
at com.objectdb.o.TYW.av(TYW.java:477)
at com.objectdb.o.TYW.writeElement(TYW.java:305)
at com.objectdb.o.UMR$P.y(UMR.java:975)
at com.objectdb.o.UMR.x(UMR.java:564)
... 36 more
Caused by: com.objectdb.o.UserException: Failed to write the value of field field testcase.Player.possibleFriends using reflection
at com.objectdb.o.MSG.d(MSG.java:74)
at com.objectdb.o.UMR.M(UMR.java:907)
at com.objectdb.o.UMR.x(UMR.java:567)
at com.objectdb.o.UML.u(UML.java:536)
at com.objectdb.o.ENH.d(ENH.java:234)
at com.objectdb.o.ENT.T(ENT.java:851)
at com.objectdb.o.LDR.y(LDR.java:484)
at com.objectdb.o.LDR.x(LDR.java:448)
at com.objectdb.o.LDR.s(LDR.java:161)
at com.objectdb.o.OBC.aN(OBC.java:1076)
at com.objectdb.o.OBC.aM(OBC.java:1019)
at com.objectdb.o.OBC.aL(OBC.java:924)
at com.objectdb.o.OBC.UG(OBC.java:815)
at com.objectdb.o.SRB.l(SRB.java:149)
at com.objectdb.o.QRR.m(QRR.java:544)
at com.objectdb.o.QRR.b(QRR.java:206)
at com.objectdb.o.QRR.b(QRR.java:651)
at com.objectdb.o.UMR.u(UMR.java:516)
at com.objectdb.o.ENT.loadInverse(ENT.java:1394)
at com.objectdb.o.IVP.h(IVP.java:100)
... 42 more
Caused by: com.objectdb.o._PersistenceException: Failed to write the value of field field testcase.Player.possibleFriends using reflection

[...]
#9

Apparently the problem happens only with non enhanced classes.

Your test seems to run fine with enhancement (-javaagent:objectdb.jar), so as a workaround try using only enhanced classes (which are preferred anyway).

ObjectDB Support

Reply