6.20.4 Notes on runtime
The following table describes the notes on runtime.
No. |
Notes |
---|---|
1 |
When performing multi-thread programming, the objects provided in the packages with a name beginning with javax.xml.bind are not thread safe (as an exception, the javax.xml.bind.JAXBContext class is thread safe). Therefore, multiple threads must not access these objects at the same time. To avoid conflicts between threads, use the following method:
|
2 |
During unmarshal and marshal, processing similar to the schema generator might be executed within the product. Therefore, you must also see the notes on the schema generator. |
3 |
Do not execute unmarshal or marshal in the verification mode for the schema document using xs:ENTITY type or xs:ENTITIES type. If you execute unmarshal or marshal, an error indicating 'Entity is not declared' occurs. (Example) KECX06252-E UndeclaredEntity: Entity 'id1' is not declared. |
4 |
[Conditions] When all of the following conditions are applicable:
Operations of Cosminexus XML Processor An exception IllegalArgumentException occurs. (Example) java.lang.IllegalArgumentException: Unexpected node type: [#text: String] |
5 |
[Conditions] When all of the following conditions are applicable:
Operations of Cosminexus XML Processor The marshal process will terminate, but an exception IllegalStateException will be thrown. |
6 |
[Conditions] When all of the following conditions are applicable:
Operations of Cosminexus XML Processor The @XmlJavaTypeAdapter annotation specified in the package level of the class is prioritized than the @XmlJavaTypeAdapter annotation for the class or enumeration type. As the operations differ from the standard specifications, do not perform process for such a java source. |
7 |
[Conditions] When the Java contents tree is changed within the handleEvent method. Operations of Cosminexus XML Processor An exception MarshalException is thrown. |
8 |
[Conditions] When all of the following conditions are applicable:
Operations of Cosminexus XML Processor The marshal method will terminate normally, but an XML document that is not in a proper format is generated. |
9 |
[Conditions] When all of the following conditions are applicable:
Operations of Cosminexus XML Processor An exception JAXBException occurs. Do not perform processing for such a java source. |
10 |
[Conditions] When all of the following conditions are applicable:
Operations of Cosminexus XML Processor The return value of the getURL method includes characters that cannot be specified in RFC2396 as it is. |
11 |
[Conditions] When all of the following conditions are applicable:
Operations of Cosminexus XML Processor An invalid exception occurs in marshal. Such a java source is out of scope for processing. (Example) Exception in thread "main" java.lang.IncompatibleClassChangeError |
12 |
[Conditions] When null is specified in an argument of the setter method of a Java value class. Operations of Cosminexus XML Processor The NullPointerException exception occurs. [Corrective action] Modify the code of the setter method invocation part as follows: (Before modification) items.setId(null); (After modification) items.setId(new String[] {}); |
13 |
[Conditions] When all of the following conditions are applicable:
Operations of Cosminexus XML Processor Unmarshal terminates normally. The element will be unmarshalled without substitution of the type by xsi:type. |
14 |
When an error occurs due to the execution of marshal in the verification mode, an invalid XML (XML that is not in a proper format) might be output for the contents up to the occurrence of the error. |
15 |
When marshal is executed by specifying the jaxb.formatted.output property, the linefeed code of the output XML document will be 0x0A. |
16 |
When marshal is executed, the standalone="yes" pseudo attribute will be output to the XML declaration of the output XML document. |
17 |
[Conditions] When a Node object other than Element, Document, or DocumentFragment is specified in the argument node of the marshal(Object jaxbElement, Node node) method of Marshaller interface. Operations of Cosminexus XML Processor An exception DOMException will be thrown. (Example) org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: KECX01304-E An attempt was made to insert a node where it is not permitted. |
18 |
[Conditions] When all of the following conditions are applicable:
Operations of Cosminexus XML Processor The default values defined in the schema document are not included in the acquired instances. |
19 |
[Conditions] When all of the following conditions are applicable:
Operations of Cosminexus XML Processor The value of the type attribute in the element definition or attribute definition of the generated schema will be {http://ws-i.org/profiles/basic/1.1/xsd}swaRef. The definition of the name space {http://ws-i.org/profiles/basic/1.1/xsd} is generated as xs:import: <xs:import namespace="http://ws-i.org/profiles/basic/1.1/xsd" schemaLocation="http://ws-i.org/profiles/basic/1.1/swaref.xsd"/> Therefore, when validation is performed in the generated schema document, the XML parser references http://ws-i.org/profiles/basic/1.1/swaref.xsd using the http protocol. By setting up the correct org.w3c.dom.ls.LSResourceResolver instance using the appropriate javax.xml.validation.Validator#setResourceResolver method, swaref.xsd can be referenced at any place of existence. |
20 |
[Conditions] When all of the following conditions are applicable:
Operations of Cosminexus XML Processor An exception IllegalArgumentException occurs. |
21 |
[Conditions] When all of the following conditions are applicable:
Operations of Cosminexus XML Processor The package-info.java will not be processed if not compiled beforehand. |
22 |
[Conditions] When all the following conditions are satisfied:
Operations of Cosminexus XML Processor The DOM node will be generated without generating a JAXB object (Java class object corresponding to the schema element definition). |
23 |
[Conditions] When null is specified in the argument of the setEventHandler method in any of the following classes:
Operations of Cosminexus XML Processor The event handler acquired using the getEventHandler method is the default event handler (DefaultValidationEventHandler) of JAXB1.0, and differs from the event handler acquired without executing the setEventHandler method. In such cases, the operations are not guaranteed. |
24 |
[Conditions] When all the following conditions are satisfied:
Operations of Cosminexus XML Processor The specified properties are not valid. |
25 |
Condition When all the following conditions are satisfied:
Operations of Cosminexus XML Processor Regardless of the property settings, XML data with processed linefeeds and indents is output. |
26 |
[Conditions] When the following is specified in unmarshal (XmlNode xmlNode and Class<T> declaredType) of the javax.xml.bind.Binder<XmlNode> class:
Operations of Cosminexus XML Processor Exceptions do not occur. In such cases, operations for executing JAXB are not defined, so the operations are not guaranteed. |
27 |
[Conditions] When the following is specified in updateXML (Object jaxbObject and XmlNode xmlNode) of the javax.xml.bind.Binder<XmlNode> class:
Operations of Cosminexus XML Processor In such cases, operations for executing JAXB are not defined, so the operations are not guaranteed. |
28 |
[Conditions] When the updateXML method of the javax.xml.bind.Binder<XmlNode> class is executed. Operations of Cosminexus XML Processor A new XML tree is created without updating the already existing XML tree that is associated to the JAXB object. Therefore, if the following information is included in the existing XML tree, this information will not be maintained after the method is executed:
Also, a return value of updateXML (Object jaxbObject and XmlNode xmlNode) is not the node as that of the xmlNode argument. Therefore, when executing the updateXML method repetitively, do not specify the same value in the xmlNode argument. |
29 |
[Conditions] When executing the updateXML method of the javax.xml.bind.Binder<XmlNode> class. Operations of Cosminexus XML Processor Association of the JAXB object tree and an XML node having the implemented javax.xml.bind.Binder<XmlNode> class is invalid. Therefore, after executing the method, the execution result of specifying the return value in the getJAXBNode (XmlNode xmlNode) argument is null. Also, when executing the method repetitively, the NullPointerException exception occurs. Workaround Perform the following changes, and in addition to invoking of the updateXML method, also invoke the updateJAXB method of the javax.xml.bind.Binder<XmlNode> class. Before change: binder.updateXML(rootbinder); After change: Node node = binder.updateXML(rootbinder); rootbinder = (Root)binder.updateJAXB(node); |
30 |
[Conditions] When any of the following condition is satisfied:
Operations of Cosminexus XML Processor Events (parseConversionEvent for unmarshalling or printConversionEvent for marshalling) are not generated. |
31 |
[Conditions] When all the following conditions are satisfied:
Example: <foo xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <a/> <b xsi:type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema">abc</b> <c xsi:type="xsd:int" xmlns:xsd="http://www.w3.org/2001/XMLSchema">123</c> </foo> Operations of Cosminexus XML Processor The following error is reported: KECX06253-E UndeclaredPrefix: Cannot resolve 'xsd:string' as a QName: the prefix 'xsd' is not declared. Also, if executing the marshalling without the verification mode, an XML document, in which the required name space is not declared, will be output. |
32 |
[Conditions] When all the following conditions are satisfied:
Operations of Cosminexus XML Processor The contents of the elements within the XML document that corresponds to the field A is output in the xs:dateTime type and not in the xs:date type. Therefore, if you use the schema the schema that is generated with the generateSchema method of the JAXBContext class to perform the schema verification, a verification error will occur. Workaround To output in the xs:date format while marshalling, use the javax.xml.datatype.XMLGregorianCalendar class and not the java.util.Calendar class. |
33 |
[Conditions] When executing the getOffset method of the ValidationEventLocator interface. Operations of Cosminexus XML Processor The return value of the getOffset method is always -1. |