Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332171 - Can't generate a schema if using a factory method and no zero-arg constructor
Summary: Can't generate a schema if using a factory method and no zero-arg constructor
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: 2010-12-08 16:23 EST by Karen Butzke CLA
Modified: 2022-06-09 10:28 EDT (History)
1 user (show)

See Also:


Attachments
NoSuchMethodException stack trace (3.50 KB, text/plain)
2010-12-08 16:23 EST, Karen Butzke CLA
no flags Details
Proposed fix (1.27 KB, patch)
2010-12-09 13:34 EST, David McCann CLA
no flags Details | Diff
Supporting tests (9.41 KB, patch)
2010-12-09 13:35 EST, David McCann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Karen Butzke CLA 2010-12-08 16:23:39 EST
Created attachment 184819 [details]
NoSuchMethodException stack trace

I am using the nightly build .v20101208-r8654. I am attempting to generate a schema using MOXY for the following class with a factory method and no zero-argument constructor. I get the attached exception when EclipseLink attempts to use the zero-arg constructor.

@XmlType(factoryMethod="buildEmployee")
public class Employee {

	private Employee(String name) {
		super();
		this.name = name;
	}

	public static Employee buildEmployee() {
		return new Employee("John");
	}
	private String name;
}
Comment 1 David McCann CLA 2010-12-09 13:34:54 EST
Created attachment 184882 [details]
Proposed fix
Comment 2 David McCann CLA 2010-12-09 13:35:07 EST
Created attachment 184884 [details]
Supporting tests
Comment 3 David McCann CLA 2010-12-09 15:21:12 EST
Reviewed by:  matt.macivor@oracle.com
Tests:  all unit tests pass as expected;  jaxb/xmltype/XmlTypeTestCases
Comment 4 David McCann CLA 2010-12-09 15:25:33 EST
Revision:  8678
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:28:46 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink