| Summary: | Unnecessary classes being processed | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Blaise Doughan <blaise.doughan> | ||||||||
| Component: | Eclipselink | Assignee: | Blaise Doughan <blaise.doughan> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||
| Severity: | normal | ||||||||||
| Priority: | P3 | CC: | clittleton, guoliangqian | ||||||||
| Version: | unspecified | ||||||||||
| Target Milestone: | --- | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Windows XP | ||||||||||
| URL: | http://stackoverflow.com/questions/4726764/jaxb-provider-eclipselink-moxy-ignores-xmlaccessortypexmlaccesstype-none | ||||||||||
| Whiteboard: | |||||||||||
| Bug Depends on: | |||||||||||
| Bug Blocks: | 334712 | ||||||||||
| Attachments: |
|
||||||||||
Created attachment 187041 [details]
MOXy - Test Cases
Created attachment 187043 [details]
MOXy - Test Cases
Created attachment 187044 [details]
MOXy - Fix
If the property is "transient" do not attempt to process its type.
Fix checked into trunk at rev: 8845 Code reviewed by: Matt MacIvor This still appears to be broken in build: 2.3.0.v20110225-r9029 I am using externally defined xml mapping files instead of annotations, could it be that this is still broken for that case? The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |
For the following object model: import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; @XmlAccessorType(XmlAccessType.NONE) public class Foo { private Bar bar; public Bar getBar() { return bar; } public void setBar(Bar bar) { this.bar = bar; } } and: public class Bar { public Bar(String name) { } } When a JAXBContext is created on these classes the following exception is thrown: Exception in thread "main" javax.xml.bind.JAXBException: Exception Description: The class example.Bar requires a zero argument constructor or a specified factory method. Note that non-static inner classes do not have zero argument constructors and are not supported. - with linked exception: [Exception [EclipseLink-50001] (Eclipse Persistence Services - 2.3.0.qualifier): org.eclipse.persistence.exceptions.JAXBException Exception Description: The class example.Bar requires a zero argument constructor or a specified factory method. Note that non-static inner classes do not have zero argument constructors and are not supported.] at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:266) at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:213) at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:110) at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:100) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:202) at javax.xml.bind.ContextFinder.find(ContextFinder.java:331) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522) at forum119.Demo.main(Demo.java:8) Caused by: Exception [EclipseLink-50001] (Eclipse Persistence Services - 2.3.0.qualifier): org.eclipse.persistence.exceptions.JAXBException Exception Description: The class example.Bar requires a zero argument constructor or a specified factory method. Note that non-static inner classes do not have zero argument constructors and are not supported. at org.eclipse.persistence.exceptions.JAXBException.factoryMethodOrConstructorRequired(JAXBException.java:122) at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.finalizeProperties(AnnotationsProcessor.java:651) at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.processClassesAndProperties(AnnotationsProcessor.java:228) at org.eclipse.persistence.jaxb.compiler.Generator.<init>(Generator.java:147) at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:263) ... 12 more This exception should not be thrown since Bar should never be processed.