Class not found exception in Java Persistence

For questions and postings not covered by the other forums
ken chiam
Posts: 18
Joined: Tue May 11, 2010 1:34 pm

Class not found exception in Java Persistence

Postby ken chiam » Tue May 11, 2010 1:45 pm

Hi everyone,
I encountered problem when i write a simple Jade persistence unit in Java using NetBeans IDE. I followed exactly from Java persistence white paper published by Jade, but when I excute (run) my application, it shows error message

Exception in thread "main" com.jadeworld.jade.AnnotationException: failure attempting to process annotations for class javaTest.Person from persistence.xml
at com.jadeworld.jade.annotations.AnnotationProcessor.process(AnnotationProcessor.java:178)
at com.jadeworld.jade.entitymanager.Persistence.processRuntimeAnnotations(Persistence.java:48)
at com.jadeworld.jade.entitymanager.Persistence.createEntityManagerFactory(Persistence.java:85)
at com.jadeworld.jade.entitymanager.Persistence.createEntityManagerFactory(Persistence.java:68)
at com.jadeworld.jade.entitymanager.Persistence.createEntityManagerFactory(Persistence.java:63)
at main.Main.init(Main.java:17)
at main.Main.main(Main.java:61)
Caused by: java.lang.ClassNotFoundException: javaTest.Person
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at com.jadeworld.jade.annotations.AnnotationProcessor.process(AnnotationProcessor.java:176)
... 6 more
Java Result: 1
BUILD SUCCESSFUL (total time: 1 second)

My persistence.xml:

<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0" >
<persistence-unit name="JavaTestPU" >
<class>javaTest.Person</class>
<class>javaTest.Address</class>
<class>javaTest.CpxApplication</class>
<class>javaTest.CpxGlobal</class>
<properties>
<property name="jade.database.path" value="C:/Jade63/system"/>
<property name="jade.database.configuration"
value="C:/Jade63/system/jade.ini"/>
<property name="jade.database.multiuser" value="true"/>
<property name="jade.database.username" value="Intern_PengXiang"/>
<property name="jade.database.password" value=""/>
<property name="jade.database.schema" value="CpxSchema"/>
<property name="jade.database.application"
value="CpxApplication "/>
</properties>
</persistence-unit>
</persistence>


I m pretty sure my directory is correct. I placed the persistence.xml directly under the source package directory and my javaTest was also directly under the source package directory. I also imported the javajom.jar into NetBeans libraries. I tried for 3days, but still very clueless where i went wrong. Does anyone knows why? Is there any special steps to take using NetBeans for persistence unit? Please advice. Thanks!

swishy
Posts: 35
Joined: Mon Jun 22, 2009 10:22 am
Location: Christchurch
Contact:

Re: Class not found exception in Java Persistence

Postby swishy » Wed May 19, 2010 1:06 pm

Just covering all bases, I take it the jadrap was up at the time you executed the java application?
No substitute for C.I...... except boost.

ken chiam
Posts: 18
Joined: Tue May 11, 2010 1:34 pm

Re: Class not found exception in Java Persistence

Postby ken chiam » Fri May 21, 2010 2:55 pm

hi swishy, jadrap is Jade Database server right? yup, i have that running in the background when i run my Java app. is it the right way?

swishy
Posts: 35
Joined: Mon Jun 22, 2009 10:22 am
Location: Christchurch
Contact:

Re: Class not found exception in Java Persistence

Postby swishy » Fri May 21, 2010 3:02 pm

hi swishy, jadrap is Jade Database server right? yup, i have that running in the background when i run my Java app. is it the right way?
Sure is, thanks for that, anything in the jommsg log to indicate an issue with the connecting java client?

Cheers
Dale.
No substitute for C.I...... except boost.

ken chiam
Posts: 18
Joined: Tue May 11, 2010 1:34 pm

Re: Class not found exception in Java Persistence

Postby ken chiam » Fri May 21, 2010 5:18 pm

Hi swishy, thanks for ur prompt reply, i do not know how to read the jommsg log, but this is the last entry that i had

2010/05/13 09:00:49.734 010e8-0b88 SCOPERATOR01: (jadrap) Version 6.3.06 - ANSI, OS Version: NT 5.01 build 2600 (Service Pack 3), Wow64: false, Architecture: i686-msoft-win32-ansi
2010/05/13 09:00:49.734 010e8-0b88 SCOPERATOR01: Invocation: "C:\Jade63\bin\jadrap.exe" path=C:\Jade63\system ini=C:\Jade63\system\Jade.ini
2010/05/13 09:00:49.734 010e8-0b88 JadRap: Jade Server starting: version=6.3.06.003 path=C:\Jade63\system
2010/05/13 09:00:50.171 010e8-0b88 PDB: Database initialising with jomdb version: 6.3.06.003, ini=C:/Jade63/system/Jade.ini
2010/05/13 09:00:50.171 010e8-0b88 PDB: System file directory: C:/Jade63/bin/
2010/05/13 09:00:50.171 010e8-0b88 PDB: <<INFO>> IO resource error handling: retry delay = 500ms, retry limit = 2
2010/05/13 09:00:50.218 010e8-0b88 PDB: buffer cache: 16777216 byte heap, buffer cleanup on exit disabled (default), hash modulus = 16336
2010/05/13 09:00:50.265 010e8-166c PDB: BOT <Buffer Overlay>
2010/05/13 09:00:50.265 010e8-1218 PDB: BOT <Bg Flush>
2010/05/13 09:00:50.265 010e8-1af8 PDB: BOT <Database Worker>
2010/05/13 09:00:50.265 010e8-0b88 PDB: Update timestamp for _system.bin: 23 March 2010 05:05:03.813899
2010/05/13 09:00:50.359 010e8-0b88 PDB: <<LICENCE RESTRICTION>>: Total active database size restricted to 2GB
2010/05/13 09:00:50.359 010e8-0b88 TDB: buffer cache: 131072 byte heap, buffer cleanup on exit disabled (default), hash modulus = 1021
2010/05/13 09:00:50.453 010e8-0b88 TDB: buffer cache: 131072 byte heap, buffer cleanup on exit disabled (default), hash modulus = 1021
2010/05/13 09:00:50.515 010e8-167c PDB: ************************************************************************************************
2010/05/13 09:00:50.515 010e8-167c PDB: <<WARNING>> Journal directory: C:/Jade63/system/journals/current/
2010/05/13 09:00:50.515 010e8-167c PDB: <<WARNING>> Journal directory is located on the same volume as your Database
2010/05/13 09:00:50.515 010e8-167c PDB: Database performance compromised; audit I/O will compete with database I/O
2010/05/13 09:00:50.515 010e8-167c PDB: ************************************************************************************************
2010/05/13 09:00:50.515 010e8-167c PDB: Delta logging enabled
2010/05/13 09:00:50.546 010e8-167c PDB: Current journal: C:/Jade63/system/journals/current/db0000000010.log
2010/05/13 09:00:50.656 010e8-167c PDB: CP flushed 0 buffers, et=0 ms
2010/05/13 09:00:50.656 010e8-167c PDB: commit files elapsed time=0
2010/05/13 09:00:50.703 010e8-167c PDB: <<Check Point>> LSN=(10,2748450), minRecoveryLSN=(10,2748450), farthestBackLSN=(10,2748450), elapsed time=41
2010/05/13 09:00:50.734 010e8-167c PDB: <<WARNING>> Archival Recovery not enabled - database availability compromised
2010/05/13 09:00:50.765 010e8-167c PDB: Database: {63ccc4e5-8952-df11-8e23-00101834782e} successfully opened for update, last update jomdb version: 6.3.06.003
2010/05/13 09:00:51.218 010e8-167c PDB: _rootdef.dat[40] opened, add: 119 file bytes, active db size=119 bytes
2010/05/13 09:00:51.546 010e8-167c Jom: Initializing: scm=RootSchema, oid=[1.1], scmNo=1, lvl=1
2010/05/13 09:00:51.546 010e8-167c Jom: Initializing: scm=EPGC_Monitoring, scmOid=[1280.5], scmNo=100, superScmOid=[1.1], superScmNo=1 , lvl=2
2010/05/13 09:00:51.546 010e8-167c Jom: Initializing: scm=Jade, scmOid=[1280.2], scmNo=101, superScmOid=[1.1], superScmNo=1 , lvl=2
2010/05/13 09:00:51.546 010e8-167c Jom: Initializing: scm=SJBSchema, scmOid=[1280.3], scmNo=102, superScmOid=[1.1], superScmNo=1 , lvl=2
2010/05/13 09:00:51.546 010e8-167c Jom: Initializing: scm=CpxSchema, scmOid=[1280.4], scmNo=103, superScmOid=[1.1], superScmNo=1 , lvl=2
2010/05/13 09:00:51.546 010e8-167c Jom: Initializing: Jade is present
2010/05/13 09:00:51.546 010e8-167c Jom: Remote node create: oid=[186.1], node=0x01989168, id=SCOPERATOR011, type=1, cacheCoherency=true
2010/05/13 09:00:51.562 010e8-167c Jom: Local node create: oid=[186.1], node=0x00BE1FB0, id=SCOPERATOR011, type=1
2010/05/13 09:00:51.609 010e8-167c Jom: Background process initialized: 0x01911EB8, oid=[187.1]
2010/05/13 09:00:51.640 010e8-1dfc JomLog: BOT <CacheCoherency>
2010/05/13 09:00:51.640 010e8-0b88 NetMgr: Starting server network = TcpIp_6005
2010/05/13 09:00:51.687 010e8-0b88 SvcMgr: Level:Info Source:LocalHost Message:System initialize ini='' path='C:\Jade63\system'
2010/05/13 11:40:42.968 010e8-167c Jom: Local node delete: oid=[186.1], node=0x00BE1FB0, start time=09:00:51.562, elapsed time=02:39:51.406
2010/05/13 11:40:43.015 010e8-0b88 Jom: Local process delete: oid=[187.1], process=0x1911eb8, no=1, id=5756, type=0 (non-prodn), scm=RootSchema, app=RootSchemaApp, start time=09:00:51.609, elapsed time=02:39:51.406
2010/05/13 11:40:43.015 010e8-1af8 PDB: EOT <Database Worker>
2010/05/13 11:40:43.218 010e8-166c PDB: EOT <Buffer Overlay>
2010/05/13 11:40:43.218 010e8-1218 PDB: EOT <Bg Flush>
2010/05/13 11:40:43.609 010e8-0b88 PDB: CP flushed 9 buffers, et=1 ms
2010/05/13 11:40:43.656 010e8-0b88 PDB: commit files elapsed time=44
2010/05/13 11:40:43.703 010e8-0b88 PDB: <<Check Point>> LSN=(10,2753541), minRecoveryLSN=(10,2753541), farthestBackLSN=(10,2753541), elapsed time=92
2010/05/13 11:40:44.250 010e8-0b88 PDB: _rootdef.dat[40] closed, subtract: 119 file bytes, active db size=0 bytes
2010/05/13 11:40:44.453 010e8-0b88 PDB: Database closed successfully
2010/05/13 11:40:44.687 010e8-1dfc JomLog: EOT <CacheCoherency>
2010/05/13 11:40:44.687 010e8-0b88 JomLog: Persistent NoteMgr : sys hits=0, sys misses=0, sys skips=5
2010/05/13 11:40:44.687 010e8-0b88 JomLog: Persistent NoteMgr : usr hits=0, usr misses=0, usr skips=0
2010/05/13 11:40:44.687 010e8-0b88 JomLog: Transient NoteMgr : sys hits=0, sys misses=0, sys skips=0
2010/05/13 11:40:44.687 010e8-0b88 JomLog: Transient NoteMgr : usr hits=0, usr misses=0, usr skips=0
2010/05/13 11:40:44.687 010e8-0b88 JomLog: Transient NoteMgr : sys hits=0, sys misses=0, sys skips=0
2010/05/13 11:40:44.687 010e8-0b88 JomLog: Transient NoteMgr : usr hits=0, usr misses=0, usr skips=0
2010/05/13 11:40:44.687 010e8-0b88 JadRap: Jade Server exiting
2010/05/13 11:40:44.796 010e8-0b88 SCOPERATOR01: (jadrap) Finished: exit code 0
2010/05/13 14:36:31.312 01018-18cc SCOPERATOR01: (jade) Version 6.3.06 - ANSI, OS Version: NT 5.01 build 2600 (Service Pack 3), Wow64: false, Architecture: i686-msoft-win32-ansi
2010/05/13 14:36:31.328 01018-18cc SCOPERATOR01: Invocation: "C:\Jade63\bin\jade.exe" path=C:\Jade63\system ini=C:\Jade63\system\Jade.ini app=Jade server = singleUser
2010/05/13 14:36:31.312 01018-18cc PDB: Database initialising with jomdb version: 6.3.06.003, ini=C:/Jade63/system/Jade.ini
2010/05/13 14:36:31.328 01018-18cc PDB: System file directory: C:/Jade63/bin/
2010/05/13 14:36:31.328 01018-18cc PDB: <<INFO>> IO resource error handling: retry delay = 500ms, retry limit = 2
2010/05/13 14:36:31.421 01018-18cc PDB: buffer cache: 16777216 byte heap, buffer cleanup on exit disabled (default), hash modulus = 16336
2010/05/13 14:36:31.453 01018-195c PDB: BOT <Buffer Overlay>
2010/05/13 14:36:31.453 01018-1144 PDB: BOT <Bg Flush>
2010/05/13 14:36:31.453 01018-1980 PDB: BOT <Database Worker>
2010/05/13 14:36:31.484 01018-18cc PDB: Update timestamp for _system.bin: 23 March 2010 05:05:03.813899
2010/05/13 14:36:31.921 01018-18cc PDB: <<LICENCE RESTRICTION>>: Total active database size restricted to 2GB
2010/05/13 14:36:31.937 01018-18cc TDB: buffer cache: 131072 byte heap, buffer cleanup on exit disabled (default), hash modulus = 1021
2010/05/13 14:36:32.046 01018-1f78 PDB: ************************************************************************************************
2010/05/13 14:36:32.046 01018-1f78 PDB: <<WARNING>> Journal directory: C:/Jade63/system/journals/current/
2010/05/13 14:36:32.046 01018-1f78 PDB: <<WARNING>> Journal directory is located on the same volume as your Database
2010/05/13 14:36:32.046 01018-1f78 PDB: Database performance compromised; audit I/O will compete with database I/O
2010/05/13 14:36:32.046 01018-1f78 PDB: ************************************************************************************************
2010/05/13 14:36:32.062 01018-1f78 PDB: Delta logging enabled
2010/05/13 14:36:32.140 01018-1f78 PDB: Current journal: C:/Jade63/system/journals/current/db0000000010.log
2010/05/13 14:36:32.250 01018-1f78 PDB: CP flushed 0 buffers, et=0 ms
2010/05/13 14:36:32.250 01018-1f78 PDB: commit files elapsed time=0
2010/05/13 14:36:32.296 01018-1f78 PDB: <<Check Point>> LSN=(10,2753825), minRecoveryLSN=(10,2753825), farthestBackLSN=(10,2753825), elapsed time=47
2010/05/13 14:36:32.312 01018-1f78 PDB: <<WARNING>> Archival Recovery not enabled - database availability compromised
2010/05/13 14:36:32.343 01018-1f78 PDB: Database: {63ccc4e5-8952-df11-8e23-00101834782e} successfully opened for update, last update jomdb version: 6.3.06.003
2010/05/13 14:36:32.843 01018-1f78 PDB: <<LICENCE RESTRICTION>>: Total active database size restricted to 2GB
2010/05/13 14:36:33.156 01018-1f78 PDB: _rootdef.dat[40] opened, add: 119 file bytes, active db size=119 bytes
2010/05/13 14:36:34.406 01018-1f78 Jom: Initializing: scm=RootSchema, oid=[1.1], scmNo=1, lvl=1
2010/05/13 14:36:34.406 01018-1f78 Jom: Initializing: scm=EPGC_Monitoring, scmOid=[1280.5], scmNo=100, superScmOid=[1.1], superScmNo=1 , lvl=2
2010/05/13 14:36:34.406 01018-1f78 Jom: Initializing: scm=Jade, scmOid=[1280.2], scmNo=101, superScmOid=[1.1], superScmNo=1 , lvl=2
2010/05/13 14:36:34.406 01018-1f78 Jom: Initializing: scm=SJBSchema, scmOid=[1280.3], scmNo=102, superScmOid=[1.1], superScmNo=1 , lvl=2
2010/05/13 14:36:34.406 01018-1f78 Jom: Initializing: scm=CpxSchema, scmOid=[1280.4], scmNo=103, superScmOid=[1.1], superScmNo=1 , lvl=2
2010/05/13 14:36:34.406 01018-1f78 Jom: Initializing: Jade is present
2010/05/13 14:36:34.468 01018-1f78 Jom: Remote node create: oid=[186.1], node=0x01860B00, id=SCOPERATOR011, type=5, cacheCoherency=false
2010/05/13 14:36:34.546 01018-1f78 Jom: Local node create: oid=[186.1], node=0x014C1FB0, id=SCOPERATOR011, type=5
2010/05/13 14:36:34.609 01018-1f78 Jom: Background process initialized: 0x017E9840, oid=[187.1]
2010/05/13 14:36:36.968 01018-1acc Jom: Local process sign-on: oid=[187.2], process=0x017ABBC0, no=2, id=6860, type=1 (non-prodn), scm=JadeSchema, app=Jade
2010/05/13 14:36:38.203 01018-1acc Jade: Jade client startup: user=SCOPERATOR01 path=C:\Jade63\system multiUser=false
2010/05/13 14:36:53.671 01018-1acc PDB: epgc_monitoring.dat[51] opened, add: 2383 file bytes, active db size=2502 bytes
2010/05/13 17:23:02.125 01018-1acc Jade: Jade client shutdown
2010/05/13 17:23:03.640 01018-1f78 Jom: Local process delete: oid=[187.2], process=0x17abbc0, no=2, id=6860, type=1 (non-prodn), scm=JadeSchema, app=Jade, start time=14:36:36.968, elapsed time=02:46:26.671
2010/05/13 17:23:04.687 01018-1f78 Jom: Local node delete: oid=[186.1], node=0x014C1FB0, start time=14:36:34.546, elapsed time=02:46:30.140
2010/05/13 17:23:04.718 01018-18cc Jom: Local process delete: oid=[187.1], process=0x17e9840, no=1, id=8056, type=0 (non-prodn), scm=RootSchema, app=RootSchemaApp, start time=14:36:34.609, elapsed time=02:46:30.109
2010/05/13 17:23:04.718 01018-1980 PDB: EOT <Database Worker>
2010/05/13 17:23:04.921 01018-1144 PDB: EOT <Bg Flush>
2010/05/13 17:23:04.921 01018-195c PDB: EOT <Buffer Overlay>
2010/05/13 17:23:05.328 01018-18cc PDB: CP flushed 20 buffers, et=3 ms
2010/05/13 17:23:05.531 01018-18cc PDB: commit files elapsed time=208
2010/05/13 17:23:05.578 01018-18cc PDB: <<Check Point>> LSN=(10,2770551), minRecoveryLSN=(10,2770551), farthestBackLSN=(10,2770551), elapsed time=250
2010/05/13 17:23:06.156 01018-18cc PDB: _rootdef.dat[40] closed, subtract: 119 file bytes, active db size=2383 bytes
2010/05/13 17:23:06.218 01018-18cc PDB: epgc_monitoring.dat[51] closed, subtract: 2383 file bytes, active db size=0 bytes
2010/05/13 17:23:06.437 01018-18cc PDB: Database closed successfully
2010/05/13 17:23:06.703 01018-18cc JomLog: Persistent NoteMgr : sys hits=2, sys misses=2, sys skips=18
2010/05/13 17:23:06.703 01018-18cc JomLog: Persistent NoteMgr : usr hits=0, usr misses=0, usr skips=1
2010/05/13 17:23:06.703 01018-18cc JomLog: Transient NoteMgr : sys hits=0, sys misses=0, sys skips=0
2010/05/13 17:23:06.703 01018-18cc JomLog: Transient NoteMgr : usr hits=0, usr misses=0, usr skips=0
2010/05/13 17:23:06.828 01018-18cc SCOPERATOR01: (jade) Finished: exit code 0

btw, if i m using netBeans IDE, do i need to attach a persistence library to the persistence unit?

thanks for ur help!

swishy
Posts: 35
Joined: Mon Jun 22, 2009 10:22 am
Location: Christchurch
Contact:

Re: Class not found exception in Java Persistence

Postby swishy » Wed May 26, 2010 10:52 am

Hi Ken,

I dont see any jade clients connecting while the Jade Database server is running, you can see the server shutdown at

2010/05/13 11:40:44.796 010e8-0b88 SCOPERATOR01: (jadrap) Finished: exit code 0

all logging post this shows jade clients in single user ( I take it this is from an IDE connection? or was this attempting java connection in singleUser ? )

Cheers
Dale.
No substitute for C.I...... except boost.

hpatel
Posts: 4
Joined: Tue Jun 30, 2009 2:41 pm

Re: Class not found exception in Java Persistence

Postby hpatel » Tue Jun 01, 2010 10:40 am

Hi,

A couple of things:

1. Is the Person class annotated with @Entity tag?
2. Make sure the letter casing is correct through out your project for the package name javaTest

Also, the persistence.xml file should be located under your META-INF folder.

Cheers.

ken chiam
Posts: 18
Joined: Tue May 11, 2010 1:34 pm

Re: Class not found exception in Java Persistence

Postby ken chiam » Mon Jun 21, 2010 1:36 pm

Hi Ken,

I dont see any jade clients connecting while the Jade Database server is running, you can see the server shutdown at

2010/05/13 11:40:44.796 010e8-0b88 SCOPERATOR01: (jadrap) Finished: exit code 0

all logging post this shows jade clients in single user ( I take it this is from an IDE connection? or was this attempting java connection in singleUser ? )

Cheers
Dale.
Hi Dale, Sorry for the late reply, was away from office for a while. I not very familiar with Jade, thanks for telling me that my server is shutdown. I have not decided on single user or server client connection, i am juz trying out to run java code using Jade. I think the code i wrote is trying to connect from an IDE. becoz i am using NetBean to compile while the Jade server is running.

Thanks
ken


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 2 guests