Hi,

does your classpath include the binaries for the Jakarte RegExp package
? If not, Castor (at this release version) will have a slightyl unlucky
fall-back mechanism.

Regards
Werner

P.S. And finally, do you happen to use Maven for your project builds ?

Roger Lefebvre wrote:
> Hi,
> 
> I just upgraded from castor 1.2 to castor 1.3.
> Included the new core jar and was able to generate all my java classes from 
> schemas without issue.
> Runtime went well until I hit a class whose schema contains a restriction 
> pattern on a string.
> <xsd:pattern 
> value="[1-2][0-9]{3}[0-1][0-9][0-3][0-9][0-2][0-9][0-5][0-9][0-5][0-9]{4}" />
> 
> It generated the following stack snippet:
> 
> ValidationException: The following exception occured while validating field: 
> _transactionDate of class: 
> com.netid.idia.model.natal.serviceLogger.LoggerRequest: 20090717170107360does 
> not match any of the following regular expressions: 
> "[1-2][0-9]{3}[0-1][0-9][0-3][0-9][0-2][0-9][0-5][0-9][0-5][0-9]{4}", "";
>    - location of error: XPATH: /LoggerRequest/TransactionDate
> 20090717170107360does not match any of the following regular expressions: 
> "[1-2][0-9]{3}[0-1][0-9][0-3][0-9][0-2][0-9][0-5][0-9][0-5][0-9]{4}", ""
>       at 
> org.exolab.castor.xml.FieldValidator.validate(FieldValidator.java:285)
>       at 
> org.exolab.castor.xml.util.XMLClassDescriptorImpl.validateField(XMLClassDescriptorImpl.java:1098)
>       at 
> org.exolab.castor.xml.util.XMLClassDescriptorImpl.validate(XMLClassDescriptorImpl.java:1068)
>       at org.exolab.castor.xml.Validator.validate(Validator.java:135)
>       at org.exolab.castor.xml.Marshaller.validate(Marshaller.java:2809)
>       at org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:902)
> 
> I checked the castor.properties and they show that the default for regexp 
> evaluator
> org.exolab.castor.regexp=org.exolab.castor.util.JakartaRegExpEvaluator
> 
> It's perplexing given that it works fine in 1.2 and there is no mention of 
> changes with respect to regex for 1.3. Am I correct? Regardless, any insight 
> would be appreciated.
> 
> Roger
> 
> 
> 
>       __________________________________________________________________
> Looking for the perfect gift? Give the gift of Flickr! 
> 
> http://www.flickr.com/gift/
> 
> ---------------------------------------------------------------------
> 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


Reply via email to