Please join us at the new JavaWorld Q&A Forums. Your existing login will work there. The discussions here are now read-only.


JavaWorld Talkback >> 960646

Pages: 1
Anonymous
Unregistered




Wrong example
      #35613 - 08/21/06 12:30 PM

The code in the last example is wrong and will throw a NPE.
You must put the create() call in a @PostConstruct method, which will be called after injection has occurred.

@EJB BankingServiceHome bsHome;
BankingService bs;

@PostConstruct
public void init() {
bs = bsHome.create();
}


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 1 anonymous users are browsing this forum.

Moderator:   

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 4611

Rate this topic

Jump to

Contact us JavaWorld

Powered by UBB.threads™ 6.5.5