Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Moxy and Reference Impl schemas do not match
Moxy and Reference Impl schemas do not match [message #1116106] Wed, 25 September 2013 01:32 Go to next message
Will Hughes is currently offline Will HughesFriend
Messages: 3
Registered: September 2013
Junior Member
I've been trying to use Moxy for some of the extensions but have found that as soon as I drop Moxy in, I lose everything that was working. This may be something simple. I'm hoping. But definitely I find it weird that simply by changing jaxb implementations, I get completely different (and in the case of Moxy, what I consider incorrect) schemas.

It all revolves around inheritance on a collection. Here's the class that we start with. It has a collection of an abstract class.

@XmlAccessorType(XmlAccessType.NONE)
@XmlRootElement(name = "form")
public class FormType {
...
@XmlElementRef
public List<FormElement> getFormElements() {

}


This abstract class has one notable thing: formElements can have collections of formElements. However, I've commented that entire part out and it doesn't seem to make a difference. I should probably remove it from this code but want to keep it to be as complete as possible.

@XmlSeeAlso(value = {UiFormElement.class})
@XmlAccessorType(XmlAccessType.NONE)
@XmlRootElement
public abstract class FormElement implements Serializable, DoesGroovy {
...
@XmlElementRef
public List<FormElement> getFormElements() {
}


Another layer of abstraction. This is the one that points to the concrete classes that Moxy seems to be missing.

@XmlSeeAlso(value = {TabSheetUiFormElement.class, TabUiFormElement.class, ...})
@XmlAccessorType(XmlAccessType.NONE)
@XmlRootElement
public abstract class UiFormElement extends FormElement {
...
}

An example of how each of the concrete subclasses are annotated.
@XmlAccessorType(XmlAccessType.NONE)
@XmlRootElement(name = "tabsheet")
public class TabSheetUiFormElement extends UiFormElement implements FormComponent {

same for others in the SeeAlso list above.

The reference implementation "sees" all of these concrete subclasses of UiFormElement and shows them in the schema. Moxy does not.

Is there anything obviously wrong here? I'm happy to try and post the cleaned-up versions of the schemas (minus all the dozens of simple fields that I highly doubt would be anything but cruft to this issue).


Re: Moxy and Reference Impl schemas do not match [message #1116618 is a reply to message #1116106] Wed, 25 September 2013 17:09 Go to previous messageGo to next message
Matt MacIvor is currently offline Matt MacIvorFriend
Messages: 14
Registered: July 2009
Junior Member
Hi Will,

This appears to be a bug in MOXy's processing of XmlSeeAlso. I've opened an EclipseLink bug to track this: https://bugs.eclipse.org/bugs/show_bug.cgi?id=418044

As a temporary workaround, you could include the concrete subclasses in the list of classes passed into the JAXBContext creation, or include them in a jaxb.index file if you are creating the context from a package name.

Hope this is helpful.

-Matt
Re: Moxy and Reference Impl schemas do not match [message #1116711 is a reply to message #1116618] Wed, 25 September 2013 19:11 Go to previous messageGo to next message
Will Hughes is currently offline Will HughesFriend
Messages: 3
Registered: September 2013
Junior Member
Hey, thanks! Yeah, I was heading down the "looking like a bug" path. But I really appreciate you looking into it and confirming. Keeps me from thinking I've gone nuts. ;->

It's the "intermediate" class that seems to cause the problem. If it's just "one" level of inheritance, then all is well. But more than that causes an issue. I've got another set of classes that are less deep and they work fine in both Moxy and the RI. So I stuck an empty class in between (but still annotated with the @XmlSeeAlso) and the RI handled it fine but Moxy then had trouble.

And how soon would you guys release a fix? Do you do patches or will I have to wait for the next release?

Thanks for looking into this and answering!

Will
Re: Moxy and Reference Impl schemas do not match [message #1116721 is a reply to message #1116711] Wed, 25 September 2013 19:23 Go to previous messageGo to next message
Matt MacIvor is currently offline Matt MacIvorFriend
Messages: 14
Registered: July 2009
Junior Member
Hi Will,

You're right, the issue is with multiple levels of XmlSeeAlso annotations.

I've set the target to the 2.5.2 release. You can always get the latest nightly builds from the eclipselink downloads page here: http://www.eclipse.org/eclipselink/downloads/nightly.php

Once the fix has been checked in, you'd be able to get the nightly build with the fix in it the next day.

-Matt
Re: Moxy and Reference Impl schemas do not match [message #1116866 is a reply to message #1116721] Wed, 25 September 2013 23:02 Go to previous message
Will Hughes is currently offline Will HughesFriend
Messages: 3
Registered: September 2013
Junior Member
Great! Really appreciate it.

Will
Previous Topic:Null handling in 2.5
Next Topic:how can i control the persistence.xml file unit name in weblogic server
Goto Forum:
  


Current Time: Thu Apr 25 19:14:30 GMT 2024

Powered by FUDForum. Page generated in 0.03360 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top