Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impossible to add custom error handling during JAXB marshalling/unmarshalling. [SWS-717] #810

Closed
gregturn opened this issue Jul 12, 2011 · 2 comments
Assignees
Milestone

Comments

@gregturn
Copy link
Member

@gregturn gregturn commented Jul 12, 2011

Victor Polischuk opened SWS-717 and commented

Class "org.springframework.ws.server.endpoint.adapter.method.jaxb.AbstractJaxb2PayloadMethodProcessor" has private access methods "createUnmarshaller(..)" and "createMarshaller(..)" therefore developers (e.g. me) who might need to define custom validation (using "javax.xml.bind.ValidationEventHandler") cannot do it in easy way.

Usually, developer doesn't need to override default marshalling or unmarshalling validation behavior but the validator has a problem with "XmlGregorianCalendar" unmarshalling, it simply ignores the error (because it is warning for some reason) and it is impossible to get an exception without replacing default validator.

It would be very good if these methods ("createUnmarshaller(..)" and "createMarshaller(..)") had "protected" access modifier. In this case the methods should accept "JAXBContext" as a parameter instead of "Class<?>" to keep "getJaxbContext(..)" private.

Another option is adding additional setters for validation handler and many other JAXB options. It seems not so scalable but more strict.


Affects: 2.0 GA, 2.0.1, 2.0.2

Referenced from: commits 3293446

@gregturn
Copy link
Member Author

@gregturn gregturn commented Oct 6, 2011

Arjen Poutsma commented

Fixed by adding protected create(Un)Marshaller methods, as suggested.

@gregturn
Copy link
Member Author

@gregturn gregturn commented May 4, 2012

Arjen Poutsma commented

Closing old issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.