• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Devaka Cooray
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
Bartenders:

Target Unreachable, identifier 'subjectsListController' resolved to null

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

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

Thanks,
Tim

P.S. I use mojarra JSF 2.0 RC

P.P.S. Managed bean class:

P.3.S. Error stacktrace:

 
Tim Wise
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...

Tim
 
Time flies like an arrow. Fruit flies like a banana. Steve flies like a tiny ad:
Paul Wheaton's 16th Kickstarter: Gardening playing cards for gardeners and homesteaders
https://coderanch.com/t/889615/Paul-Wheaton-Kickstarter-Gardening-playing
reply
    Bookmark Topic Watch Topic
  • New Topic