Discussion:
javax.xml.bind.JAXBException: doesnt contain ObjectFactory.class or jaxb.index
Gary
2017-04-03 23:26:25 UTC
Permalink
thank you in advance
I have my jaxb annotated class path defined in the Jaxb contextPath, I also
have the jaxb.index file with the simple name of the annotated class in it.
I continue to get the error in subject. ???? I even added the jaxb.index
physically under my classpath. Java 1.7, camel 2.15

here's my camel context
<camelContext
id="Camel.Context.XML.Tranformer"
trace="false"
xmlns="http://camel.apache.org/schema/blueprint">
<dataFormats>
<jaxb id="myJaxb" prettyPrint="true"
contextPath="com.ge.ip.zone3.decoders"/>
</dataFormats>

<route id="SmartSignal.Database.Xml.Translate.Route" autoStartup="true">
<from uri="{{inputUri}}" />
<log message="Received XML file ${file:name}" />
<marshal ref="myJaxb" />

<log message="sending ${file:name} to output" />
<to uri="{{outputUri}}" />
</route>

</camelContext>
-----
under com.ge.ip.zone3.decoders
jaxb.index
SSDatabaseDecoder.java
---------------
simple jaxb annotated class
--
package com.ge.ip.zone3.decoders;

import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlSeeAlso;
import java.util.List;
import java.util.Map;

@XmlRootElement(name = "TransferDataHeader")
@XmlAccessorType(XmlAccessType.FIELD)
public class SSDatabaseDecoder {

@XmlElement(name = "ApplicationId")
// @Field("ApplicationId")
private String ApplicationId;

@XmlElement(name = "Category")
// @Field("Category")
private String Category;

@XmlElement(name = "ClientApplicationVersionBuild")
// @Field("ClientApplicationVersionBuild")
private String ClientApplicationVersionBuild;

@XmlElement(name = "ClientApplicationVersionMajor")
// @Field("ClientApplicationVersionMajor")
private String ClientApplicationVersionMajor;

@XmlElement(name = "ClientApplicationVersionMinor")
// @Field("ClientApplicationVersionMinor")
private String ClientApplicationVersionMinor;

@XmlElement(name = "ClientApplicationVersionRevision")
// @Field("ClientApplicationVersionRevision")
private String ClientApplicationVersionRevision;

@XmlElement(name = "ContractVersion")
// @Field("ContractVersion")
private String ContractVersion;

@XmlElement(name = "ExportedUtcDate")
// @Field("ExportedUtcDate")
private String ExportedUtcDate;

@XmlElement(name = "ExporterFirstName")
// @Field("ExporterFirstName")
private String ExporterFirstName;

@XmlElement(name = "ExporterLastName")
// @Field("ExporterLastName")
private String ExporterLastName;

@XmlElement(name = "ExporterLoginId")
// @Field("ExporterLoginId")
private String ExporterLoginId;

@XmlElement(name = "HeaderVersion")
// @Field("HeaderVersion")
private String HeaderVersion;

@XmlElement(name = "ImportedDate")
// @Field("ImportedDate")
private String ImportedDate;

@XmlElement(name = "ImporterId")
// @Field("ImporterId")
private String ImporterId;

@XmlElement(name = "InstallationId")
// @Field("InstallationId")
private String InstallationId;

@XmlElement(name = "InstallationName")
// @Field("InstallationName")
private String InstallationName;

@XmlElement(name = "ItemId")
// @Field("ItemId")
private String ItemId;

@XmlElement(name = "ItemName")
// @Field("ItemName")
private String ItemName;

@XmlElement(name = "ProductBuildNumber")
// @Field("ProductBuildNumber")
private String ProductBuildNumber;

@XmlElement(name = "ProductPatchNumber")
// @Field("ProductPatchNumber")
private String ProductPatchNumber;

@XmlElement(name = "ProductVersion")
// @Field("ProductVersion")
private String ProductVersion;

@XmlElement(name = "ProductVersionMajor")
// @Field("ProductVersionMajor")
private String ProductVersionMajor;

@XmlElement(name = "ProductVersionMinor")
// @Field("ProductVersionMinor")
private String ProductVersionMinor;

public SSDatabaseDecoder() {
super();
}

public String getApplicationId() {
return ApplicationId;
}

public void setApplicationId(String ApplicationId) {
this.ApplicationId = ApplicationId;
}

public String getCategory() {
return Category;
}

public void setCategory(String Category) {
this.Category = Category;
}

public String getClientApplicationVersionBuild() {
return ClientApplicationVersionBuild;
}

public void setClientApplicationVersionBuild(String
ClientApplicationVersionBuild) {
this.ClientApplicationVersionBuild = ClientApplicationVersionBuild;
}

public String getClientApplicationVersionMajor() {
return ClientApplicationVersionMajor;
}

public void setClientApplicationVersionMajor(String
ClientApplicationVersionBuild) {
this.ClientApplicationVersionMajor = ClientApplicationVersionMajor;
}

public String getClientApplicationVersionMinor() {
return ClientApplicationVersionMinor;
}

public void setClientApplicationVersionMinor(String
ClientApplicationVersionMinor) {
this.ClientApplicationVersionMinor = ClientApplicationVersionMinor;
}

public String getClientApplicationVersionRevision() {
return ClientApplicationVersionRevision;
}

public void setClientApplicationVersionRevision(String
ClientApplicationVersionRevision) {
this.ClientApplicationVersionRevision =
ClientApplicationVersionRevision;
}

public String getContractVersion() {
return ContractVersion;
}

public void setContractVersion(String ContractVersion) {
this.ContractVersion = ContractVersion;
}

public String getExportedUtcDate() {
return ContractVersion;
}

public void setExportedUtcDate(String ExportedUtcDate) {
this.ExportedUtcDate = ExportedUtcDate;
}

public String getExporterFirstName() {
return ExporterFirstName;
}

public void setExporterFirstName(String ExporterFirstName) {
this.ExporterFirstName = ExporterFirstName;
}

public String getExporterLastName() {
return ExporterLastName;
}

public void setExporterLastName(String ExporterLastName) {
this.ExporterLastName = ExporterLastName;
}

public String getExporterLoginId() {
return ExporterLoginId;
}

public void getExporterLoginId(String ExporterLoginId) {
this.ExporterLoginId = ExporterLoginId;
}

public String getHeaderVersion() {
return HeaderVersion;
}

public void setHeaderVersion(String HeaderVersion) {
this.HeaderVersion = HeaderVersion;
}

public String getImportedDate() {
return ImportedDate;
}

public void setImportedDate(String ImportedDate) {
this.ImportedDate = ImportedDate;
}

public String getImporterId() {
return ImporterId;
}

public void setImporterId(String ImporterId) {
this.ImporterId = ImporterId;
}

public String getInstallationId() {
return InstallationId;
}

public void setInstallationId(String InstallationId) {
this.InstallationId = InstallationId;
}

public String getInstallationName() {
return InstallationName;
}

public void setInstallationName(String InstallationName) {
this.InstallationName = InstallationName;
}

public String getItemId() {
return ItemId;
}

public void setItemId(String ItemId) {
this.ItemId = ItemId;
}

public String getItemName() {
return ItemName;
}

public void setItemName(String ItemName) {
this.ItemName = ItemName;
}

public String getProductBuildNumber() {
return ProductBuildNumber;
}

public void setProductBuildNumber(String ProductBuildNumber) {
this.ProductBuildNumber = ProductBuildNumber;
}

public String getProductPatchNumber() {
return ProductPatchNumber;
}

public void setProductPatchNumber(String ProductPatchNumber) {
this.ProductPatchNumber = ProductPatchNumber;
}

public String getProductVersion() {
return ProductVersion;
}

public void setProductVersion(String ProductVersion) {
this.ProductVersion = ProductVersion;
}

public String getProductVersionMajor() {
return ProductVersionMajor;
}

public void setProductVersionMajor(String ProductVersionMajor) {
this.ProductVersionMajor = ProductVersionMajor;
}

public String getProductVersionMinor() {
return ProductVersionMinor;
}

public void setProductVersionMinor(String ProductVersionMinor) {
this.ProductVersionMinor = ProductVersionMinor;
}

}




-----
Gary Lee Mills
--
View this message in context: http://camel.465427.n5.nabble.com/javax-xml-bind-JAXBException-doesnt-contain-ObjectFactory-class-or-jaxb-index-tp5796884.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Gary
2017-04-04 13:25:54 UTC
Permalink
it turns out I had the jaxb.index file in the wrong location.

it needs to be under maven structure "resources".
so I added the resources/com/ge/ip/zone3/decoders and place the jaxb.index
here, and it works.

thank you



-----
Gary Lee Mills
--
View this message in context: http://camel.465427.n5.nabble.com/javax-xml-bind-JAXBException-doesnt-contain-ObjectFactory-class-or-jaxb-index-tp5796884p5796915.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Loading...