Monday, 14 January 2013

Jboss 7, not triggering @PostConstruct

Whilst porting a JSF 2 project over to Jboss 7 I came up against a problem of the @PostConstruct not getting triggered within a @ManagedBean. 

So have:

public class MyController {

  public String inp;

  public void init() {
    // do something

  public void setInp( String inp ) {
    this.inp = inp;

  public String getInp() {
    return inp;

Solution - Add the following to the web.xml:


The Jboss provider also works:

See here for a detailed discussion.

1 comment: