Hi Keith, Weve put this in and it seems to be working fine for us. Thanks for the help. I added my comments to the bug entry as suggested in your previous mail.
thanks Jim -----Original Message----- From: Keith Visco [mailto:[EMAIL PROTECTED]] Sent: 20 September 2002 22:14 To: [EMAIL PROTECTED] Subject: Re: [castor-dev] Setting org.exolab.castor.xml.naming Configuration Property per M arshaller Instance ... Hi Jim, One work around to this issue is to configure the introspector that is being used by the Unmarshaller. import org.exolab.castor.xml.Introspector; import org.exolab.castor.xml.Unmarshaller; import org.exolab.castor.xml.util.ClassDescriptorResolverImpl; import org.exolab.castor.xml.util.DefaultNaming; ... DefaultNaming naming = new DefaultNaming(); naming.setStyle(DefaultNaming.LOWER_CASE_STYLE); ClassDescriptorResolverImpl cdr = new ClassDescriptorResolverImpl(); cdr.getIntrospector().setNaming(naming); ... Unmarshaller unmarshaller = new Unmarshaller((Class)null); unmarshaller.setResolver(cdr); unmarshaller.setMapping(...); Please note the order of calling #setResolver and #setMapping. Setting a Resolver will nullify any mappings that have been previously set on the Unmarshaller, so make sure you set the ClassDescriptorResolver first, and then if necessary set the mapping second. --Keith Keith Visco wrote: > > Hi Jim, > > Configuration issues like this have cropped up in the past and are sure > to crop up again in the future. I opened a bug report many months ago > regarding this issue, unfortunately I just haven't had too much time to > work on it. > > Please see: > > http://bugzilla.exolab.org/show_bug.cgi?id=897 > > Feel free to add your comments to that bug and add yourself to the cc > list so that you can be informed when changes take place. I'll try to > have some improvements in time of the next release scheduled currently > for Oct 7th. > > Thanks, > > --Keith > > > Jim Barritt wrote: > > > > Hi, > > > > We just ran into a problem using Castor under jboss where there is a > > second castor.properties file insid the tyrex.jar file. > > > > The second properties file has > > > > org.exolab.castor.xml.naming=mixed > > > > Our castor jar has > > > > org.exolab.castor.xml.naming=lower > > > > Depending (almost randomly) on which one gets loaded up first in the > > container, we get different behaviour. > > > > The XML files we are trying to load assume the second type, so > > sometimes they fail to load. > > > > We are working around the problem by explicitly setting the mapping > > for ALL our attributes in the mapping file. > > > > Is it possible to change this property on a per instance basis for the > > Marshaller / UnMarshaller, in the same way that we supply it with a > > mapping file ? If not, could this be a feature request ? > > > > From looking at the code it seems that this gets initialised in a > > singleton which could cause some conflicts if 2 applications are > > sharing a classloader but require different settings. > > > > This would be ideal ... > > > > <code> > > Unmarshaller unmarshaller = new Unmarshaller(_mapping); > > unmarshaller.setDefaultNamingStyle("lower"); > > </code> > > > > But as long as we can set it somehow it would be good. > > > > cheers > > > > Jim > > > > > > This e-mail and any files transmitted with it are confidential and > > intended solely for the use of the individual or entity to whom it is > > addressed. If you have received this e-mail in error you must not > > copy, distribute or take any action in reliance on it. Please notify > > the sender by e-mail or telephone. > > > > We utilise an anti-virus system and therefore any files sent via > > e-mail will have been checked for known viruses. You are however > > advised to run your own virus check before opening any attachments > > received as we will not in any event accept any liability whatsoever > > once an e-mail and/or any attachment is received. Any views expressed > > by an individual within this e-mail do not necessarily reflect the > > views of Systems Union Group plc or any of its subsidiary companies. > > ----------------------------------------------------------- > 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 This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom it is addressed. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Please notify the sender by e-mail or telephone. We utilise an anti-virus system and therefore any files sent via e-mail will have been checked for known viruses. You are however advised to run your own virus check before opening any attachments received as we will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received. Any views expressed by an individual within this e-mail do not necessarily reflect the views of Systems Union Group plc or any of its subsidiary companies. ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev
