Hi Bhavna,
I wonder wether you need to call setAllowRedefinitions(true) at all. It
will only take effect if the mapping files you load contain multiple
mappings of the same class.
If you realy need to redefine mappings it now is a bit more complicated
as it had been with 0.9.4. With 0.9.4 your code looked similar to:
Mapping mapping = new Mapping();
mapping.setAllowRedefinitions(true);
mapping.loadMapping("url");
Marshaller marshaller = new Marshaller();
marshaller.setMapping(mapping);
Starting from 1.1 this would be:
Mapping mapping = new Mapping();
mapping.loadMapping("url");
MappingUnmarshaller mum = new MappingUnmarshaller();
mum.setAllowRedefinition(true);
MappingLoader res = mum.getMappingLoader(mapping, BindingType.XML);
ClassDescriptorResolver cdr = ClassDescriptorResolverFactory
.createClassDescriptorResolver(BindingType.XML);
cdr.setMappingLoader(res);
Marshaller marshaller = new Marshaller();
marshaller.setResolver((XMLClassDescriptorResolver) cdr);
Hope this helps
Ralf
Bhavna Passan schrieb:
Hi,
I have following lines of code that work fine against *castor-0.9.4.3*
version.
**
*import* org.exolab.castor.mapping.Mapping;
* *
*import* org.exolab.castor.mapping.MappingException;
/** This method load*s* the Castor Mapping file for use with incoming
* and outgoing transactions.
*/
private void LoadMessageMapping() throws IOException, MappingException
{
messageMapping = new Mapping();
messageMapping.setAllowRedefinitions(true);
messageMapping.setBaseURL(this.sCfgMessageMappingBaseDir);
messageMapping.loadMapping(this.sCfgMessageMappingLoc);
genLogger.log(VISLogger.INFO, "Loaded message mapping file: " +
this.sCfgMessageMappingLoc);
}
On *updating* the castor version* to castor-1.1*, I see following error
message :
"*/The method setAllowRedefinitions(boolean) is undefined for the type
Mapping/*//".
The method "setAllowRedefinitions(boolean)" no longer exists for class
Mapping in castor-1.1 version.
Here is this method's brief explanation from castor-0.9.4.3 version
documentation:
*_ _*
*_setAllowRedefinitions(boolean)_* - Method in class
org.exolab.castor.mapping._Mapping_ Enables or disables the ability to
allow the redefinition of class mappings.
*My Question*: When I use Mapping class from org.exolab.castor.mapping
package from castor-1.1 version, Is their any new method that replaces
functionality of setAllowRedefinitions method that existed in
castor-0.9.4.3 version ?
*Observation: *Method setAllowRedefinitions(boolean allow) does exist
for class MappingUnmarshaller in package org.castor.mapping.
Any help/hints will be appreciated.
Thanks,
Bhavna Passan
------------------------------------------------------------------------
PC Magazine�s 2007 editors� choice for best Web mail�award-winning
Windows Live Hotmail. <http://g.msn.com/8HMBENUS/2728??PS=47575>
--------------------------------------------------------------------- To
unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email
--
Syscon Ingenieurbüro für Meß- und Datentechnik GmbH
Ralf Joachim
Raiffeisenstraße 11
72127 Kusterdingen
Germany
Tel. +49 7071 3690 52
Mobil: +49 173 9630135
Fax +49 7071 3690 98
Internet: www.syscon.eu
E-Mail: [EMAIL PROTECTED]
Sitz der Gesellschaft: D-72127 Kusterdingen
Registereintrag: Amtsgericht Stuttgart, HRB 382295
Geschäftsleitung: Jens Joachim, Ralf Joachim
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email