2

I have a very strange problem which I can't figure out by myself. I have a JSF application that I'm developing and it's deployed on a Tomcat server at client site. It works just fine. However, after a few days, it starts to behave very weird, and I'm getting a lot of exceptions such as the following in the log:

SEVERE: Error Rendering View[/index.xhtml]
com.sun.facelets.tag.TagAttributeException: /menu.xhtml @21,53 test="${!empty bean.menuItems}" /menu.xhtml @21,53 test="${!empty bean.menuItems}": Error reading 'menuItems' on type com.blabla.bean.ApplicationBean
    at com.sun.facelets.tag.TagAttribute.getObject(TagAttribute.java:235)
    at com.sun.facelets.tag.TagAttribute.getBoolean(TagAttribute.java:79)
    at com.sun.facelets.tag.jstl.core.IfHandler.apply(IfHandler.java:49)
    at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
        .....

Please note that bean refers to an object of type com.blabla.bean.ApplicationBean which is an application-scoped bean. The above xhtml code is inside a c:if, that's why I use the $ notation. As mentioned, the application runs just fine for the first 2-3 days, it is only after a few days when these exceptions occur in the log, and they are only related to the only bean that's in application scope. Normally, when I get such exceptions I check if the getter for the 'menuItems' field is in the bean, but it is there and if it wasn't, the application would not work at all and not work fine for 2 days and then crash.

I also encounter exceptions related to the custom resource bundle that I have in my application:

Caused by: javax.faces.FacesException: Could not load resource bundle for name 'messages': Can't find bundle for base name com.blabla.messages.CustomResourceBundle, locale de

Again, the bundle was loaded during the first 2-3 days of the application life, but then this exception occurs all of a sudden.

Has anybody encountered a similar situation? Can anybody point me in the right direction as to where to look for the problem, since I'm completely out of ideas here.

Thank you in advance.

Danubian Sailor
  • 1
  • 38
  • 145
  • 223
user790399
  • 61
  • 4
  • I'm not sure about the cause of your concrete problem, but I just wanted to say that this statement *"The above xhtml code is inside a c:if, that's why I use the $ notation."* is not valid anymore. It was only valid when you're using old JSF 1.0/1.1 on JSP. Since JSF 1.2 and JSP 2.1 (and of course Facelets), you can just use `#{}` in JSTL tags. See also http://stackoverflow.com/questions/4812755/difference-between-jsp-el-jsf-el-and-unified-el/4812883#4812883 – BalusC Apr 11 '12 at 11:29
  • You're probably right, this project was migrated from JSF 1.2 recently ... – user790399 Apr 11 '12 at 11:54
  • 2
    And the additional benefit is that it will autocreate JSF managed beans, so that should "fix" the first problem. But it would not solve the problem at its roots. Have you checked the Tomcat server logs? Any indication that Tomcat has (hot)deployed the webapp? – BalusC Apr 11 '12 at 11:58

0 Answers0