Skip to main content

JAXB Error: "No element mapping exists for......." when binding XML to Objects

2 replies [Last post]
sdhanam
Offline
Joined: 2013-09-04
Points: 0

I am using STS, jdk 1.7.0_21. I have attached the zipped up STS project and a test file. I generated the classes using jaxb. I also generated the sample xml from the same schema files. When I try to bind the XML to the java objects, I get the following error. Can anyone help please??

On some other thread, it was suggested that I add a binding file. The contents are in the zip file too. But that did not work. I was unable to generate the java classes when I use the binding.

Thanks,

Srini

com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 6 counts of IllegalAnnotationExceptions
No element mapping exists for "http://hix.cms.gov/0.1/hix-ee":"InsuranceApplicant"
this problem is related to the following location:
at @javax.xml.bind.annotation.XmlElementDecl(scope=class javax.xml.bind.annotation.XmlElementDecl$GLOBAL, substitutionHeadName=InsuranceApplicant, defaultValue=, substitutionHeadNamespace=http://hix.cms.gov/0.1/hix-core, namespace=http://applicant-eligibility.ee.ffe.cms.gov/extension/1.0, name=ExchangeAssignedPersonIdentification)
at public javax.xml.bind.JAXBElement gov.cms.ffe.ee.applicant_eligibility.extension._1.ObjectFactory.createExchangeAssignedPersonIdentification(gov.niem.niem.niem_core._2.IdentificationType)
at gov.cms.ffe.ee.applicant_eligibility.extension._1.ObjectFactory
No element mapping exists for "http://hix.cms.gov/0.1/hix-core":"PersonIdentification"
this problem is related to the following location:
at @javax.xml.bind.annotation.XmlElementDecl(scope=class javax.xml.bind.annotation.XmlElementDecl$GLOBAL, substitutionHeadName=PersonIdentification, defaultValue=, substitutionHeadNamespace=http://hix.cms.gov/0.1/hix-core, namespace=http://applicant-eligibility.ee.ffe.cms.gov/extension/1.0, name=PartnerAssignedPersonIdentification)
at public javax.xml.bind.JAXBElement gov.cms.ffe.ee.applicant_eligibility.extension._1.ObjectFactory.createPartnerAssignedPersonIdentification(gov.niem.niem.niem_core._2.IdentificationType)
at gov.cms.ffe.ee.applicant_eligibility.extension._1.ObjectFactory
No element mapping exists for "http://hix.cms.gov/0.1/hix-core":"PersonIdentification"
this problem is related to the following location:
at @javax.xml.bind.annotation.XmlElementDecl(scope=class javax.xml.bind.annotation.XmlElementDecl$GLOBAL, substitutionHeadName=PersonIdentification, defaultValue=, substitutionHeadNamespace=http://hix.cms.gov/0.1/hix-core, namespace=http://applicant-eligibility.ee.ffe.cms.gov/extension/1.0, name=ExchangeUserIdentification)
at public javax.xml.bind.JAXBElement gov.cms.ffe.ee.applicant_eligibility.extension._1.ObjectFactory.createExchangeUserIdentification(gov.niem.niem.niem_core._2.IdentificationType)
at gov.cms.ffe.ee.applicant_eligibility.extension._1.ObjectFactory
There's no ObjectFactory with an @XmlElementDecl for the element {http://hix.cms.gov/0.1/hix-pm}InsurancePlanVariantCategoryCode.
this problem is related to the following location:
at protected java.util.List gov.cms.ffe.ee.applicant_eligibility.extension._1.CSREligibilityType.insurancePlanVariantCategoryCode
at gov.cms.ffe.ee.applicant_eligibility.extension._1.CSREligibilityType
at public gov.cms.ffe.ee.applicant_eligibility.extension._1.CSREligibilityType gov.cms.ffe.ee.applicant_eligibility.extension._1.ObjectFactory.createCSREligibilityType()
at gov.cms.ffe.ee.applicant_eligibility.extension._1.ObjectFactory
There's no ObjectFactory with an @XmlElementDecl for the element {http://hix.cms.gov/0.1/hix-ee}InsuranceApplicant.
this problem is related to the following location:
at protected java.util.List gov.cms.hix._0_1.hix_ee.InsuranceApplicationType.insuranceApplicant
at gov.cms.hix._0_1.hix_ee.InsuranceApplicationType
at gov.cms.ffe.ee.applicant_eligibility.extension._1.InsuranceApplicationType
at protected gov.cms.ffe.ee.applicant_eligibility.extension._1.InsuranceApplicationType gov.cms.ffe.ee.applicant_eligibility.extension._1.ApplicantEligibilityResponseType.insuranceApplication
at gov.cms.ffe.ee.applicant_eligibility.extension._1.ApplicantEligibilityResponseType
at protected gov.cms.ffe.ee.applicant_eligibility.extension._1.ApplicantEligibilityResponseType gov.cms.ffe.ee.applicant_eligibility.extension._1.ResponseType.applicantEligibilityResponse
at gov.cms.ffe.ee.applicant_eligibility.extension._1.ResponseType
at public gov.cms.ffe.ee.applicant_eligibility.extension._1.ResponseType gov.cms.ffe.ee.applicant_eligibility.extension._1.ObjectFactory.createResponseType()
at gov.cms.ffe.ee.applicant_eligibility.extension._1.ObjectFactory

at com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException$Builder.check(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(Unknown Source)
at com.sun.xml.internal.bind.v2.ContextFactory.createContext(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at javax.xml.bind.ContextFinder.newInstance(Unknown Source)
at javax.xml.bind.ContextFinder.newInstance(Unknown Source)
at javax.xml.bind.ContextFinder.find(Unknown Source)
at javax.xml.bind.JAXBContext.newInstance(Unknown Source)
at javax.xml.bind.JAXBContext.newInstance(Unknown Source)
at com.getinsured.parser.UnMarshaller.main(UnMarshaller.java:22)

AttachmentSize
JAXB_Issue.zip300.37 KB

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
madhuri.devidi
Offline
Joined: 2013-09-13
Points: 0

I am getting the exact issues using jdk1.6.0_45. were you able to resolve your problem? If yes, how? please email at ${username}@gmail.com. I need to consume ffm wsdl and the stubs generated may be not what we want.

yaroska
Offline
Joined: 2006-05-05
Points: 0

Can you please provide xjc command line. Are all schemas from XMLschemas needed?