cancel
Showing results for 
Search instead for 
Did you mean: 

Object not PersistenceCapable

Former Member
0 Kudos

With the tutorial "Getting started with JDO" I implemented an Java-Web-Application.

I created my own tables with different columns.

Coding und deploying of the PersistenceDictionary and the WebJDO were succesfull.

Running the application shows me the Input-View.

On pressing submit the application fails with

"Exception caught javax.jdo.JDOUserException: Object not PersistenceCapable".

In the Java-Class BusinessLogic.java seems to be the error.

The coding line is: pm.makePersistent(sysakt);

Please help me!

Regards

Christian

Accepted Solutions (0)

Answers (4)

Answers (4)

J_B
Explorer
0 Kudos

Hi All,

i have the same problem working with the tutorial.

The buildfile work's fine, if i check or perform the consistency checks. The result is

Buildfile: D:DatenSAPDevelopmentGettingStartedJDOWeb uild.xml

check:

check.Employee:

... catalog path: GettingStartedPersistenceDic/gen_ddic/dbtables/

=> 0 PC class(es) checked (0 failed), 1 non PC class(es) not checked

check.Department:

... catalog path: GettingStartedPersistenceDic/gen_ddic/dbtables/

=> 0 PC class(es) checked (0 failed), 1 non PC class(es) not checked

BUILD SUCCESSFUL

Total time: 991 milliseconds

But if i want enhance the classes i got the following error:

Buildfile: D:DatenSAPDevelopmentGettingStartedJDOWeb uild.xml

enhance:

enhance.Employee:

Error while enhancing: JDO ENHANCER: At least one error occurred while enhancing input class for Transparent Persistence; detailed message(s): I/O error while reading input stream or input stream does not denote a valid Java class.

aborted with errors.

com.sap.jdo.enhancer.EnhancerUserException: JDO ENHANCER: At least one error occurred while enhancing input class for Transparent Persistence; detailed message(s): I/O error while reading input stream or input stream does not denote a valid Java class.

at com.sap.jdo.enhancer.filter.Enhancer.enhanceClassFile(Enhancer.java:238)

at com.sap.jdo.enhancer.Main.enhanceClassFile(Main.java:583)

at com.sap.jdo.enhancer.Main.enhanceInputFiles(Main.java:539)

at com.sap.jdo.enhancer.Main.process(Main.java:157)

at com.sap.jdo.enhancer.Main.main(Main.java:117)

BUILD FAILED: file:D:/Daten/SAP/Development/GettingStartedJDOWeb/build.xml:73: Java returned: 1

Total time: 551 milliseconds

If i work through the Tutorial 'Getting Started with JDO' an run the application i got the error:

Using Java Data Objects (JDO)

Exception caught javax.jdo.JDOUserException: Object not PersistenceCapable. FailedObject:temp.persistence.gettingstarted.jdo.Department@3d7f99 at com.sap.jdo.common.PersistenceManagerImpl.assertPersistenceCapable(PersistenceManagerImpl.java:1818) at com.sap.jdo.common.PersistenceManagerImpl.makePersistentInternal(PersistenceManagerImpl.java:1875) at com.sap.jdo.common.PersistenceManagerImpl.makePersistent(PersistenceManagerImpl.java:738) at com.sap.jdo.jca.cci.SAPJDOConnection.makePersistent(SAPJDOConnection.java:168) at temp.persistence.gettingstarted.jdo.BusinessLogic.createDepartment(BusinessLogic.java:81) at temp.persistence.gettingstarted.web.ProcessInput.doGet(ProcessInput.java:60) at temp.persistence.gettingstarted.web.ProcessInput.doPost(ProcessInput.java:184) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:391) at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:265) at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:345) at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:323) at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:865) at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:240) at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92) at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37) at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(Native Method) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:162)

So my Problem is to make the classes PersistenceCapable. How can i do this.

Thanks for help.

Regard Jürgen

Former Member
0 Kudos

Hi,

I am also getting the same error can you please tell me if you were able to solve the problem.

thanks

Padmaja

guru_subramanianb
Active Contributor
0 Kudos

hi chris,

Before making your java objects pesistent capable you need to do some settings called enhancements.

you have figure out what columns in ur DB should be a primary key and then you need to create a .map class indicating cardinality relations,mapping etc.once this is done thro' JDO enhancer your java objects becomes persitent capable ie "sysakt" ie in ur case here.You have to start a transaction and do ur pesistent coding there ie pm.makePersistent("sysakt");

Remember to close ur transaction after ur finish ur operation with JDO.

Regards,

Guru

Former Member
0 Kudos

Hi Christian,

My suggestion is that you check if the classes that you want to make persistence capable, are enhanced before being deployed. (How you enhance them is also explained in the tutorial, you can also use the sample build.xml to create one for your application.)

Zornitsa