[ 
http://issues.apache.org/jira/browse/JAXME-62?page=comments#action_12317128 ] 

Jochen Wiedmann commented on JAXME-62:
--------------------------------------

Hmmm, the reason for the IllegalArgumentException is, that the check for 
maxLength occurs within setFoo() and not within the SAX handler. There are 
different alternatives, all of which I do not like too much:

- We could check in the handler and not in setFoo(). No, we don't want to loose 
the check in setFoo().
- We could check in the handler and in setFoo(). That means checking twice. 
Obviously, that's not
  a problem for maxLength, and the like, but things look different when 
applying patterns. Duplicating
  the number of checks could really hurt there.
- We could throw a JAXBException in setFoo(). But that would be a violation of 
the JAXB SPEC.
- We could leave things as they are. But, I agree with you, that a violation of 
maxLength should be
  catchable by a ValidationEventHandler.

Any other ideas?


> IllegalArgumentException on validation, length limit exceeded
> -------------------------------------------------------------
>
>          Key: JAXME-62
>          URL: http://issues.apache.org/jira/browse/JAXME-62
>      Project: JaxMe
>         Type: Bug
>  Environment: Java 1.4.2_08, WinXP
>     Reporter: Andreas Schoedl

>
> Instead of IllegalArgument a JAXB- or ValidationException should be thrown.
> java.lang.IllegalArgumentException: Length of 50 characters exceeded: 
> ...Element content longer than 50 characters...
>       at 
> de.sag.dms.custom.dialog.coredoc.impl.CoREDocTypeImpl$SGVarianteTypeImpl$DocumentTypeImpl$SegmentTypeImpl$FragmentTypeImpl.setFRAGNAME(CoREDocTypeImpl.java:560)
>       at 
> de.sag.dms.custom.dialog.coredoc.impl.CoREDocTypeHandler$SGVarianteTypeHandler$DocumentTypeHandler$SegmentTypeHandler$FragmentTypeHandler.endElement(CoREDocTypeHandler.java:1120)
>       at 
> org.apache.ws.jaxme.impl.JMUnmarshallerHandlerImpl.endElement(JMUnmarshallerHandlerImpl.java:258)
>       at 
> org.apache.ws.jaxme.util.DOMSerializer.doSerialize(DOMSerializer.java:200)
>       at 
> org.apache.ws.jaxme.util.DOMSerializer.doSerializeChilds(DOMSerializer.java:75)
>       at 
> org.apache.ws.jaxme.util.DOMSerializer.doSerialize(DOMSerializer.java:199)
>       at 
> org.apache.ws.jaxme.util.DOMSerializer.doSerializeChilds(DOMSerializer.java:75)
>       at 
> org.apache.ws.jaxme.util.DOMSerializer.doSerialize(DOMSerializer.java:199)
>       at 
> org.apache.ws.jaxme.util.DOMSerializer.doSerializeChilds(DOMSerializer.java:75)
>       at 
> org.apache.ws.jaxme.util.DOMSerializer.doSerialize(DOMSerializer.java:199)
>       at 
> org.apache.ws.jaxme.util.DOMSerializer.doSerializeChilds(DOMSerializer.java:75)
>       at 
> org.apache.ws.jaxme.util.DOMSerializer.doSerialize(DOMSerializer.java:199)
>       at 
> org.apache.ws.jaxme.util.DOMSerializer.doSerializeChilds(DOMSerializer.java:75)
>       at 
> org.apache.ws.jaxme.util.DOMSerializer.doSerialize(DOMSerializer.java:199)
>       at 
> org.apache.ws.jaxme.util.DOMSerializer.serialize(DOMSerializer.java:148)
>       at 
> org.apache.ws.jaxme.impl.JMUnmarshallerImpl.unmarshal(JMUnmarshallerImpl.java:111)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to