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

The Archive Base Latest Questions

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

I seemed to get the following exception when trying to deploy my application: Caused

  • 0

I seemed to get the following exception when trying to deploy my application:

Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of     IllegalAnnotationExceptions java.util.List is an interface, and JAXB can't handle interfaces. this problem is related to the following location:     at java.util.List     at private java.util.List     foobar.alkohol.register.webservice.jaxws.GetRelationsFromPersonResponse._return     at     foobar.alkohol.register.webservice.jaxws.GetRelationsFromPersonResponse java.util.List does not have a no-arg default constructor.     this problem is related to the following location:         at java.util.List         at private java.util.List foobar.alkohol.register.webservice.jaxws.GetRelationsFromPersonResponse._return     at     foobar.alkohol.register.webservice.jaxws.GetRelationsFromPersonResponse 


My code worked just well until I changed the return type from List to List<List<RelationCanonical>>

Here is the partial webservice:

 @Name('relationService') @Stateless @WebService(name = 'RelationService', serviceName = 'RelationService') @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED) public class RelationService implements RelationServiceLocal {      private boolean login(String username, String password) {         Identity.instance().setUsername(username);         Identity.instance().setPassword(password);         Identity.instance().login();         return Identity.instance().isLoggedIn();     }      private boolean logout() {         Identity.instance().logout();         return !Identity.instance().isLoggedIn();     }      @WebMethod     public List<List<RelationCanonical>> getRelationsFromPerson(@WebParam(name = 'username')     String username, @WebParam(name = 'password')     String password, @WebParam(name = 'foedselsnummer')     String... foedselsnummer) {  ...... ...... ...... } 

I have also tried by removing the @SOAPBinding and trying default, but the same result occurs. Appreciate any help

UPDATE

I want to note out something. I changed all List to ArrayList, and then it compiled. The reason why I say compiled and not worked is because it behaves strange. I get an Object of type: RelationServiceStub.ArrayList but the object has no get methods or does not behave as a List either. I also tried to cast it to a List but that didnt work.

Note that this is after I have used Axis 2 and wsdl2java So yes, now it compiles, but I dont know how to get the data out.

  • 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. 2026-05-10T21:41:25+00:00Added an answer on May 10, 2026 at 9:41 pm

    In my understanding, you will not be able to process a plain List via JAXB, as JAXB has no idea how to transform that into XML.

    Instead, you will need to define a JAXB type which holds a List<RelationCanonical> (I’ll call it Type1), and another one to hold a list of those types, in turn (as you’re dealing with a List<List<...>>; I’ll call this type Type2).

    The result could then be an XML ouput like this:

    <Type2 ...>     <Type1 ...>         <RelationCanonical ...> ... </RelationCanonical>         <RelationCanonical ...> ... </RelationCanonical>         ...     </Type1>     <Type1>         <RelationCanonical ...> ... </RelationCanonical>         <RelationCanonical ...> ... </RelationCanonical>         ...     </Type1>     ... </Type2> 

    Without the two enclosing JAXB-annotated types, the JAXB processor has no idea what markup to generate, and thus fails.

    –Edit:

    What I mean should look somewhat like this:

    @XmlType public class Type1{      private List<RelationCanonical> relations;      @XmlElement     public List<RelationCanonical> getRelations(){         return this.relations;     }      public void setRelations(List<RelationCanonical> relations){         this.relations = relations;     } } 

    and

    @XmlRootElement public class Type2{      private List<Type1> type1s;      @XmlElement     public List<Type1> getType1s(){         return this.type1s;     }      public void setType1s(List<Type1> type1s){         this.type1s= type1s;     } } 

    You should also check out the JAXB section in the J5EE tutorial and the Unofficial JAXB Guide.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get into unit tests for a BizTalk application I'm working on,
I get the following error when trying to push changes to github from the
I am trying to accomplish something that seemed quite simple... I have 3 div
I tried installing OpenCV following the instructions for a MacPorts install on http://opencv.willowgarage.com/wiki/Mac_OS_X_OpenCV_Port ,
I am following the tutotial on Apple's website for building your first iPhone application,
I'm trying to get my Django based webapp into a working deployment configuration, and
This seemed like an easy thing to do. I just wanted to pop up
Sessions in PHP seemed to have changed since the last time I used them,
I have a script that seemed to work before but no longer does. It
My website was recently attacked by, what seemed to me as, an innocent code:

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.