• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Ejb injection in backing bean

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to Ejb and icefaces. currently i am working in a project which includes ejb3 and icefaces using netbeans IDE.

i trying to using ejb injection in the backing bean of an icefaces page. it works well but i am having a doubt

Code snippet

This works
@EJB(name="java:comp/env/ejb/helloref") and in sun-web.xml

i am providing
<ejb-ref>
<ejb-ref-name>helloref</ejb-ref-name>
<jndi-name>session.NewSessionRemote</jndi-name>
</ejb-ref>


but

@EJB(name="helloref") this doesn't


why and can anyone explain me what it does and what is the fund behind this.


Thanks in Advance
 
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

@EJB(name="helloref") there will be also an other parameter with it called MappedName .

This refers to the EJB class name and the mapped name refers to the JNDI name associated with it.

You should not make a call with ejb name ,but with the mappedname .Then your code will work.
 
viji narasimhan
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi thanks for your reply. but i tried with mappedName again it is throwing the same error namenotfound exception.

i am using glass fish v2
 
author
Posts: 580
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The EJB name is likely not correct. Take a look here: https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html.

Regards,
Reza
 
We can walk to school together. And we can both read this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic