Hi Saurabh,

for castor's database part you can take a look at test framework under:

src/tests/jdo/tc9x

How this is done with XML I can not be of much help for you.

Ralf


Bhatia Saurabh (DCTI) schrieb:
> Hi All,
> Is it possible to do a mapping for an object hierarchy using polymorphism 
> rather than specifying each child class in the mapping file ?
> Is there an example somewhere for reference ?
> Thanks
> Saurabh
> 
> -----Message d'origine-----
> De : Ralf Joachim [mailto:[EMAIL PROTECTED] 
> Envoyé : mardi, 28. février 2006 00:02
> À : [email protected]
> Objet : Re: [castor-user] Unable to run MappingTool
> 
> Thomas,
> 
> may it be possible that the the full classname of yout Output class is
> com.anabus.gamma.Output which you did not specify when calling 
> MappingTool. It seams it now finds Output put can not load it according 
> to the different package name. You should be aware that MappingTool 
> loads the class specified with classloader. Your commandline should look 
> something like:
> 
> java -cp "%CP%" org.exolab.castor.tools.MappingTool
> -f -i com.anabus.gamma.Output -o output.xml
> 
> With com.anabus.gamma.Output also being on your classpath.
> 
> Ralf
> 
> 
> Thomas A Hurley schrieb:
> 
>>Hi Ralf,
>>
>>Thanks again. When I leave out the .class I get the following stack trace:
>>
>>Exception in thread "main" java.lang.NoClassDefFoundError: Output (wrong
>>name: com/anabus/gamma/Output)
>>        at java.lang.ClassLoader.defineClass1(Native Method)
>>        at java.lang.ClassLoader.defineClass(Unknown Source)
>>        at java.security.SecureClassLoader.defineClass(Unknown Source)
>>        at java.net.URLClassLoader.defineClass(Unknown Source)
>>        at java.net.URLClassLoader.access$100(Unknown Source)
>>        at java.net.URLClassLoader$1.run(Unknown Source)
>>        at java.security.AccessController.doPrivileged(Native Method)
>>        at java.net.URLClassLoader.findClass(Unknown Source)
>>        at java.lang.ClassLoader.loadClass(Unknown Source)
>>        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>>        at java.lang.ClassLoader.loadClass(Unknown Source)
>>        at java.lang.ClassLoader.loadClassInternal(Unknown Source)
>>        at java.lang.Class.forName0(Native Method)
>>        at java.lang.Class.forName(Unknown Source)
>>        at
>>org.exolab.castor.tools.MappingTool.addClass(MappingTool.java:239)
>>        at
>>org.exolab.castor.tools.MappingTool.addClass(MappingTool.java:220)
>>        at org.exolab.castor.tools.MappingTool.main(MappingTool.java:185)
>>
>>I've tried every combination I can think of.
>>
>>Thanks,
>>
>>Tom.
>>
>>
>>
>>>-----Original Message-----
>>>From: Ralf Joachim [mailto:[EMAIL PROTECTED]
>>>Sent: Monday, February 27, 2006 5:30 PM
>>>To: [email protected]
>>>Subject: Re: [castor-user] Unable to run MappingTool
>>>
>>>Hi Thomas,
>>>
>>>can you please try to omit the '.class' and the end of your input class.
>>>For me the following command works:
>>>
>>>java -cp "%CP%" org.exolab.castor.tools.MappingTool
>>>-f -i jdo.test1158.BaseObject -o mapping.xml
>>>
>>>Having said that I recently resolved a issue with above command. If you
>>>get a NullPointerException instead of your ClassNotFoundException you
>>>have to switch to latest CVS to resolve this.
>>>
>>>Regards
>>>Ralf
>>>
>>>
>>>Thomas A Hurley schrieb:
>>>
>>>
>>>>Hi,
>>>>
>>>>Thanks for the quick response Ralf, I tried that also and it didn't
>>>
>>>work. I
>>>
>>>
>>>>have a ";." At the end of my class path which should include the current
>>>>directory where I am trying to execute the command from.
>>>>
>>>>Any other suggestions?
>>>>
>>>>Tom.
>>>>
>>>>
>>>>
>>>>
>>>>>-----Original Message-----
>>>>>From: Ralf Joachim [mailto:[EMAIL PROTECTED]
>>>>>Sent: Monday, February 27, 2006 4:24 PM
>>>>>To: [email protected]
>>>>>Subject: Re: [castor-user] Unable to run MappingTool
>>>>>
>>>>>Hi Thomas,
>>>>>
>>>>>it seams you forgot to also put Output.class on your classpath.
>>>>>
>>>>>Regards
>>>>>Ralf
>>>>>
>>>>>
>>>>>Thomas A Hurley schrieb:
>>>>>
>>>>>
>>>>>
>>>>>>Hi,
>>>>>>
>>>>>>
>>>>>>
>>>>>>I'm having a problem running the MappingTool from a DOS prompt. When I
>>>>>>execute:
>>>>>>
>>>>>>
>>>>>>
>>>>>>java org.exolab.castor.tools.MappingTool -i Output.class -o Output.xml
>>>>>>
>>>>>>
>>>>>>
>>>>>>I get the following stack dump even though I am in the directory
>>>>>>containing the Output.class file.
>>>>>>
>>>>>>
>>>>>>
>>>>>>org.exolab.castor.mapping.MappingException: Nested error:
>>>>>>java.lang.ClassNotFoundException: Output.class
>>>>>>
>>>>>>java.lang.ClassNotFoundException: Output.class
>>>>>>
>>>>>>      at java.net.URLClassLoader$1.run(Unknown Source)
>>>>>>
>>>>>>      at java.security.AccessController.doPrivileged(Native Method)
>>>>>>
>>>>>>      at java.net.URLClassLoader.findClass(Unknown Source)
>>>>>>
>>>>>>      at java.lang.ClassLoader.loadClass(Unknown Source)
>>>>>>
>>>>>>      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>>>>>>
>>>>>>      at java.lang.ClassLoader.loadClass(Unknown Source)
>>>>>>
>>>>>>      at java.lang.ClassLoader.loadClassInternal(Unknown Source)
>>>>>>
>>>>>>      at java.lang.Class.forName0(Native Method)
>>>>>>
>>>>>>      at java.lang.Class.forName(Unknown Source)
>>>>>>
>>>>>>      at
>>>>>>org.exolab.castor.tools.MappingTool.addClass(MappingTool.java:239)
>>>>>>
>>>>>>      at
>>>>>>org.exolab.castor.tools.MappingTool.addClass(MappingTool.java:220)
>>>>>>
>>>>>>      at
>>>>>
>>>>>org.exolab.castor.tools.MappingTool.main(MappingTool.java:185)
>>>>>
>>>>>
>>>>>
>>>>>>My classpath is:
>>>>>>
>>>>>>
>>>>>>
>>>>>>set
>>>>>>classpath=c:\anabus_dev\castor\castor-
>>>>>
>>>>>0.9.9.1.jar;c:\anabus_dev\XOM\lib\xercesImpl.jar;c:\anabus_dev\Apache
>>>>>
>>>>>
>>>>>
>>>>>>Commons\commons-logging.jar;.
>>>>>>
>>>>>>
>>>>>>
>>>>>>Thank you in advance for any help. I've been staring at this so long
>>>>>>that I've got to be doing something stupid.
>>>>>>
>>>>>>
>>>>>>
>>>>>>Tom.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> set
>>>>>>
>>>>>>classpath=c:\anabus_dev\castor\castor-
>>>>>
>>>>>0.9.9.1.jar;c:\anabus_dev\XOM\lib\xercesImpl.jar;c:\anabus_dev\Apache
>>>>>
>>>>>
>>>>>
>>>>>>Commons\commons-
>>>>>
>>>>>logging.jar;C:\backup\anabus_projects\SUN_Studio\gamma\classes;.
>>>>>
>>>>>
>>>>>
>>>>>> java org.exolab.castor.tools.MappingTool -i Output.class -o
>>>>>
>>>>>Output.xml
>>>>>
>>>>>
>>>>>
>>>>>>**AnaBus  **Analytic Business Services, Inc.
>>>>>>
>>>>>>//With //**/better information, we/**// help you
>>>>>>make //**/better decisions./**
>>>>>>
>>>>>> Thomas A. Hurley
>>>>>>
>>>>>> (215) 576-8447 ext.104
>>>>>>
>>>>>> (215) 576-8452 fax
>>>>>>
>>>>>> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
>>>>>>
>>>>>>
>>>>>>
>>>>>-------------------------------------------------
>>>>>If you wish to unsubscribe from this list, please
>>>>>send an empty message to the following address:
>>>>>
>>>>>[EMAIL PROTECTED]
>>>>>-------------------------------------------------
>>>>
>>>>
>>>>
>>>>-------------------------------------------------
>>>>If you wish to unsubscribe from this list, please
>>>>send an empty message to the following address:
>>>>
>>>>[EMAIL PROTECTED]
>>>>-------------------------------------------------
>>>>
>>>
>>>-------------------------------------------------
>>>If you wish to unsubscribe from this list, please
>>>send an empty message to the following address:
>>>
>>>[EMAIL PROTECTED]
>>>-------------------------------------------------
>>
>>
>>
>>-------------------------------------------------
>>If you wish to unsubscribe from this list, please 
>>send an empty message to the following address:
>>
>>[EMAIL PROTECTED]
>>-------------------------------------------------
>>
> 
> 
> -------------------------------------------------
> If you wish to unsubscribe from this list, please 
> send an empty message to the following address:
> 
> [EMAIL PROTECTED]
> -------------------------------------------------
> 
> 
> -------------------------------------------------
> If you wish to unsubscribe from this list, please 
> send an empty message to the following address:
> 
> [EMAIL PROTECTED]
> -------------------------------------------------

-- 

Syscon Ingenieurbüro für
Meß- und Datentechnik GmbH
Ralf Joachim
Raiffeisenstraße 11
D-72127 Kusterdingen
Germany

Tel.   +49 7071 3690 52
Mobil: +49 173 9630135
Fax    +49 7071 3690 98

Email: [EMAIL PROTECTED]
Web:   www.syscon-world.de

-------------------------------------------------
If you wish to unsubscribe from this list, please 
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to