This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes JSF and the fly likes Target Unreachable, identifier 'subjectsListController' resolved to null Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Target Unreachable, identifier Watch "Target Unreachable, identifier New topic

Target Unreachable, identifier 'subjectsListController' resolved to null

Tim Wise

Joined: Jul 25, 2009
Posts: 15

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:

Tim Wise

Joined: Jul 25, 2009
Posts: 15
Hello again,

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...

I agree. Here's the link:
subject: Target Unreachable, identifier 'subjectsListController' resolved to null