Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 336529

Summary: NULLPOINTEREXCEPTION GENERATING SCHEMA FROM JAXBCONTEXT
Product: z_Archived Reporter: Matt MacIvor <matt.macivor>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: john.keeney
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed Fix none

Description Matt MacIvor CLA 2011-02-07 11:20:18 EST
Generating a schema for the following class causes a NullPointer Exception:

@javax.xml.bind.annotation.XmlAccessorType(value=FIELD)
@javax.xml.bind.annotation.XmlType(factoryMethod=, name=getW3CEPR1Response,
propOrder=[_return], factoryClass=class
javax.xml.bind.annotation.XmlType$DEFAULT, namespace=##default)
public class
com.sun.ts.tests.jaxws.wsa.j2w.document.literal.epr.GetW3CEPR1Response
extends java.lang.Object{

    @javax.xml.bind.annotation.XmlElement(nillable=false, name=return,
required=false, defaultValue=
    protected javax.xml.ws.wsaddressing.W3CEndpointReference _return;
  
 public
com.sun.ts.tests.jaxws.wsa.j2w.document.literal.epr.GetW3CEPR1Response();
    public javax.xml.ws.wsaddressing.W3CEndpointReference getReturn();
    public void setReturn(javax.xml.ws.wsaddressing.W3CEndpointReference);
}



STACK TRACE / RELEVANT THREAD DUMP INFORMATION:
-----------------------------------------------
Exception in thread "main" java.lang.NullPointerException
        at
org.eclipse.persistence.jaxb.compiler.SchemaGenerator.getTypeNameForElement(Sc
hemaGenerator.java:2015)
        at
org.eclipse.persistence.jaxb.compiler.SchemaGenerator.buildElement(SchemaGener
ator.java:1862)
        at
org.eclipse.persistence.jaxb.compiler.SchemaGenerator.addToSchemaType(SchemaGe
nerator.java:466)
        at
org.eclipse.persistence.jaxb.compiler.SchemaGenerator.populateSchemaTypes(Sche
maGenerator.java:533)
        at
org.eclipse.persistence.jaxb.compiler.SchemaGenerator.generateSchema(SchemaGen
erator.java:144)
        at
org.eclipse.persistence.jaxb.compiler.SchemaGenerator.generateSchema(SchemaGen
erator.java:130)
        at
org.eclipse.persistence.jaxb.compiler.Generator.generateSchemaFiles(Generator.
java:211)
        at
org.eclipse.persistence.jaxb.JAXBContext.generateSchema(JAXBContext.java:202)
        at
org.eclipse.persistence.jaxb.JAXBContext.generateSchema(JAXBContext.java:178)
        at testing.EprWSDLTest.main(EprWSDLTest.java:64)
Comment 1 Matt MacIvor CLA 2011-02-07 14:50:06 EST
Created attachment 188469 [details]
Proposed Fix
Comment 2 Matt MacIvor CLA 2011-02-11 14:08:01 EST
Attached patch checked in to SVN
Reviewed by David McCann
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:14:18 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:25:13 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink