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

AbstractMarshaller incorrectly expects DOMResult to already have a node [SPR-7257] #11916

Closed
spring-projects-issues opened this issue Jun 3, 2010 · 1 comment
Assignees
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Archie Cobbs opened SPR-7257 and commented

If you try to marshall an object into a DOMResult that was created with the DOMResult() no-arg constructor, you get this:

java.lang.IllegalArgumentException: DOMResult does not contain Node
	at org.springframework.util.Assert.notNull(Assert.java:112)
	at org.springframework.oxm.support.AbstractMarshaller.marshalDomResult(AbstractMarshaller.java:192)
	at org.springframework.oxm.support.AbstractMarshaller.marshal(AbstractMarshaller.java:93)

But why? The Javadoc for DOMResult states:

If no output DOM source is set, the transformation will create a Document node as the holder for the result of the transformation, which may be retrieved with getNode().

So this check is in violation of the DOM API. In any case, I can't create the node because I don't know what the document element is going to be (in general, only the marshaller knows that).


Affects: 3.0.2

Referenced from: commits f72c431

@spring-projects-issues
Copy link
Collaborator Author

Arjen Poutsma commented

Fixed.

@spring-projects-issues spring-projects-issues added type: bug A general bug in: data Issues in data modules (jdbc, orm, oxm, tx) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 3.0.3 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants