0

I am using EJB3 deployed on WAS 8. I am accessing this EJB from my WEB server using Context.lookup. This look up works fine and the entire application works fine for the first time after WAS is restarted. However when I run the application for the second time, the look up does happen, but a NULL value is returned. I dont get any exception or error or any logs on WAS.

Again if I restart the WAS, the application works well.

Can anyone please guide what the issue can be?

Toral
  • 101
  • 1
  • 1
  • 12

1 Answers1

0

Remote references are connection-less proxies. If the application is redeployed/undeployed or there is network failure, the proxies are invalidated.

You can use ServiceLocator pattern for caching the references of the remote objects. You can remove & again re-create them with JNDI lookup when they become invalid.

Nayan Wadekar
  • 11,444
  • 4
  • 50
  • 73