[ http://jira.codehaus.org/browse/JIBX-32?page=history ]

Dennis Sosnoski updated JIBX-32:
--------------------------------

      Component: core
        Version: 1.0-beta3c
       Priority: Blocker
    Environment: 
    Description: 
>From the JiBX FAQ:

  Q. Why do I get a java.lang.NullPointerException when I try to   
  marshal a document?
  A. The most likely cause is that you've got a null value for an 
  object that's not marked as optional in the binding definition. 
  ... snip ...
  add a pre-get method to that class for debugging purposes 
  ... snip ...

It occurs to me that it's relatively simple to change that NPE to a jibx 
exception that identifies that "name" value that was passed into 
MarshallingContext.element with a null value so that the user doesn't have to 
modify his bindings file just to figure out which item was null (which isn't 
always possible, especially when it happens in production).

I've already applied this patch to beta3c (which we're using here); I'll attach 
the same patch to this issue.

  was:
>From the JiBX FAQ:

  Q. Why do I get a java.lang.NullPointerException when I try to   
  marshal a document?
  A. The most likely cause is that you've got a null value for an 
  object that's not marked as optional in the binding definition. 
  ... snip ...
  add a pre-get method to that class for debugging purposes 
  ... snip ...

It occurs to me that it's relatively simple to change that NPE to a jibx 
exception that identifies that "name" value that was passed into 
MarshallingContext.element with a null value so that the user doesn't have to 
modify his bindings file just to figure out which item was null (which isn't 
always possible, especially when it happens in production).

I've already applied this patch to beta3c (which we're using here); I'll attach 
the same patch to this issue.

      Assign To: Dennis Sosnoski

> Provide more info when nulls are passed to marshalling context
> --------------------------------------------------------------
>
>          Key: JIBX-32
>          URL: http://jira.codehaus.org/browse/JIBX-32
>      Project: JiBX
>         Type: Improvement
>   Components: core
>     Versions: 1.0-beta3c
>     Reporter: Joshua Davies
>     Assignee: Dennis Sosnoski
>     Priority: Blocker
>      Fix For: CVS
>  Attachments: MarshallingContext.diff
>
>
> From the JiBX FAQ:
>   Q. Why do I get a java.lang.NullPointerException when I try to   
>   marshal a document?
>   A. The most likely cause is that you've got a null value for an 
>   object that's not marked as optional in the binding definition. 
>   ... snip ...
>   add a pre-get method to that class for debugging purposes 
>   ... snip ...
> It occurs to me that it's relatively simple to change that NPE to a jibx 
> exception that identifies that "name" value that was passed into 
> MarshallingContext.element with a null value so that the user doesn't have to 
> modify his bindings file just to figure out which item was null (which isn't 
> always possible, especially when it happens in production).
> I've already applied this patch to beta3c (which we're using here); I'll 
> attach the same patch to this issue.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
This SF.net email is sponsored by Demarc:
A global provider of Threat Management Solutions.
Download our HomeAdmin security software for free today!
http://www.demarc.com/info/Sentarus/hamr30
_______________________________________________
jibx-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-devs

Reply via email to