2011-10-10 68 views
1

我正在处理需要解组操作的应用程序。无法导入JABX XmlPath类

这里是我的输入文件结构:

<root> 
     <sender>senderCode</sender> 
     <receiver>receiverCode</receiver> 
     <document-type code="05"/> 
     <date>recDate</date> 
<root> 

,并解组我创建三个POJO类:根GeneralInfo和文档类型

我的问题是,我可以

import org.eclipse.persistence.oxm.annotations.*; 

,但我得到“i ...进口......无法解析”:

import org.eclipse.persistence.oxm.annotations.XmlPath; 

任何人有一个想法如何解决它?

在此先感谢。

+0

哪个版本的EclipseLink的是哟你用? –

回答

0

@XmlPath注释是在EclipseLink 2.1中引入的,因为您可以看到org.eclipse.persistence.oxm.annotations程序包,但不是@XmlPath,因此很可能使用了EclipseLink 2.0。截至今天(2011年10月14日),当前版本为EclipseLink 2.3。的EclipseLink的

新闻稿都可以在这里得到:

欲了解更多有关@XmlPath

+0

嗨布莱斯感谢您的答复。 Im使用EclipseLink 2.3 – achraf

+0

@achraf - 如果您使用的是EclipseLink 2.3,您一定可以看到'org.eclipse.persistence.oxm.annotations.XmlPath'。要确认你使用的是2.3,你可以运行下面的命令:'System.out.println(org.eclipse.persistence.Version.getVersionString());' –