Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6818369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:10:11+00:00 2026-05-26T21:10:11+00:00

I am declaring a List object property with: @XmlRootElement(namespace = …) @XmlType public class

  • 0

I am declaring a List object property with:

@XmlRootElement(namespace = "...")
@XmlType
public class Test {
    private List<String> myList;

    @XmlElementWrapper(name = "myListWrapper")
    @XmlElement(name = "myList")
    public List<String> getMyList() {
        return myList;
    }
}

When an instance of this class with an empty list myList is marshalled, MOXy is not generating an empty wrapper MyListWrapper. However, JAXB RI would do it. The generated XML looks like this when using the RI:

<ns2:test xmlns:ns2="...">
    <myListWrapper/>
</ns2:intensionalSet>

Is there a way to obtain the same result with MOXy?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T21:10:12+00:00Added an answer on May 26, 2026 at 9:10 pm

    Note: I’m the EclipseLink JAXB (MOXy) lead and a member of the JAXB 2 (JSR-222) expert group.

    This is a bug in the MOXy implementation of JAXB. You can use the following link to track this issue:

    • https://bugs.eclipse.org/bugs/show_bug.cgi?id=363197
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class that has a method as follows :- public void setCurrencyCode(List<String>
Say I am declaring a class C and a few of the declarations are
Why does the compiler issue a warning when declaring a variable as List<? extends
I am declaring a Spring bean for a Java class that is used as
I've got a class in my project that stores a List<> of elements. I'm
I have two domain classes, Alpha and Beta. class Beta{ String betaName int age
Gotw 80 includes the following example: // Example 1 // #include <string> using namespace
How can add/remove/replace LIST in cookies using C#. //Declaring the List for image list
I'm trying to use a generic list as a property of the users profile.
I have the following classes: public class Obj<T> extends BaseModel { public static final

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.