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 1007895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:41:14+00:00 2026-05-16T08:41:14+00:00

I have the following code: private SetMultimap<String, Dynamic> dynamicFields = TreeMultimap.create(Ordering.natural(), new Comparator<Dynamic>() {

  • 0

I have the following code:

private SetMultimap<String, Dynamic> dynamicFields = TreeMultimap.create(Ordering.natural(), new Comparator<Dynamic>() {
  @Override
  public int compare(Dynamic o1, Dynamic o2) {
   return o1.getTitle().compareTo(o2.getTitle());
  }
 });

which gives me the following exception.

IllegalAnnotationsException SetMultimap is an interface, and JAXB can't handle interfaces

My question is, how come this doesn’t work but this does:

List<Dynamic> test = new ArrayList<Dynamic>();

And how can I fix the SetMultimap so that JAXB is happy?

  • 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-16T08:41:14+00:00Added an answer on May 16, 2026 at 8:41 am

    The difference between List/ArrayList and SetMultimap is that one is a Java collection, and the other is a data structure outside the normal Java collection hierarchy. This means JAXB considers it a normal class.

    The JAXB spec does not support interfaces. You are probably using the Metro JAXB implementation which also does not support interfaces. Some JAXB implementations such as MOXy can support interfaces, but some JAX-WS implementations depend upon a particular JAXB impl, and substituting JAXB implementations is not always possible:

    • http://bdoughan.blogspot.com/2010/07/moxy-jaxb-map-interfaces-to-xml.html
    • http://bdoughan.blogspot.com/2010/07/jaxb-xml-binding-standard.html

    Your best bet is to use a parameter level annotation to convert SetMultimap to a class that can be handled by JAXB:

    • http://bdoughan.blogspot.com/2010/07/xmladapter-jaxbs-secret-weapon.html
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So, I have the following code: private readonly Dictionary<string, IGame> _gameLookup = new Dictionary<string,
I have the following Code private DataTable GetServices(string[] serviceNames) { DataTable dt = new
I have the following code: private String foo; public void setFoo(String bar) { foo
I have the following code: private void _DoValidate(object sender, DoWorkEventArgs e) { this.BeginInvoke(new MethodInvoker(()
I have the following code private Map<KEY, Object> values = new HashMap<KEY, Object>(); public
I have the following code: private static final Set<String> allowedParameters; static { Set<String> tmpSet
I have the following code: private ActionResult Foo(string format, IEnumerable<String> myResults) { if (format
I have the following code: private void SetControlNumbers() { string controlString = ; int
I have the following piece of code: private Dictionary<object, object> items = new Dictionary<object,
I have the following code: private def formatQuery(q:String = ):String = { val q2

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.