Hi to all,
I am using NetBeans in my work for developing spring application with JSF 2 and RichFaces 3.3.3.Final. At first I was using as application server JBoss 5.1.0.GA, where are JSF 2 not supported, so I've replaced JBoss's JSF libraries and slightly changed its web.xml. When I've deployed the application and make initial request, app worked fine, but in JBoss log I got following exception:
15:46:46,738 SEVERE Error Loading Library: vfs:/C:/jboss-6.1.0.Final/server/default/deploy/simple610App.war/WEB-INF/lib/jsf-impl.jar/com/sun/faces/metadata/taglib/jstl-fn.taglib.xml: java.io.IOException: Error parsing :
after hours of discovering the problem, I've decided to use JBoss 6.1.0.Final, which uses JSF 2 by default, but for my surprise I got the same error as when deploy the application on 5.1.0. I've tried several things like creating application from the beginning and adding some changes iteratively but this does not help.
Does anybody has an idea, what to do?
I haven't used Richfaces for a couple of years, but here is what I think about your problem:
It would seem that you have jsf-impl.jar in your Simple5App.war file. But JBoss already contains a copy of the jsf-impl.jar, so there is no need for another copy in your *.war file. The solution is to remove the jsf-impl.jar in your Simple5App.war/WEB-INF/lib before deploying your the *.war.
thanks for your reply, but I have tried this and after that I got the same error from JBoss libraries:
14:37:12,840 SEVERE [compiler] Error Loading Library: vfszip:/C:/Program Files/jboss-5.1.0.GA/server/default/deploy/feisPortal.war/WEB-INF/lib/jsf-impl.jar/com/sun/faces/metadata/taglib/ui.taglib.xml
java.io.IOException: Error parsing [vfszip:/C:/Program Files/jboss-5.1.0.GA/server/default/deploy/feisPortal.war/WEB-INF/lib/jsf-impl.jar/com/sun/faces/metadata/taglib/ui.taglib.xml]:
I don't really what to do, same error occurs when deploying on AS 6.1.0.Final, which use jsf 2 by default.
I am sorry ebross,
I posted bad stacktrace. The error I am getting after removing jsf libraries from my project is following:
15:57:43,554 ERROR [[/feisPortal]] StandardWrapper.Throwable
java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.context.FacesContextFactory
Ha! You also need to remove "jsf-api.jar" from your /WEB-INF/lib. FacesContextFactory is in this jar.
Sorry I forgot to mention it. Well I did warn you earlier that my Richfaces/JSF is a bit rusty :-)
If I remember correctly, in your 'web.xml' you could add the following:
If param-value is 'true', then JBoss will use the jsf-impl.jar and jsf-api.jar you have in your /WEB-INF/lib, otherwise it will use it own copies (as in the first Solution). Unless you have a good reason to do this, I would suggest against it. Duplicate jar files will increase the size of your foo.war file.
Now I've found the solution. Problem was causing library jboss-el-2.0.0.GA.jar and its expression factory defined in deployment descriptor web.xml:
<context-param> <param-name>com.sun.faces.expressionFactory</param-name> <param-value>org.jboss.el.ExpressionFactoryImpl</param-value> </context-param>
But by using this library is possible to use JSF 2 expressions on JBoss 5.1.0.GA, which supports only jsf 1.2.