Community
Participate
Working Groups
I'm not quite sure of the cause of this NPE, but once the NPE is fixed we should get a better idea. For some reason I haven't been able to reproduce this yet in debug. In jpt.jaxb.core.schemagen.Main an NPE can occur on line 102, where 'message' can be null. I null check is need here with some additional logic to handle this case and provide feedback to help with fixing the problem.
OK...figured out the cause of this problem. I was trying to generate a schema using the JAXB RI, but the jaxb.properties file had MOXy specified as the JAXBContext. This resulted in some sort of JAXBException that apparently returns a null message. In these cases, EclipseLink won't be on the classpath, so the error message should indicate to the user that they need to have EclipseLink MOXy available on the classpath when using the EclipseLink JAXB context.
Created attachment 167051 [details] Patch
Fixed the NPE and display a message to guide the user.
Fix ready for review.
It looks like we need to externalize the messages in these Main classes.
Created attachment 167217 [details] Patch with externalized messages
* Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug" (requested by an adopter) please document it as such. NPE prevents the user from getting any useful feedback as to what could be causing this schema generation problem. * Is there a work-around? If so, why do you believe the work-around is insufficient? Yes, but it will be very difficult for the user to figure out how to work around the problem. * How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added? Developer tested. * Give a brief technical overview. Who has reviewed this fix? The change was basically just to check for null to avoid the NPE, and then provide usable feedback for the user. Most the patch deals with externalizing the help messages. * What is the risk associated with this fix? Low risk.
Suggestion: Review System.out in the patch.
Fixed in RC1
verified fixed in build WTP-I-3.2.0-20100507065327