You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Gyorgy Orban (JIRA)" <ji...@apache.org> on 2008/03/26 11:39:24 UTC

[jira] Created: (CXF-1492) JAXB databinding adds classes recursively to JAXBContext. The reference impl. adds only the request and response classes.

JAXB databinding adds classes recursively to JAXBContext. The reference impl. adds only the request and response classes.
-------------------------------------------------------------------------------------------------------------------------

                 Key: CXF-1492
                 URL: https://issues.apache.org/jira/browse/CXF-1492
             Project: CXF
          Issue Type: Bug
          Components: JAXB Databinding
         Environment: snapshot 20080130
            Reporter: Gyorgy Orban


This can cause problems with custom JAXB type adapters. Since CXF walks the classes recursively in JAXBContextInitializer, it adds the custom type's xml schema to the wsdl. Because these classes are intended for internal usage only they should not be part of the contract. If, for example, we have an adapter for xs:date we don't want to see in the wsdl the schema of the class that xs:date is mapped to internally.

This is a patch against JAXBContextInitializer that worked for us:

53a54
>
149,152d149
<             if (!Throwable.class.equals(cls)
<                 && !Exception.class.equals(cls)) {
<                 walkReferences(cls);
<             }
165d161
<                 walkReferences(cls);


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CXF-1492) JAXB databinding adds classes recursively to JAXBContext. The reference impl. adds only the request and response classes.

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1492?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp resolved CXF-1492.
------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.6

> JAXB databinding adds classes recursively to JAXBContext. The reference impl. adds only the request and response classes.
> -------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-1492
>                 URL: https://issues.apache.org/jira/browse/CXF-1492
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>         Environment: snapshot 20080130
>            Reporter: Gyorgy Orban
>            Assignee: Daniel Kulp
>             Fix For: 2.0.6
>
>         Attachments: cxf-1492.patch, JAXBContextInitializer.patch
>
>
> This can cause problems with custom JAXB type adapters. Since CXF walks the classes recursively in JAXBContextInitializer, it adds the custom type's xml schema to the wsdl. Because these classes are intended for internal usage only they should not be part of the contract. If, for example, we have an adapter for xs:date we don't want to see in the wsdl the schema of the class that xs:date is mapped to internally.
> This is a patch against JAXBContextInitializer that worked for us:
> 53a54
> >
> 149,152d149
> <             if (!Throwable.class.equals(cls)
> <                 && !Exception.class.equals(cls)) {
> <                 walkReferences(cls);
> <             }
> 165d161
> <                 walkReferences(cls);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-1492) JAXB databinding adds classes recursively to JAXBContext. The reference impl. adds only the request and response classes.

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1492?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12582323#action_12582323 ] 

Daniel Kulp commented on CXF-1492:
----------------------------------


Can you attach a sample JAXB class or something that I can look at?

We pretty much have to walk the references.   Otherwise, we're likely to not pick up everything that is required and users would then end up with failures that are very hard to diagnose and they would have to do special configuration to get the extra classes that would be needed into the context.   (such as add @XmlSeeAlso annotations all over the place)

I'd rather find a solution that would keep the references.   Possibly if the field/property has an @XmlJavaTypeAdapter annotation, don't include it itself. 



> JAXB databinding adds classes recursively to JAXBContext. The reference impl. adds only the request and response classes.
> -------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-1492
>                 URL: https://issues.apache.org/jira/browse/CXF-1492
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>         Environment: snapshot 20080130
>            Reporter: Gyorgy Orban
>         Attachments: JAXBContextInitializer.patch
>
>
> This can cause problems with custom JAXB type adapters. Since CXF walks the classes recursively in JAXBContextInitializer, it adds the custom type's xml schema to the wsdl. Because these classes are intended for internal usage only they should not be part of the contract. If, for example, we have an adapter for xs:date we don't want to see in the wsdl the schema of the class that xs:date is mapped to internally.
> This is a patch against JAXBContextInitializer that worked for us:
> 53a54
> >
> 149,152d149
> <             if (!Throwable.class.equals(cls)
> <                 && !Exception.class.equals(cls)) {
> <                 walkReferences(cls);
> <             }
> 165d161
> <                 walkReferences(cls);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (CXF-1492) JAXB databinding adds classes recursively to JAXBContext. The reference impl. adds only the request and response classes.

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1492?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp reassigned CXF-1492:
--------------------------------

    Assignee: Daniel Kulp

> JAXB databinding adds classes recursively to JAXBContext. The reference impl. adds only the request and response classes.
> -------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-1492
>                 URL: https://issues.apache.org/jira/browse/CXF-1492
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>         Environment: snapshot 20080130
>            Reporter: Gyorgy Orban
>            Assignee: Daniel Kulp
>         Attachments: cxf-1492.patch, JAXBContextInitializer.patch
>
>
> This can cause problems with custom JAXB type adapters. Since CXF walks the classes recursively in JAXBContextInitializer, it adds the custom type's xml schema to the wsdl. Because these classes are intended for internal usage only they should not be part of the contract. If, for example, we have an adapter for xs:date we don't want to see in the wsdl the schema of the class that xs:date is mapped to internally.
> This is a patch against JAXBContextInitializer that worked for us:
> 53a54
> >
> 149,152d149
> <             if (!Throwable.class.equals(cls)
> <                 && !Exception.class.equals(cls)) {
> <                 walkReferences(cls);
> <             }
> 165d161
> <                 walkReferences(cls);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CXF-1492) JAXB databinding adds classes recursively to JAXBContext. The reference impl. adds only the request and response classes.

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1492?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp updated CXF-1492:
-----------------------------

    Attachment: cxf-1492.patch


Can you try the attached patch instead and let me know how well it works?  It ignores stuff with the XmlJavaTypeAdapter annoation.



> JAXB databinding adds classes recursively to JAXBContext. The reference impl. adds only the request and response classes.
> -------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-1492
>                 URL: https://issues.apache.org/jira/browse/CXF-1492
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>         Environment: snapshot 20080130
>            Reporter: Gyorgy Orban
>         Attachments: cxf-1492.patch, JAXBContextInitializer.patch
>
>
> This can cause problems with custom JAXB type adapters. Since CXF walks the classes recursively in JAXBContextInitializer, it adds the custom type's xml schema to the wsdl. Because these classes are intended for internal usage only they should not be part of the contract. If, for example, we have an adapter for xs:date we don't want to see in the wsdl the schema of the class that xs:date is mapped to internally.
> This is a patch against JAXBContextInitializer that worked for us:
> 53a54
> >
> 149,152d149
> <             if (!Throwable.class.equals(cls)
> <                 && !Exception.class.equals(cls)) {
> <                 walkReferences(cls);
> <             }
> 165d161
> <                 walkReferences(cls);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CXF-1492) JAXB databinding adds classes recursively to JAXBContext. The reference impl. adds only the request and response classes.

Posted by "Gyorgy Orban (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1492?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gyorgy Orban updated CXF-1492:
------------------------------

    Attachment: JAXBContextInitializer.patch

> JAXB databinding adds classes recursively to JAXBContext. The reference impl. adds only the request and response classes.
> -------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-1492
>                 URL: https://issues.apache.org/jira/browse/CXF-1492
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>         Environment: snapshot 20080130
>            Reporter: Gyorgy Orban
>         Attachments: JAXBContextInitializer.patch
>
>
> This can cause problems with custom JAXB type adapters. Since CXF walks the classes recursively in JAXBContextInitializer, it adds the custom type's xml schema to the wsdl. Because these classes are intended for internal usage only they should not be part of the contract. If, for example, we have an adapter for xs:date we don't want to see in the wsdl the schema of the class that xs:date is mapped to internally.
> This is a patch against JAXBContextInitializer that worked for us:
> 53a54
> >
> 149,152d149
> <             if (!Throwable.class.equals(cls)
> <                 && !Exception.class.equals(cls)) {
> <                 walkReferences(cls);
> <             }
> 165d161
> <                 walkReferences(cls);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.