Hi Stevo, Stevo Slavić wrote: > Werner, > > Sure, I'll report those issues. > > Spring's CastorMarshaller > <https://src.springframework.org/svn/spring-ws/tags/spring-ws-1.5.7/oxm/src/main/java/org/springframework/oxm/castor/CastorMarshaller.java> > supports > loading either a single class or a collection of mapping.xml files. > Whichever of the two is passed, CastorMarshaller creates > org.exolab.castor.xml.XMLContext from it. > > It turns out that it is easy to extended the CastorMarshaller with support > for specifying packages (String[]) which are fed to the XMLContext via > addPackages method. Yes, we have done the same (had to do the same) in a project recently to get ourselves going, but it is a but of a poor approach .. ;-(.
> It would be great if Spring's support for Castor was > updated to better match as I understand currently recommended way of > providing descriptor data to Castor, that is via descriptor classes (+ > .castor.cdr files) instead of mapping.xml files. That is why I've created > this <http://jira.springframework.org/browse/SPR-6003> improvement issue at > Spring Framework's JIRA. I was just about to do the same, as clearly this is spring-oxm not being able to use Castor as it should be possible. > Bye bye mapping.xml :) Lucky to see that you managed to get there. > Thanks Werner for support! > > Regards, > Stevo. > > On Tue, Aug 11, 2009 at 10:43 PM, Werner Guttmann <wgut...@codehaus.org>wrote: > >> Stevo, >> >> Stevo Slavić wrote: >>> Hello Werner, >>> >>> I'm using Spring-WS with Spring-OXM abstractions over OXM frameworks, and >>> its Castor support, all for easy replacement of OXM implementation. Thus, >>> when generating sources with castor-maven-plugin I've set "marshal" >>> parameter to false, and want to have mapping.xml generated along with >>> classes from set of XSD's, and configure Spring's CastorMarshaller with >>> generated mapping.xml. Rest of my comments are inline. >>> >>> Regards, >>> Stevo. >>> >>> On Tue, Aug 11, 2009 at 10:21 AM, Werner Guttmann <wgut...@codehaus.org >>> wrote: >>> >>>> Hi Stevo, >>>> >>>> can you please let me know why you want a mapping file to be generated >>>> at all ? Java classes plus descriptor classes should be sufficient for >>>> you needs, if this is about (un-)marshalling to and from XML (as defined >>>> by your XML schemas). >>>> >>>> Some more answers are inline. >>>> >>>> Regards >>>> Werner >>>> >>>> Stevo Slavić wrote: >>>>> OK, thank you very much! >>>>> >>>>> Generating classes works well now, but once I set generateMappings to >>>> true, >>>>> generate goal fails with following error: >>>>> >>>>> The following exception occured while validating field: >> _classMappingList >>>> of >>>>> class: org.exolab.castor.mapping.xml.MappingRoot: The following >> exception >>>>> occured while validating field: _classChoice of class: >>>>> org.exolab.castor.mapping.xml.ClassMapping: The following exception >>>> occured >>>>> while validating field: _fieldMappingList of class: >>>>> org.exolab.castor.mapping.xml.ClassChoice: The following exception >>>> occured >>>>> while validating field: _bindXml of class: >>>>> org.exolab.castor.mapping.xml.FieldMapping: The following exception >>>> occured >>>>> while validating field: _name of class: >>>>> org.exolab.castor.mapping.xml.BindXml: Name '-error-if-this-is-used-' >> is >>>> not >>>>> a valid QName. >>>> If you do not set <generateMappings> to true, does code generation >>>> succeed ? >>> >>> Yes, code generation alone succeeds. >>> >>> >>>>> Any idea what could be the problem? Guess I'm hit by this Castor >>>>> issue<http://jira.codehaus.org/browse/CASTOR-676>. >>>>> Advices/workarounds are welcome too. >>>>> >>>>> Version 1.5 of castor-maven-plugin is being used. There seems to be no >>>>> (documented) way to set output directory for mappings file ("dest" >>>> parameter >>>>> does not seem to influence generation of mapping.xml). >>>> Correct. But there's two more MOJOs that specialize in creating just >>>> mapping files. Please have a look at >>>> >>>> http://mojo.codehaus.org/castor-maven-plugin/plugin-info.html >>> >> Well, actually, just came to realize that my comment above is COMPLETELY >> invalid. Those two MOJOs will not help you in any way, as the >> (Internally) use Castor's MappingTool to create a mapping file from a >> Java class. Your starting point is an XML schema, so please ignore my >> comment. >> >> Having said that, most of your comments are very valid re: their usage. >> Can I please ask you to append those to a newly created Jira issue ? >> >> Regards >> Werner >> >> --------------------------------------------------------------------- >> To unsubscribe from this list, please visit: >> >> http://xircles.codehaus.org/manage_email >> >> >> > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email