• Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB Reference could not be resolved  RSS feed

 
Jose Campana
Ranch Hand
Posts: 339
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good day,

I'm working with EJB3 in OC4J, but so far it's been a sincere pain try to get it to work. Apparently OC4J can't locate my EJB's remote proxy. Here's How it's configured inside OC4J (as displayed by the JNDI browser(jndi-browse.jpg))

However I'm getting the following error while trying to inject an EJB:

WARNING J2EE JNDI-00009 EJB Reference "jose/HelloBean" could not be resolved. Allowing J2EEContext creation to continue anyway
and this warning halts execution completely, even though somewhere I read it's supposed to be just a Warning.

Here is my EJB Implementation:


And this is the Servlet that Calls the EJB:



Why can't I Resolve this EJB ?

Please Help Me, I really need this to work...

Sincerely,

Jose

PS. I wish Mr. Reza Rahman could help me out with this one, like he has helped me in the past. I believe He's one of the few who can (I hope I'm wrong though)
jndi_browse.jpg
[Thumbnail for jndi_browse.jpg]
 
Deepak Pant
Ranch Hand
Posts: 446
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you change your declaration in Servlet to following and test the same code? Under WebSphere 6.1 and 7.0 you dont need to specify anything with the EJB annotation.

 
Jose Campana
Ranch Hand
Posts: 339
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Deepak !

Thanks for your response. First of all, I'll tell you that I think I'm a step closer to solving this problem, While reading OC4J's docs I found that an additional attribute is required in web.xml in the Web App for the container to process annotations:



But even though the previous problem vanished, injection through @EJB still does Not work !
I have followed your advice and removed all the attributes from the annotation, but the problem is the same, The result of calling this Servlet is a code 500 Error (meaning the resource isn't available I believe, in this case Injection failed, right?)

Asides from that, I have tried the old fashioned lookup using an Initial Context, and in that way it works very well:



I still need to use Dependency Injection, but at this point I'm completely clueless about what could possibly be causing the problem. It's so frustrating and sad.

Please Help Me.

Thanks for everything as always,

Jose
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!