• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

EJB Reference could not be resolved

 
Ranch Hand
Posts: 339
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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]
 
Ranch Hand
Posts: 446
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
They gave me pumpkin ice cream. It was not pumpkin pie ice cream. Wiping my tongue on this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic