JAXB绑定异常 [英] JAXB Binding Exception

查看:76
本文介绍了JAXB绑定异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在解析XSD到Java对象时遇到了以下错误

I got the folowing error while parsing the XSD to Java Object


线程main中的异常
java.lang .IllegalArgumentException:
预期的类ja
vax.xml.bind.annotation.XmlAccessType
但找到了类
javax.xml.bind.annotation。 AccessType

Exception in thread "main" java.lang.IllegalArgumentException: Expected class ja vax.xml.bind.annotation.XmlAccessType but found class javax.xml.bind.annotation. AccessType

任何人都可以为此错误提供解决方案

Can any one give the solution for this error

推荐答案

我猜你在Java6下运行XJC,在你的类路径上有 jaxb-api.jar 。 Java6运行时中的类与 jaxb-api.jar 中的类发生冲突。

I would guess that you're running XJC under Java6, and have the jaxb-api.jar on your classpath. The classes from the Java6 runtime are clashing with the classes in jaxb-api.jar.

从类路径中删除JAR,应该修复它(如果这就是问题所在)。

Remove the JAR from the classpath, that should fix it (if that's that's what the problem is).

这篇关于JAXB绑定异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆