Keith,

yes it is. After adding in the package structure my arrangement is

src
|-org
   |-jmaid
      |-testcastor
        |-TestCastor.java
        |-Media.java
        |-database.xml
        |-mapping.xml

so I changed my mapping.xml to look like

<mapping>
    <class name="org.jmaid.testcastor.Media" identity="id">

and add package declarations to the TestCastor and Media (everything compiles OK) but then I try:

src]$ java org.jmaid.testcastor.TestCastor

and still get the exception below. Any ideas what the problem might be? I seem to be missing something here, I have all the pieces in place but can't run the test the simplest scenario...:-(

Keith Visco wrote:

Jim,

Did you make sure the directory which contains your class is part of your classpath?

--Keith

jim burton wrote:


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(MappingLoader.java:396)


at org.exolab.castor.jdo.engine.JDOMappingLoader.createDescriptor(JDOMappingLoader.java:135)

at org.exolab.castor.mapping.loader.MappingLoader.loadMapping(MappingLoader.java:289)

at org.exolab.castor.jdo.engine.JDOMappingLoader.loadMapping(JDOMappingLoader.java: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

Reply via email to