Hi Werner, I have both the Jakarta ORO and Regex jars in the classpath. They were there when using version 1.2. I seem to recall I ran into a similar issue when first implementing 1.2 and realized I was missing the jars. You suggest that there is a difference in the fallback for 1.2 and 1.3. What is that difference? I grabbed the source and see that the PatternValidator is hard coded to return false. This is no diffirent between 1.2 and 1.3. The question is why, with only a version change (nothing else has changed) is it using that class and not the Jakarta class. You mentioned an "unlucky" fallback that differs between 1.2 and 1.3. Based on what I've mentioned, does that fall into the picture? Lastly, I do not use Maven.
Brief overview of the system: The system is set to first build the xml -> java classes offline, bundle them in their own jar and provide that to the service. Based on the fact that castor makes the choice of regex configurable, I assume these jakarta/oro classes are dynamically loaded at run-time and are not required for the offline class generation. Regardless, I threw in the classpath for org.castor.anttask.CastorCodeGenTask. Roger --- On Sat, 7/18/09, Werner Guttmann <[email protected]> wrote: > From: Werner Guttmann <[email protected]> > Subject: Re: [castor-user] Problems with upgrade to 1.3 > To: [email protected] > Received: Saturday, July 18, 2009, 5:14 AM > 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 > > > __________________________________________________________________ Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your favourite sites. Download it now http://ca.toolbar.yahoo.com. --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

