You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jaxme-dev@ws.apache.org by ja...@ws.apache.org on 2004/08/06 17:51:19 UTC

[jira] Created: (JAXME-21) NullPointerException when using in global bindings

Message:

  A new issue has been created in JIRA.

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/JAXME-21

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: JAXME-21
    Summary: NullPointerException when using <jaxb:javaType> in global bindings
       Type: Bug

     Status: Unassigned
   Priority: Major

    Project: JaxMe

   Assignee: 
   Reporter: Matt Magoffin

    Created: Fri, 6 Aug 2004 8:51 AM
    Updated: Fri, 6 Aug 2004 8:51 AM

Description:
When I add the following to a shema, XJC generates a NullPointerException:

<annotation>
  <appinfo>
    <jaxb:globalBindings>
      <jaxb:javaType name="java.lang.Integer" xmlType="xs:int"/>
    </jaxb:globalBindings>
  </appinfo>
</annotation>

(This is using the 0.3 release).



---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org


[jira] Updated: (JAXME-21) NullPointerException when using in global bindings

Posted by ja...@ws.apache.org.
The following issue has been updated:

    Updater: Matt Magoffin (mailto:apache.org@msqr.us)
       Date: Fri, 6 Aug 2004 8:53 AM
    Comment:
This is a full schema file which generates the NullPointerException.
    Changes:
             Attachment changed to core.xsd
    ---------------------------------------------------------------------
For a full history of the issue, see:

  http://issues.apache.org/jira/browse/JAXME-21?page=history

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/JAXME-21

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: JAXME-21
    Summary: NullPointerException when using <jaxb:javaType> in global bindings
       Type: Bug

     Status: Unassigned
   Priority: Major

    Project: JaxMe

   Assignee: 
   Reporter: Matt Magoffin

    Created: Fri, 6 Aug 2004 8:51 AM
    Updated: Fri, 6 Aug 2004 8:53 AM

Description:
When I add the following to a shema, XJC generates a NullPointerException:

<annotation>
  <appinfo>
    <jaxb:globalBindings>
      <jaxb:javaType name="java.lang.Integer" xmlType="xs:int"/>
    </jaxb:globalBindings>
  </appinfo>
</annotation>

(This is using the 0.3 release).



---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org


[jira] Closed: (JAXME-21) NullPointerException when using in global bindings

Posted by ja...@ws.apache.org.
Message:

   The following issue has been closed.

   Resolver: Jochen Wiedmann
       Date: Wed, 11 Aug 2004 5:26 PM

The NPE is fixed. The binding of xs:int to Integer is simply ignored,
though, which is possibly another bug report worth.

However, if javaType were currently supported, it still wouldn't solve
your issue: IMO the binding to a custom java type can only work, if the requested type is a subclass of the default type. Thus, an implementation would simply refuse your schema, because Integer is
of course no subclass of int.

IMO a possible solution of your issue would go like this:

a) Invent a property ("nullable.types", for example), that requests
   that elements with "minOccurs=0" or attributes with "use=optional"
   be bound to nullable types.
b) Make the primitive type implementations list to that property.

For a), there's not very much to do: Add a property to the
"XJCTask", and make sure, that generator.setProperty() is
invoked. The "package" property is an example of how to do
this.

The b) part is a little bit more complicated. I offer to do that,
if you create a patch for a).

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/JAXME-21

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: JAXME-21
    Summary: NullPointerException when using <jaxb:javaType> in global bindings
       Type: Bug

     Status: Closed
   Priority: Major
 Resolution: FIXED

    Project: JaxMe

   Assignee: 
   Reporter: Matt Magoffin

    Created: Fri, 6 Aug 2004 8:51 AM
    Updated: Wed, 11 Aug 2004 5:26 PM

Description:
When I add the following to a shema, XJC generates a NullPointerException:

<annotation>
  <appinfo>
    <jaxb:globalBindings>
      <jaxb:javaType name="java.lang.Integer" xmlType="xs:int"/>
    </jaxb:globalBindings>
  </appinfo>
</annotation>

(This is using the 0.3 release).



---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org


[jira] Commented: (JAXME-21) NullPointerException when using in global bindings

Posted by ja...@ws.apache.org.
The following comment has been added to this issue:

     Author: Matt Magoffin
    Created: Wed, 11 Aug 2004 9:20 PM
       Body:
I got the idea to do this from the Sun JAXB documentation, and doing this exact <xs:javaType> conversion with the Sun RI does as expected, that is, it creates JAXB classes with Integer objects in place of 'int' primitives that marshall as expected. 

The JAXB spec seems refers to these "default Java datatype or its wrapper class" like the primitives, I got the impression that int/Integer, long/Long are interchangable in the JAXB spec... i.e. in section "6.9.3 Built-in Conversions":
-----
If the parse method is omitted, then a JAXB implementation must perform the following steps:

a. if javaType is not one of the primitive types or its corresponding
 wrapper class as shown in Table 6-2, "Built-In Conversions," on
 page 159, then it must result in an invalid customization as specified
 in Section 6.1.5, "Invalid Customizations." Skip steps b through d.

b. bind xmlType to its default Java datatype using the parse method for
 the xmlType defined in DatatypeConverter. If javaType is
 the same as the default Java datatype or its wrapper class, then skip
 steps b and c.
...
-----

Do you still think this xs:javaType is invalid?
---------------------------------------------------------------------
View this comment:
  http://issues.apache.org/jira/browse/JAXME-21?page=comments#action_37202

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/JAXME-21

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: JAXME-21
    Summary: NullPointerException when using <jaxb:javaType> in global bindings
       Type: Bug

     Status: Closed
   Priority: Major
 Resolution: FIXED

    Project: JaxMe

   Assignee: 
   Reporter: Matt Magoffin

    Created: Fri, 6 Aug 2004 8:51 AM
    Updated: Wed, 11 Aug 2004 9:20 PM

Description:
When I add the following to a shema, XJC generates a NullPointerException:

<annotation>
  <appinfo>
    <jaxb:globalBindings>
      <jaxb:javaType name="java.lang.Integer" xmlType="xs:int"/>
    </jaxb:globalBindings>
  </appinfo>
</annotation>

(This is using the 0.3 release).



---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org