2011-10-10 75 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());' –