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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:24:11+00:00 2026-06-01T17:24:11+00:00

I have a Customer and CustomerFullAddress class and i am using JAXB to try

  • 0

I have a Customer and CustomerFullAddress class and i am using JAXB to try to produce an XML file

<Customer CustomerID="GREAL">
    <CompanyName>Great Lakes Food Market</CompanyName>
    <ContactName>Howard Snyder</ContactName>
    <ContactTitle>Marketing Manager</ContactTitle>
    <Phone>(503) 555-7555</Phone>
    <FullAddress>
        <Address>2732 Baker Blvd.</Address>
        <City>Eugene</City>
        <Region>OR</Region>
        <PostalCode>97403</PostalCode>
        <Country>USA</Country>
    </FullAddress>
</Customer>

The Customer Class looks like below (Its not a full implementation)

package org.abc.customers;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

@XmlRootElement(name = "customer")
@XmlType (propOrder = { "companyName", "contactName", "contactTitle", "phone" })

public class Customer {

*@XmlElement(name = "customerfulladdress")
private CustomerFullAddress custAdd;*

private String companyName;
private String contactName;
private String contactTitle;
private int phone;

public CustomerFullAddress getCustAddress() {
return custAdd;
}

public void setCustAddress(CustomerFullAddress custAdd) {
this.custAdd = custAdd;
}
...

While the CustomerFullAddress is

package org.abc.customers;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

@XmlRootElement(name = "customerfulladdress")
//If you want you can define the order in which the fields are written
//Optional
@XmlType(propOrder = { "address", "city", "region", "postalCode", "country" })

public class CustomerFullAddress {

private String address;
...

public String getAddress() {
    return address;
}
public void setAddress(String address) {
    this.address = address;
}
.....
 }

and the error is

Exception in thread “main”
com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 2
counts of IllegalAnnotationExceptions Property custAdd is present but
not specified in @XmlType.propOrder this problem is related to the
following location: at private
org.abc.customers.CustomerFullAddress
org.abc.customers.Customer.custAdd at
org.abc.customers.Customer Property custAddress is present but not
specified in @XmlType.propOrder this problem is related to the
following location: at public
org.abc.customers.CustomerFullAddress
org.abc.customers.Customer.getCustAddress() at
org.abc.customers.Customer

Thanks for having a look!

  • 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-01T17:24:12+00:00Added an answer on June 1, 2026 at 5:24 pm

    From the JavaDoc for @XmlType:

    propOrder

    All of the JavaBean properties being mapped to XML Schema elements must be listed.

    You need to add the CustomerFullAddress property to the propOrder for Customer.

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

Sidebar

Related Questions

I have class(Customer) which holds more than 200 string variables as property. I'm using
I have a Customer class. public class Customer { private string _id; private string
I have a Customer class that contains a property, MyProperty, which is of a
I have a customer who is currently using Excel to do their staff planning.
I have a Customer class which has a representative field....this field is initially blank
I have Customer class that make connection to db and save data to mysql.
I have a customer using the Access 97 runtime to support part of their
Let's say I have 'Customer' table in SQL DB and I'm using Entity Framework.
I have created a small program to write XML-Comment for Properties(which dont have customer
i have a customer control that inherit from the UserControl class and i have

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.