Closed glassfishrobot closed 16 years ago
Reported by najmi
najmi said: Created an attachment (id=9) rim.xsd schema file
najmi said: Created an attachment (id=10) Sample instance document that causes copyTo to fail
najmi said: Created an attachment (id=11) proposed patch to fix issue
najmi said: Lexi, I have attached a patch to fix the issue. It is reliable but kludgy handling of lack of clone method in org.apache.xerces.dom.ElementNSImpl.clone().
Please comment of whether I should commit this change or not. Thanks. If I commit it we will need to do a new release to include this change. I will be counting on you for that.
lexi said: Fixed in 0.4.1.2. I've added your fix to JAXBCopyBuilder, added a test case and a new tests/issues module as a showcase for this. Works quite fine. Thank you for logging the issue and providing the fix.
File: ExtrinsicObject_GMLEnvelopeSlot.xml Attached By: najmi
File: issue-16-patch.txt Attached By: najmi
File: rim.xsd Attached By: najmi
Was assigned to lexi
This issue was imported from java.net JIRA JAXB2_COMMONS-16
Marked as fixed on Friday, November 21st 2008, 8:28:21 pm
In rim.xsd file (attached) I have the following schema:
When I use copyTo method on a JAXB generated binding instance based on instance file ExtrinsicObject_GMLEnvelopeSlot.xml (attached) I get exception below. The problem is due to org.apache.xerces.dom.ElementNSImpl not implementing a clone(0 method.
I am looking for a fix in the following code: ./basic/src/main/java/org/jvnet/jaxb2_commons/plugin/copyable/CopyablePlugin.java ./runtime/src/main/java/org/jvnet/jaxb2_commons/lang/builder/CopyBuilder.java
java.lang.UnsupportedOperationException: Could not clone the object [[gml:Envelope: null]] as invocation of the clone() method has thrown an exception. at org.jvnet.jaxb2_commons.lang.builder.CopyBuilder.copy(CopyBuilder.java:34) at org.jvnet.jaxb2_commons.lang.builder.JAXBCopyBuilder.copy(JAXBCopyBuilder.java:36) at org.freebxml.omar.jaxb.bindings.rim._4_0.AnyValueType.copyTo(AnyValueType.java:132) at org.jvnet.jaxb2_commons.lang.builder.JAXBCopyBuilder.copy(JAXBCopyBuilder.java:24) at org.jvnet.jaxb2_commons.lang.builder.JAXBCopyBuilder.copy(JAXBCopyBuilder.java:44) at org.jvnet.jaxb2_commons.lang.builder.JAXBCopyBuilder.copy(JAXBCopyBuilder.java:20) at org.freebxml.omar.jaxb.bindings.rim._4_0.ValueListType.copyTo(ValueListType.java:158) at org.jvnet.jaxb2_commons.lang.builder.JAXBCopyBuilder.copy(JAXBCopyBuilder.java:24) at org.freebxml.omar.jaxb.bindings.rim._4_0.SlotType.copyTo(SlotType.java:234) at org.jvnet.jaxb2_commons.lang.builder.JAXBCopyBuilder.copy(JAXBCopyBuilder.java:24) at org.jvnet.jaxb2_commons.lang.builder.JAXBCopyBuilder.copy(JAXBCopyBuilder.java:44) at org.jvnet.jaxb2_commons.lang.builder.JAXBCopyBuilder.copy(JAXBCopyBuilder.java:20) at org.freebxml.omar.jaxb.bindings.rim._4_0.ExtensibleObjectType.copyTo(ExtensibleObjectType.java:163) at org.freebxml.omar.jaxb.bindings.rim._4_0.IdentifiableType.copyTo(IdentifiableType.java:140) at org.freebxml.omar.jaxb.bindings.rim._4_0.RegistryObjectType.copyTo(RegistryObjectType.java:492) at org.freebxml.omar.jaxb.bindings.rim._4_0.ExtrinsicObjectType.copyTo(ExtrinsicObjectType.java:245) at org.freebxml.omar.jaxb.bindings.rim._4_0.ExtrinsicObjectType.copyTo(ExtrinsicObjectType.java:275) at .... Caused by: java.lang.NoSuchMethodException: org.apache.xerces.dom.ElementNSImpl.clone() at java.lang.Class.getMethod(Class.java:1605) at org.jvnet.jaxb2_commons.lang.builder.CopyBuilder.copy(CopyBuilder.java:16) ... 40 more
Environment
Operating System: All Platform: All
Affected Versions
[current]