File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes @PostConstruct not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "@PostConstruct not working" Watch "@PostConstruct not working" New topic

@PostConstruct not working

Mohit Chadha
Ranch Hand

Joined: Feb 04, 2007
Posts: 264

I am trying to use @PostConstruct in my managed bean but the method is never called. I am using JSF 1.2, Java 6 and WebLogic 10.3. Can anyone tell me if I am missing something?

Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
All construction/injection callbacks is usually delegated to the appserver. I would consult the Weblogic docs/forum/support if @PostConstruct is supported by the appserver.

At least I can tell that it just works with Tomcat 6 and Glassfish 2 at my dev environment. Sorry, I can't tell more about Weblogic as I've never used it.
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Well, Google at least shows me that you're not the only one who encountered this problem:

Good luck.
I agree. Here's the link:
subject: @PostConstruct not working
Similar Threads
@Preconstruction is being ignored
@PostConstruct == ejbPostCreate( ) ?
@PostConstruct exception handling
@ExcludeClassInterceptors annotation
Life-Cycle Event Interceptor Method Skipped