0 Replies Latest reply on Apr 9, 2003 6:38 PM by buehren

    In-Memory Persistence?

    buehren Newbie


      I try to use the CMPInMemoryPersistenceManager.java with CMP 2.x in JBoss 3.0.6.

      It seems to be a (the only?) way to access the same data in a Bean from many clients without writing it to a database. Or is there another / a better way?

      So far I have two problems:

      1. There has to be a field called "id" with a unique key in the Bean class (I get an Exception if there is none). Should be no problem now that I found out.
      But what should be in that field?
      (And why does id have to be there? Isn't it possible to use the Primary Key?)

      2. More serious: An InstantiationException is thrown when using the Bean for the first time (home.create() seems to be no problem). I have also created an empty Constructor in my Bean class but that did not change anything. Could you please help?
      at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:30)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
      at java.lang.Class.newInstance0(Class.java:306)
      at java.lang.Class.newInstance(Class.java:259)
      at org.jboss.ejb.plugins.CMPInMemoryPersistenceManager.createBeanClassInstance(CMPInMemoryPersistenceManager.java:135)
      at (....)

      All my files for trying this out:

      Source of CMPInMemoryPersistenceManager.java:

      Thanks a lot in advance!