Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 336529 - NULLPOINTEREXCEPTION GENERATING SCHEMA FROM JAXBCONTEXT
Summary: NULLPOINTEREXCEPTION GENERATING SCHEMA FROM JAXBCONTEXT
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-07 11:20 EST by Matt MacIvor CLA
Modified: 2022-06-09 10:25 EDT (History)
1 user (show)

See Also:


Attachments
Proposed Fix (1.34 KB, patch)
2011-02-07 14:50 EST, Matt MacIvor CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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