(This seems a duplicate of https://stackoverflow.com/questions/5862085/weblogic10-3-ignores-postconsturt-method, but that has little details and is not answered).
I have a ManagedBean like this:
public class TestBean {
private String greeting = "Hello, World!";
public TestBean() {
}
public String getGreeting() {
System.out.println( "getGreeting called, returning " + this.greeting );
return greeting;
}
public void setGreeting( String message ) {
this.greeting = message;
}
@PostConstruct
public void prepareSomething() {
System.out.println( "\n\nPostConstruct called.\n\n" );
this.greeting += " (PostConstruct was called)";
}
}
and in my xhtml, I have simply Bean Message: #{TestBean.greeting}
. When accessing the page, however, the method is not called, and what I get is
Bean Message: Hello, World!
instead of the expected
Bean Message: Hello, World! (PostConstruct was called)
Console does display sysout's from the getGreeting()
method, but not from prepareSomething()
:
INFO: Added Library from: zip:/data/java/wl1034/user_projects/domains/wlrep1034/autodeploy/PCTest.ear/PCTest.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jstl-fn.taglib.xml
getGreeting called, returning Hello, World!
2011-05-12 10:36:11,720 DEBUG org.richfaces.skin.SkinFactoryImpl - Create new Skin instance for name DEFAULT
Further info: I am using JSF 1.2 (using the jars from Weblogic 10.3.4's MW_HOME/common/deployable-libs/jsf-1.2.war!/WEB-INF/lib
), Facelets 1.1.14, RichFaces 3.3.2. I have the following jars on WEB-INF/lib
:
commons-beanutils-1.7.0.jar
commons-digester-1.8.jar
commons-logging-1.1.1.jar
glassfish.jsf_1.0.0.0_1-2-15.jar
glassfish.jstl_1.2.0.1.jar
javax.jsf_1.1.0.0_1-2.jar
jsf-facelets.jar
log4j-1.2.16.jar
richfaces-api-3.3.2.SR1.jar
richfaces-impl-3.3.2.SR1.jar
richfaces-ui-3.3.2.SR1.jar
SimpleJSF.jar
wls.jsf.di.jar
I have tried placing/removing annotations-api.jar
as well, same symptoms.
I may post other files if necessary.