Handling invalid enum values while doing JAXB Unmarshalling
My Jaxb has created a Enum class based on the XML schema set up. **enum Fruit { APPLE,ORANGE; }** I am using a SOAP UI to check my web service. Since it is a free form entry, if i give a wrong fruit say "Guva" then instead of throwing an exception it is returning it as null after doing the UnMarshalling. How can i avoid this? Should i use custom enum class instead of JAXB generated one. Please give some example. i.e. regards sri Note: I'm the EclipseLink JAXB (MOXy) lead and a member of the JAXB (JSR-222) expert group. By default your JAXB (JSR-222) implementation will not fail on any