Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Descriptor for class was not found in the project"
Descriptor for class was not found in the project" [message #1707393] Fri, 04 September 2015 12:58
Jared Fucci is currently offline Jared FucciFriend
Messages: 3
Registered: July 2015
Junior Member
All I can find are article and topics for " A descriptor with default root element <0> was not found in the project", i can't find anything on just "A descriptor for class <0> was not found in the project. " I had this original project that worked fine until we moved to 12c and now the marshalling of these is giving me this issue. I'm not great with JAXB and I don't even know what is exactly meant by "descriptor", they mean namespace? But I have working on this for days and I can't figure it out, any help would be greatly appreciated.

The command that causes the error(last line):
javax.xml.bind.Marshaller bindmarshaller = 	JAXBContext.newInstance(this.schema).createMarshaller();
StringWriter writer = new StringWriter();

bindmarshaller.marshal(header, new StreamResult(writer));


The plugin that binds the xmls:
			<plugin>
				<groupId>com.sun.tools.xjc.maven2</groupId>
				<artifactId>maven-jaxb-plugin</artifactId>
				<version>1.1</version>
				<executions>
					<execution>
						<goals>
							<goal>generate</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<removeOldOutput>true</removeOldOutput>
					<schemaDirectory>
						src/main/resources/
					</schemaDirectory>
					<includeSchemas>
						<includeSchema>**/*.xsd</includeSchema>
					</includeSchemas>
					<includeBindings>
						<includeBinding>**/*.xjb</includeBinding>
						<includeBinding>**/jaxb-bindings.xml</includeBinding>
					</includeBindings>
				</configuration>
				<dependencies> 
					<!-- JAxb api -->
  					<dependency>
						<groupId>javax.xml.bind</groupId>
						<artifactId>jaxb-api</artifactId>
						<version>2.2</version>
						<scope>compile</scope>
					</dependency> 
					<!-- JAxb impl - needed for deployment -->
 					<dependency>
						<groupId>com.sun.xml.bind</groupId>
						<artifactId>jaxb-impl</artifactId>
						<version>2.2</version>
						<scope>compile</scope>
					</dependency>
					<dependency>
						<groupId>com.sun.xml.bind</groupId>
						<artifactId>jaxb-xjc</artifactId>
						<version>2.2</version>
						<scope>compile</scope>
					</dependency>
				</dependencies>
			</plugin>	



The xjb file that is bound:
<?xml version="1.0" encoding="UTF-8"?>
<jxb:bindings version="1.0"
               xmlns:jxb="<removed to post>"
               xmlns:xs="<removed to post>">
               
   	<jxb:bindings schemaLocation="CSHeaderSchema.xsd" node="/xs:schema">
	    <jxb:schemaBindings>
	      <jxb:package name="<removed package>" />
	    </jxb:schemaBindings>
  	</jxb:bindings>
</jxb:bindings>


The schema:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="Header" xmlns:xs="<removed to post>" version="1.0.0"> 
  <xs:annotation>
    <xs:documentation>
    
    </xs:documentation>
  </xs:annotation>
  <xs:element name="CSHeader"> 
    <xs:complexType>
      <xs:sequence>
        <xs:element name="MsgType" minOccurs="1">

      ...

</xs:schema>


The error I get:
javax.xml.bind.MarshalException
 - with linked exception:
[Exception [EclipseLink-25007] (Eclipse Persistence Services - 2.4.2.v20130514-5956486): org.eclipse.persistence.exceptions.XMLMarshalException
Exception Description: 
A descriptor for class <removed package>.CSHeader was not found in the project.  
For JAXB, if the JAXBContext was bootstrapped using TypeMappingInfo[] you must call a marshal method that accepts TypeMappingInfo as an input parameter.
Previous Topic:Need to extend existing ComplexType defined in XSD to accept empty strings from XML
Next Topic:Entity is not updated
Goto Forum:
  


Current Time: Fri Mar 05 19:20:17 GMT 2021

Powered by FUDForum. Page generated in 0.01593 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top