Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
312 views
in Technique[技术] by (71.8m points)

jsf 2.2 - How to setup project to support h:inputfile in JSF 2.2

I'm developing new project which use JSF 2.2. My tools id Netbeans 7.3 Bata1 + Mysql + EclipseLink.

I want to use tag on my project, but after I add JSF 2.2 library to project and test deploy it, I got some warning message:

WARNING: Multiple [2] JMX MBeanServer instances exist, we will use the server at index [0] : [com.sun.enterprise.v3.admin.DynamicInterceptor@6054cd1b].
WARNING: JMX MBeanServer in use: [com.sun.enterprise.v3.admin.DynamicInterceptor@6054cd1b] from index [0] 
WARNING: JMX MBeanServer in use: [com.sun.jmx.mbeanserver.JmxMBeanServer@235fe684] 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

And when I insert to page and open it on browser, I got this error:

/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

How can I fix this problem? I tryto research for a few day, but not found any solution.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

You installed the JAR file containing the API (javax.faces.*), but not the JAR file containing the impl (e.g. Mojarra, com.sun.faces.*). You basically end up with several abstract classes/interfaces from JSF API without the concrete implementation which is doing the real job. It's like as importing and using JDBC code, but not using a vendor-specific JDBC driver (which is the concrete implementation of the JDBC API).

Make sure that you install the JAR with the impl as well. Get the JAR file from both the /jsf-api and /jsf-impl folders here at Maven.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...