• 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
  • Ron McLeod
  • Junilu Lacar
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • Carey Brown
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • fred rosenberger
  • salvin francis

How to declare session bean with local view in ejb-jar.xml

 
Ranch Hand
Posts: 140
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How come this does not work?

no jndi name is created on startup. I cannot access it using
@EJB SampleBeanLocal bean;
It throws javax.naming.NameNotFoundException



but this does work, a jndi-name is created and can be accessed using @EJB

 
Ranch Hand
Posts: 623
1
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I assume that in no-interface view you changed your code to this:


right? I guess that you use explicit name of the bean, so you need to use this name when accessing it using @EJB annotation (beanName attribute or lookup attribute).

When you use the local business view, did you try looking the EJB using JNDI name (lookup(-) method - not the @EJB annotation).
Also, what if you use annotations instead of ejb-jar.xml (@Stateful @Local and @Statful @LocalBean respectively) - will it work?

What EJB container do you use?

Cheers!
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It should be <business-local> instead of <local>
 
kurt hanni
Ranch Hand
Posts: 140
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jaikiran Pai wrote:It should be <business-local> instead of <local>



stupid me! its working now thanks thanks
 
kurt hanni
Ranch Hand
Posts: 140
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
whats the difference of using <local> and <business-local> when using it to define the session view,

code samples that I was following was using <local>/<remote>, but this not work
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

kurt hanni wrote:whats the difference of using <local> and <business-local> when using it to define the session view,



See these:

https://coderanch.com/t/475601/EJB-JEE/java/Confused-getting-reference-interface#2131276
https://coderanch.com/t/414957/EJB-JEE/java/EJBObject#1828744
 
kurt hanni
Ranch Hand
Posts: 140
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks again Jaikiran, that cleared it up.
 
You showed up just in time for the waffles! And 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
reply
    Bookmark Topic Watch Topic
  • New Topic