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

  • SEARCH
  • Home
  • 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 9113183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T03:54:29+00:00 2026-06-17T03:54:29+00:00

I was using JAXB as DTO to set a stable interface between Server and

  • 0

I was using JAXB as DTO to set a stable interface between Server and Clients. Anyways this doesn’t matter. What matters is I created a set of classes that result in the following compile error.

Cannot resolve XML element declaration with namespace ‘namespace’ and
name ‘name’ in this context

Eclipse underlined “name” inside quotes as an error. This class is manually created instead of xjc generated.

@XmlRootElement(name="name", namespace="namespace")
@XmlType(name="")
public class UserDTO {

    private UserType userType;

    @XmlElement
    public UserType getDTO(){
        return userType;
    }

    public void setDTO(UserType userType){
        this.userType=userType;
    }
}

where UserType is a xjc generated class

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "userType", propOrder = {
    "userId",
    "userName"
})
public class UserType {getter;setter}

So basically UserDTO is just a wrapper that wraps up sub jaxb types.

I’m not sure if it was platform dependent (which it shouldn’t be), anyways, just to mention that this code worked perfectly on Netbeans, but when it come to Eclipse, the error prevented the compilation.

The Environment running the project was:
1. MacOsX Lion
2. JDK: 1.6.0_37
3. Eclipse Version: Juno with Package 1
4. JAXB Platform: Generic JAXB 2.1

Please anyone can share some idea?


ps: I added the JDK info and Libraries setting as Manuel suggested.

  • 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-06-17T03:54:30+00:00Added an answer on June 17, 2026 at 3:54 am

    I faced this issue, you have more than one schema, at least two, both of them don’t have namespace, just assign namespace to one of them.

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

Sidebar

Related Questions

We're parsing an XML document using JAXB and get this error: [org.xml.sax.SAXParseException: Invalid byte
We are using JAXB for Java-xml binding.We initially created domain class and then using
I've got this API using JAXB to conveniently use object models, generated from XML
I have this schema and i'm using JAXB to generate java stub files. <?xml
Using JAXB to generate XML binding classes. The schema is based on a set
I am trying to generate xml using jaxb. I created xsd and generated java
I am using jaxb for the Unmarshalling Process This is my Request <kiran acct
I am Using JAXB , and this is my XML Request and the below
I have always been using jaxb for parsing XML files into java object. This
I'm using JAXB with Scala, my marshalling code looks like this: def marshalToXml(): String

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.