2013-02-03 30 views
0

我正在開發使用JSF 2.2的新項目。 我的工具id Netbeans 7.3 Bata1 + Mysql + EclipseLink。如何設置項目以支持JSF 2.2中的h:inputfile

我想在我的項目中使用的標籤,但在我加入JSF 2.2庫項目和測試部署它,我得到了一些警告信息:

WARNING: Multiple [2] JMX MBeanServer instances exist, we will use the server at index [0] : [[email protected]]. 
WARNING: JMX MBeanServer in use: [[email protected]] from index [0] 
WARNING: JMX MBeanServer in use: [[email protected]] from index [1] 
WARNING: WEB9052: Unable to load class javax.faces.render.RendererWrapper, reason: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/faces/render/RendererWrapper 
WARNING: WEB9052: Unable to load class javax.faces.component.UIViewAction, reason: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/faces/component/UIViewAction 
WARNING: WEB9052: Unable to load class javax.faces.component.html.HtmlInputFile, reason: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/faces/component/html/HtmlInputFile 

當我插入到網頁和打開瀏覽器,我得到這個錯誤:

/system/systemThemes.xhtml @188,102 <h:inputFile> Tag Library supports namespace: http://java.sun.com/jsf/html, but no tag was defined for name: inputFile 

我該如何解決這個問題? 我嘗試了幾天的研究,但沒有找到任何解決方案。

回答

4

java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/faces/component/html/HtmlInputFile

你裝含有API(javax.faces.*)JAR文件,但是不含有IMPL(例如鑽嘴魚科,com.sun.faces.*)JAR文件。基本上,您最終會得到來自JSF API的幾個抽象類/接口,而沒有具體的實現來完成真正的工作。這就像導入和使用JDBC代碼一樣,但不使用供應商特定的JDBC驅動程序(這是JDBC API的具體實現)。

請確保您安裝了帶有impl的JAR。從/jsf-api/jsf-impl文件夾中獲取JAR文件here at Maven