javaee / jaxb-v2

Other
210 stars 100 forks source link

Unmarshalling: An invalid payload followed by a valid payload runs into exception. The next try of valid payload goes through. #931

Open glassfishrobot opened 11 years ago

glassfishrobot commented 11 years ago

I single unmarshaller instance is used to unmarshal an invalid XML payload; which runs into an Exeception (InstantiationException). Upon catching the exception and re-trying a valid payload, the unmarshaller still runs into a different type of Exception (ClassCast). Upon catching the exception during the 2nd try above and trying a valid payload again, unmarshaller successfully unmarshals the payload.

I have attached a sample (self-contained) eclipse based Java Project with the Main class, which is showing the above behavior.

Affected Versions

[2.2.6]

glassfishrobot commented 11 years ago

Reported by anand_h

glassfishrobot commented 11 years ago

snajper said: Adjusting priority, possible solution is to re-create unmarshaller instances in your code.

glassfishrobot commented 11 years ago

anand_h said: I would like to know if there is any way to identify a "corrupted" unmarshaller; so as to conditionally re-create the instance for the workaround. This is critical from the performance point-of-view.

glassfishrobot commented 11 years ago

File: jaxb_issue_test.zip Attached By: anand_h

glassfishrobot commented 11 years ago

Was assigned to yaroska

glassfishrobot commented 7 years ago

This issue was imported from java.net JIRA JAXB-931