I face some weird (to my mind ) exception with my facelet-based applicaiton. I have a session-scoped managed bean and an xhtml page using it. The managed bean is defined in faces-config.xml and it works fine. The weird thing - is that when I remove its declaration from faces-config.xml and add appropriate annotations into managed bean class - I get the error (stacktrace below). Even more - all these is true only when I build and deploy the application into Tomcat (Tomcat 6.0) manually. When my IDE does it (IDEA) - everything works fine and I even get message that the managed bean is loaded twice (a warning in logs). In other words, it looks like when I build and deploy my application manually - it doesn't process annotations for managed beans.
I've searched google and found out that there are similar problems, but non of the prosposed solutions helped me - my faces-config.xml is OK (verison 2.0), annotations are correct (I hope - my code is below), and I've tried to change the bean scope as well - it doesn't work for me. I've also tried removing <f:view> from my xhtml (previoulsy I was using pure JSF 1.2) - the same thing - this doesn't help.
I will appreciate any help
P.S. I use mojarra JSF 2.0 RC
P.P.S. Managed bean class:
P.3.S. Error stacktrace:
Joined: Jul 25, 2009
I've found out what was the difference between the application built by IDEA and my own one. IDEA doesn't package classes into a jar.
So, to sum up, if classes end up in /WEB-INF/classes, but not /WEB-INF/lib/myjar.jar - then everything works fine. Otherwise - managed beans are not identified by annotations. That's really strange for me. Although I have a workaround now (do not pack classes into jar) - I'm still curious why is it that JSF annotations are not considered for classes in jar...
subject: Target Unreachable, identifier 'subjectsListController' resolved to null