This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes EJB creation time Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB creation time" Watch "EJB creation time" New topic
Author

EJB creation time

tom damminson
Greenhorn

Joined: Mar 03, 2011
Posts: 1
Hi, this is my "little" problem:

I created a session bean:


I created a WS, and I want that it reads the DB at startup:


The problems is that labelFacade is null during WS instance initializer...
I tried to load the bean at startup (changing it to @Singleton @startup, but nothing change...)

Some suggestion? Tnks

PS I'm using Glassfish 3.1

Note that if I call synch(labelfacade) after MyWS is loaded, it works fine.



SOLVED!

I call Sync with PostConstruct clause:

@PostConstruct
public void applicationStartup() {
synch(labelfacade);
}
 
jQuery in Action, 2nd edition
 
subject: EJB creation time