我使用MOXy 2.6使用MOXy JAXB上下文生成JSON。在使用jaxbContext = JAXBContextFactory.createContext(beanArray,null)创建JAXB上下文时;我低于错误。请帮我解决这个问题。
引起:java.lang.StackOverflowError at java.lang.ClassLoader.getClassLoadingLock(ClassLoader.java:464)[rt.jar:1.7.0_80-ea] 在java.lang.ClassLoader.loadClass(ClassLoader.java:405)[rt.jar:1.7.0_80-ea] at sun.misc.Launcher $ AppClassLoader.loadClass(Launcher.java:308)[rt.jar:1.7.0_80-ea] 在java.lang.ClassLoader.loadClass(ClassLoader.java:358)[rt.jar:1.7.0_80-ea] 在org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:370)[jboss-modules.jar:1.3.0.Final-redhat-2] 在org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:118)[jboss-modules.jar:1.3.0.Final-redhat-2] 在org.eclipse.persistence.internal.jaxb.JaxbClassLoader.loadClass(JaxbClassLoader.java:107)[eclipselink.jar:2.6.0.v20141224-924f6b4] at org.eclipse.persistence.jaxb.javamodel.reflection.JavaModelImpl.getClass(JavaModelImpl.java:97)[eclipselink.jar:2.6.0.v20141224-924f6b4] at org.eclipse.persistence.jaxb.javamodel.Helper.getJavaClass(Helper.java:214)[eclipselink.jar:2.6.0.v20141224-924f6b4] 在org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.processChoiceProperty(AnnotationsProcessor.java:2485)[eclipselink.jar:2.6.0.v20141224-924f6b4] at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.processPropertyTypes(AnnotationsProcessor.java:1193)[eclipselink.jar:2.6.0.v20141224-924f6b4] at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.buildNewTypeInfo(AnnotationsProcessor.java:4948)[eclipselink.jar:2.6.0.v20141224-924f6b4] at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.processReferencedClass(AnnotationsProcessor.java:918)[eclipselink.jar:2.6.0.v20141224-924f6b4] at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.processChoiceProperty(AnnotationsProcessor.java:2511)[eclipselink.jar:2.6.0.v20141224-924f6b4] at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.processPropertyTypes(AnnotationsProcessor.java:1193)[eclipselink.jar:2.6.0.v20141224-924f6b4] at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.buildNewTypeInfo(AnnotationsProcessor.java:4948)[eclipselink.jar:2.6.0.v20141224-924f6b4] at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.processReferencedClass(AnnotationsProcessor.java:918)[eclipselink.jar:2.6.0.v20141224-924f6b4] at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.processChoiceProperty(AnnotationsProcessor.java:2511)[eclipselink.jar:2.6.0.v20141224-924f6b4] at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.processPropertyTypes(AnnotationsProcessor.java:1193)[eclipselink.jar:2.6.0.v20141224-924f6b4] at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.buildNewTypeInfo(AnnotationsProcessor.java:4948)[eclipselink.jar:2.6.0.v20141224-924f6b4] at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.processReferencedClass(AnnotationsProcessor.java:918)[eclipselink.jar:2.6.0.v20141224-924f6b4] at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.processChoiceProperty(AnnotationsProcessor.java:2511)[eclipselink.jar:2.6.0.v20141224-924f6b4] at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.processPropertyTypes(AnnotationsProcessor.java:1193)[eclipselink.jar:2.6.0.v20141224-924f6b4] at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.buildNewTypeInfo(AnnotationsProcessor.java:4948)[eclipselink.jar:2.6.0.v20141224-924f6b4]
答案 0 :(得分:1)