You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Benson Margulies (JIRA)" <ji...@apache.org> on 2010/09/04 18:49:34 UTC

[jira] Created: (CXF-2973) Schema with broken namespaces in JAXB

Schema with broken namespaces in JAXB
-------------------------------------

                 Key: CXF-2973
                 URL: https://issues.apache.org/jira/browse/CXF-2973
             Project: CXF
          Issue Type: Bug
          Components: JAXB Databinding
    Affects Versions: 2.2.10
            Reporter: Benson Margulies


Under some complex set of conditions that I have not yet diagnosed, the JAXBDataBinding will, with 'help' from JAXB (the version of JAXB built into the Apple 1.6 JDK, at least) create a schema DOM document that looks, roughly, like:

{code}
<schema xmlns:xs="......">
   <import .../>
   ...
</schema>
{code}

That is, the elements are created with no namespace at all.

I have not been able to isolate a test case, but I am opening this issue to track with.


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


[jira] Commented: (CXF-2973) Schema with broken namespaces in JAXB

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

Daniel Kulp commented on CXF-2973:
----------------------------------


My gut feeling says the error check is about all we can do here and this is resolvable.     In general, we want to use the latest JAXB-impl, not the version in the JDK, but in some cases, that may be problematic and your warning is probably appropriate.




> Schema with broken namespaces in JAXB
> -------------------------------------
>
>                 Key: CXF-2973
>                 URL: https://issues.apache.org/jira/browse/CXF-2973
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.2.10
>            Reporter: Benson Margulies
>
> Under some complex set of conditions that I have not yet diagnosed, the JAXBDataBinding will, with 'help' from JAXB (the version of JAXB built into the Apple 1.6 JDK, at least) create a schema DOM document that looks, roughly, like:
> {code}
> <schema xmlns:xs="......">
>    <import .../>
>    ...
> </schema>
> {code}
> That is, the elements are created with no namespace at all.
> I have not been able to isolate a test case, but I am opening this issue to track with.

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


[jira] Commented: (CXF-2973) Schema with broken namespaces in JAXB

Posted by "Benson Margulies (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12906266#action_12906266 ] 

Benson Margulies commented on CXF-2973:
---------------------------------------

Other than the error check I put in earlier today, is there anything else we should do about this?

We have a whole slew of declared dependencies on jaxb-impl. I had to exclude them all to get rid of this problem. 

I don't claim to understand how I ended up with the package-info referencing the annotation from the webapp classloader, and the code in JAXB looking at the annotation referencing the other. (or vica versa). It suggests that the package-info was somehow touched in the 'outer' class loader while the JAXB code didn't get hit until inside the webapp.


> Schema with broken namespaces in JAXB
> -------------------------------------
>
>                 Key: CXF-2973
>                 URL: https://issues.apache.org/jira/browse/CXF-2973
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.2.10
>            Reporter: Benson Margulies
>
> Under some complex set of conditions that I have not yet diagnosed, the JAXBDataBinding will, with 'help' from JAXB (the version of JAXB built into the Apple 1.6 JDK, at least) create a schema DOM document that looks, roughly, like:
> {code}
> <schema xmlns:xs="......">
>    <import .../>
>    ...
> </schema>
> {code}
> That is, the elements are created with no namespace at all.
> I have not been able to isolate a test case, but I am opening this issue to track with.

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


[jira] Resolved: (CXF-2973) Schema with broken namespaces in JAXB

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

Benson Margulies resolved CXF-2973.
-----------------------------------

    Fix Version/s: 2.2.11
       Resolution: Fixed

'FIxed' is perhaps a strong statement, but ...

This problem was somehow caused by putting CXF into both the system classloader of Jetty and also into a webapp class loader. One might argue that this is supposed to work. On the other hand, it usually *does* work, and the failure seems to be a JAX-B failure, not a CXF failure. Further, it may result from a fundamental limitation of Java.

So, i'm resolving based on the submitted change that will at least diagnose this a bit earlier and slightly less confusingly.


> Schema with broken namespaces in JAXB
> -------------------------------------
>
>                 Key: CXF-2973
>                 URL: https://issues.apache.org/jira/browse/CXF-2973
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.2.10
>            Reporter: Benson Margulies
>             Fix For: 2.2.11
>
>
> Under some complex set of conditions that I have not yet diagnosed, the JAXBDataBinding will, with 'help' from JAXB (the version of JAXB built into the Apple 1.6 JDK, at least) create a schema DOM document that looks, roughly, like:
> {code}
> <schema xmlns:xs="......">
>    <import .../>
>    ...
> </schema>
> {code}
> That is, the elements are created with no namespace at all.
> I have not been able to isolate a test case, but I am opening this issue to track with.

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


[jira] Commented: (CXF-2973) Schema with broken namespaces in JAXB

Posted by "Benson Margulies (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12906264#action_12906264 ] 

Benson Margulies commented on CXF-2973:
---------------------------------------

The problem here is two copies of JAX-B, one in the webapp, one not, causing JAX-B to fail to locate its annotations.

interface com.sun.xml.txw2.annotation.XmlNamespace

is being straddled between the webapp class loader and the system class loader.




I'm debugging my way into JAX-B schema generation. I have this failing environment. In it, JAXB creates XML Schema DOM documents with no namespaces.

The immediate cause is seen in com.sun.xml.txw2.TXW.getTagName(Class<?>).

It goes looking for the package-info.java annotation on com.sun.xml.bind.v2.schemagen.xmlschema. The annotation isn't there.

The package object seems to be pointing at the copy of JAX-B in the classes.jar that Apple passes along from Sun. There is a package-info.class in there.

com/sun/xml/internal/bind/v2/schemagen/xmlschema/package-info.class

Inside the code to fetch the annotation,

annotations is:

{interface com.sun.xml.txw2.annotation.XmlNamespace=@com.sun.xml.txw2.annotation.XmlNamespace(value=http://www.w3.org/2001/XMLSchema)}

> Schema with broken namespaces in JAXB
> -------------------------------------
>
>                 Key: CXF-2973
>                 URL: https://issues.apache.org/jira/browse/CXF-2973
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.2.10
>            Reporter: Benson Margulies
>
> Under some complex set of conditions that I have not yet diagnosed, the JAXBDataBinding will, with 'help' from JAXB (the version of JAXB built into the Apple 1.6 JDK, at least) create a schema DOM document that looks, roughly, like:
> {code}
> <schema xmlns:xs="......">
>    <import .../>
>    ...
> </schema>
> {code}
> That is, the elements are created with no namespace at all.
> I have not been able to isolate a test case, but I am opening this issue to track with.

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