I see the below error randomly (not every time).
我随机(不是每次)看到下面的错误。
Error while converting jaxb objects to xml
将jaxb对象转换为xml时出错
Caused by: java.lang.NullPointerException: Cannot invoke "com.sun.org.apache.xml.internal.dtm.ref.ExtendedType.getNodeType()" because "this.m_extendedTypes[ExpandedNameID]" is null
at com.sun.org.apache.xml.internal.dtm.ref.ExpandedNameTable.getType(ExpandedNameTable.java:348) ~[?:?]
at com.sun.org.apache.xalan.internal.xsltc.dom.SAXImpl.getMapping(SAXImpl.java:568) ~[?:?]
at com.sun.org.apache.xalan.internal.xsltc.dom.DOMAdapter.getMapping(DOMAdapter.java:105) ~[?:?]
at com.sun.org.apache.xalan.internal.xsltc.dom.DOMAdapter.getExpandedTypeID(DOMAdapter.java:224) ~[?:?]
at die.verwandlung.GregorSamsa.applyTemplates() ~[?:?]
at die.verwandlung.GregorSamsa.transform() ~[?:?]
at com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:627) ~[?:?]
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:782) ~[?:?]
Java
Java语言
openjdk version "17.0.8" 2023-07-18
OpenJDK Runtime Environment Temurin-17.0.8+7 (build 17.0.8+7)
OpenJDK 64-Bit Server VM Temurin-17.0.8+7 (build 17.0.8+7, mixed mode, sharing)
Maven dependencies used:
使用的Maven依赖项:
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.1</version>
</dependency>
Added the option -XX:+ShowCodeDetailsInExceptionMessages to get the more details. Below is what I got from the after adding the option -XX:+ShowCodeDetailsInExceptionMessages
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 71
at com.sun.org.apache.xalan.internal.xsltc.dom.DOMAdapter.getExpandedTypeID(DOMAdapter.java:227) ~[?:?]
at die.verwandlung.GregorSamsa.applyTemplates() ~[?:?]
at die.verwandlung.GregorSamsa.transform() ~[?:?]
at com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:627) ~[?:?]
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:782) ~[?:?]
更多回答
优秀答案推荐
我是一名优秀的程序员,十分优秀!