问题
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.
回答1:
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.
来源:https://stackoverflow.com/questions/14671025/how-to-setup-project-to-support-hinputfile-in-jsf-2-2