1

I am getting error below on every action after migrating from JSF 1.2 and RF 3.3 to JSF 2.1 and RF 4. Also my CSS styles is not as to be. I think my CSS problem can related to this issue.

23.Ara.2011 23:03:42 com.sun.faces.application.ApplicationImpl createValidator
SEVERE: JSF1005: Cannot instantiate validator of type javax.faces.Bean

I search on the net but couldn't find any solution.

How is this caused and how can I solve it?

Subodh Joshi
  • 12,717
  • 29
  • 108
  • 202
Mustafa
  • 98
  • 1
  • 2
  • 10

1 Answers1

2

Your webapp's runtime classpath is dirty.

This is a pretty generic problem which can not have a single suitable answer without having a complete overview of all libraries supplied in the webapp deploy. My best guess would be that you've placed RichFaces source code JAR files in /WEB-INF/lib. RichFaces ships with separate JAR files for the binary classes and for the source code. You should not put RichFaces source code JAR files (the ones with a filename ending on -source) in the classpath. Remove them and keep the binary JAR files. The source code JAR files contain in turn also several startup scripts. They should not be executed twice.

As to the CSS problem, this is likely unrelated. RichFaces loads CSS through the new JSF2 <h:head> component. Make sure that you have in your (master) template(s) a <h:head> instead of <head>.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • Hi BalusC thank you for your reply. I have this jars in my WEB-INF/lib. I didnt place RF sorucode Jar files. My web inf libs are below. Could you pls have a look. ant-antlr.jar antlr-runtime.jar antlr.jar common-annotations.jar commons-beanutils.jar commons-collections.jar commons-digester.jar commons-logging.jar cssparser-0.9.5.jar dom4j.jar guava-r09.jar hibernate-annotations.jar hibernate-commons-annotations.jar hibernate-core.jar hibernate-entitymanager.jar hibernate-search.jar hibernate-validator.jar javassist.jar javax.faces-2.1.4.jar – Mustafa Dec 23 '11 at 21:35
  • mysql-connector-java-5.1.7-bin.jar persistence-api.jar richfaces-components-api-4.1.0.Final.jar jsf-tlds.jar jstl.jar jta-1.1.jar jta.jar log4j.jar lucene-core.jar richfaces-components-ui-4.1.0.Final.jar richfaces-core-api-4.1.0.Final.jar richfaces-core-impl-4.1.0.Final.jar sac-1.3.jar slf4j-api.jar slf4j-log4j12.jar standard.jar – Mustafa Dec 23 '11 at 21:37
  • Which appserver impl/version exactly are you using? Tomcat? – BalusC Dec 23 '11 at 21:37
  • yes apache-tomcat-6.0.18. By the way I my CSS files are included in the h:head and when I check with firefox web developer plugin I can see that my css file is loaded. – Mustafa Dec 23 '11 at 21:46
  • JSF 2.1 requires servlet 3.0. Upgrade to Tomcat 7 and update webapp's `web.xml` to comply servlet 3.0. – BalusC Dec 23 '11 at 21:51
  • Hi BalusC I did what you say. Upgrade to tomcat 7 and update my `web.xml` file. But unfortunately the result is the same. I create a new project with another name with jsf 2.0 and web 3.0 spec. Then copy my files to that project. When I run that project I surprisingly see that the error I gave above occured. That make me think if it may be due to my libs. But I don't know how and which? – Mustafa Dec 25 '11 at 13:31
  • I reread the list of your libs again, the `jsf-tlds.jar` look very suspicious. Where did you get it from? Remove it. TLDs are supposed to be already inside the `javax.faces` JAR file. – BalusC Dec 25 '11 at 15:49
  • Hi BalusC I finally found the reason. `` has caused this error. I remove that components and the issue resolved. By the way I also drop jsf-tld.jar. Thank you so much for your guide. – Mustafa Dec 25 '11 at 16:30