Ram Chidambaram wrote:
> 
> Hi Arnaud,
> 
> Thanks for you reply. I'm using a mapping file which defines the 'bind-xml'
> + 'name' to define the name of elements and attributes (also 'map-to'->'xml'
> for the root element).
> 
> Does 'castor.properties' apply for this scenario as well?

No. castor.proprerties naming is only for introspection or when a name
isn't specified in the mapping file.

> 
> Also, why am I seeing this inconsistent behaviour (works most of the times
> and occasionally (with heavy load), I see the output XML created using the
> default castor behaviour instead of using the mapping file)

Once the Mapping is loaded you should be able to access it as many times
as you want, since the Marshaller doesn't save any information in the
mapping, it just gets information from it.

The Marshaller is not meant to be shared...make sure you always create a
new one.

Make sure you don't call the static Marshaller#marshal methods as these
methods won't have access to any mapping file that has been set.

--Keith

> 
> Thanks for your time.
> 
> Ram.
> 
> -----Original Message-----
> From: Arnaud Blandin [mailto:[EMAIL PROTECTED]]
> Sent: 2002/01/30 10:09 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [castor-dev] Castor XML --> Marshalling problem.
> 
> Hi Ram,
> 
> You should take a look at the castor.properties file:
> 
> # Defines the Naming "style" or conventions to use when
> # creating XML names from Java class or field names.
> # Valid values are as follows:
> # -----------------------------------------------------------------
> # lower (default)  |  All names are lowercase with hyphens
> #                  |  separating words.
> #                  |
> #                  |  Example: personInfo = person-info
> # -----------------------------------------------------------------
> # mixed            |  All names are mixed case, with Uppercase
> #                  |  character as the first letter of a new word.
> #                  |
> #                  |  Example: personInfo = personInfo
> #                  |  Example: FooBar     = fooBar
> # -----------------------------------------------------------------
> # {Any ClassName}  |  Any Class which implements
> #                  |  org.exolab.castor.xml.XMLNaming
> # -----------------------------------------------------------------
> #
> # By default all names are treated as the "lower" option.
> # To preserve the Java mixed-case conventions simply
> # uncomment the following line.
> #
> #org.exolab.castor.xml.naming=mixed
> 
> Arnaud
> 
> > -----Original Message-----
> > From: Ram Chidambaram [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, January 29, 2002 11:46 PM
> > To: [EMAIL PROTECTED]
> > Subject: [castor-dev] Castor XML --> Marshalling problem.
> >
> > Hello All,
> >
> > I'm using Castor 0.9.3 for mapping XML to java objects and vice versa.
> It
> > has been working really well until recently I hit a problem with
> > marshalling
> > a java object to XML.
> >
> > I'm currently caching the Mapping object (after loading the mapping
> file).
> >
> > Whenever I need to create an XML from a Java Object, I create a new
> > Marshaller(with a new writer) and set the mapping to the cached
> Mapping
> > object and then call the marshal() method. I'm using this in a multi
> > threaded environment.
> >
> > This approach seemed to work for most cases. Just recently I have hit
> a
> > problem with the created XML not reflecting the Mapping file(for XML
> > tags),
> > but with the default XML tags from the java object.
> >
> > eg.
> >
> > Based on the mapping file, If the excepted XML was something like..
> >
> > <OrderInfo>
> >       <OrderType>
> > .....
> > </OrderInfo>
> >
> > and my java Object  'OrderInfo' had a 'set' and 'get' method for
> OrderType
> > (getOrderType, setOrderType..) etc.
> >
> > My out XML is sometimes,
> >
> > <order-info>
> >       <order-type>
> > .....
> > </order-info>
> >
> >
> > I'm not sure why this is happening suddenly. Could this be related to
> > caching of the Mapping object ?
> > I tried going through the mailing list to see if Mapping was thread
> > safe...but couldn't find any info on this.
> >
> > Thanks for all you help.
> >
> > Ram.
> >
> > -----------------------------------------------------------
> > If you wish to unsubscribe from this mailing, send mail to
> > [EMAIL PROTECTED] with a subject of:
> >       unsubscribe castor-dev
> 
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>         unsubscribe castor-dev
> 
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>         unsubscribe castor-dev

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to