Thanks, but since there are no packages involved <class name="Media" is fully qualified, isn't it? I tried setting it up with a package structure as you suggest and get the same error. I also tested that the main class can find Media (with or without packages), which it can...
Mike Wannamaker wrote:
The class name must be fully qualified. IE:
package com.me.Media;
class Media { }
<class name="com.me.Media"
--ekiM R&D Hummingbird Core Services 613.548.4355 x4535
-----Original Message-----
From: jim burton [mailto:[EMAIL PROTECTED] Sent: Friday, December 10, 2004 6:42 AM
To: [EMAIL PROTECTED]
Subject: [castor-user] MappingException: Could not find the class...
I'm new to castor and trying to run a little test against mysql, from the tutorial at java boutique but getting a MappingException that I don't understand. This is my mapping.xml:
<mapping> <class name="Media" identity="id"> <map-to table="media" /> <field name="id" type="integer"> <sql name="id" type="integer"/> </field> <field name="type" type="string"> <sql name="type" type="char" /> </field> </class> </mapping>
the Media class is in the same dir as mapping.xml & database.xml & my TestCastor class (no packages involved) which contains the code which initialises JDO:
JDO jdo = new JDO("mydb"); jdo.setConfiguration("database.xml");
evrything compiles OK but running TestCastor gives me this error:
log4j:WARN No appenders could be found for logger (org.exolab.castor.jdo.engine.DatabaseRegistry). log4j:WARN Please initialize the log4j system properly. org.exolab.castor.mapping.MappingException: Could not find the class Media at org.exolab.castor.mapping.loader.MappingLoader.createDescriptor(MappingLoade r.java:396) at org.exolab.castor.jdo.engine.JDOMappingLoader.createDescriptor(JDOMappingLoa der.java:135) at org.exolab.castor.mapping.loader.MappingLoader.loadMapping(MappingLoader.jav a:289) at org.exolab.castor.jdo.engine.JDOMappingLoader.loadMapping(JDOMappingLoader.j ava:324) at org.exolab.castor.mapping.Mapping.getResolver(Mapping.java:291) at org.exolab.castor.jdo.engine.DatabaseRegistry.loadDatabase(DatabaseRegistry. java:295) at org.exolab.castor.jdo.JDO.getDatabase(JDO.java:571) at TestCastor.main(TestCastor.java:11)
----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-user
----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-user
----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-user
