Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB creation time

 
tom damminson
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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);
}
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic