Win a copy of Terraform in Action this week in the Cloud forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

@PostConstruct Method Not Called In JSF 2.0

 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A method annotated with @PostConstruct on my managed bean is not being called in JSF 2.0.

Here is a snippet of my managed bean:



Here's a snippet from my web.xml:



Here's my faces-config.xml



Here's a list of the jars I am using:

antlr-2.7.6.jar
commons-collections-3.1.jar
commons-el-1.0.jar
dom4j-1.6.1.jar
el-impl-2.2.0.jar
hibernate3.jar
javassist-3.9.0.GA.jar
jconn3.jar
jsf-api.jar
jsf-impl.jar
jta-1.1.jar
log4j-1.2.16.jar
slf4j-api-1.5.11.jar
slf4j-simple-1.5.11.jar
tomahawk-1.1.9.jar


Any ideas?
 
Andy Holm
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No one has any idea? What more information could I include to help point to the problem?
 
Saloon Keeper
Posts: 24575
168
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You probably need to include the commons-annotations jar, since I didn't spot it in the list.

I haven't had problems in my JSF 2.0 projects, but I've had spotty results using this annotation in my JSF 1.x projects. I think the server may need some configuration in order to get the classloader to process the annotation properly.

Also, you need to know that if you're using Tomcat6, it should be release 6.0.18 or later, as there were bugs relating to inheritance of annotations in earlier versions. Specifically, inherited annotations weren't being processed.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic