• Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB DI

 
narain ashwin
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a servlet in which an EJB is injected using the @EJB annotation . The DI injection works fine and I am able to access the bean methods. The problem arises when I recomplie and deploy the servlet class, the DI is not working and I get Null for the Remote interface instance in my servlet.

Eventually if I restart my server it works fine, is there something like the DI will be only once when the servlet is loaded for the first time or am I missing something. BTW I am using weblogic 10.3
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
narain ashwin wrote:Hi,
The problem arises when I recomplie and deploy the servlet class, the DI is not working and I get Null for the Remote interface instance in my servlet.

Did you redeploy the application? And does Weblogic allow replacing class files without redeploying the application?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!