0

EJB Dependency Injection - JNDI Lookup Local Interface

asked 2010-06-21 22:06:32 +0800

safarasa gravatar image safarasa
3 1

I am not able to use Dependency Injection to inject the EJB session beans into the ZK controller (Java class that extends GenericForwardComposer). Also JNDI lookup doesn't work with the local interfaces of the EJB stateless beans.

The only way to get the session beans is using JNDI and looking up their Remote interfaces. But using Remote interfaces and RMI to transport objects between the business tier and ZK (even though they both are on the same application server) is very expensive and not suitable for the enterprise applications.

Is there any way to use JNDI and look up the local interfaces of the EJB session beans or inject them into the ZK controller?

Thank you in advance.

My frameworks are:
Java EE 6
EJB 3.1
Glassfish 3.0
ZK 5.0.2

delete flag offensive retag edit

5 Replies

Sort by ยป oldest newest

answered 2010-06-22 21:11:11 +0800

iantsai gravatar image iantsai
2755 1

if you can use your EJB local Bean inside a simple Servlet Post method, then you can use it in ZK at the same way.

link publish delete flag offensive edit

answered 2010-09-13 23:19:00 +0800

aktejo gravatar image aktejo
155 3

have you tried http://www.zkoss.org/smalltalks/jndi/

link publish delete flag offensive edit

answered 2010-09-14 03:58:53 +0800

xmedeko gravatar image xmedeko
1021 1 16
http://xmedeko.blogspot.c...

Deploy the WAR and EJBs in the same EAR, then you should be able to use local EJB interface.

If I remember it right, the JEE spec. says, that you have to use remote EJB interface when you have EJB and WAR as a separate deployment in the same server. JBoss does not stick to this JEE spec., so you can use EJB local interface, even when it is deployed separately. (Particularly, it depend on the JBoss configuration, let me know, if you would like migrate to the JBoss and use this feature, I'll give you a link how to configure JBoss.)

link publish delete flag offensive edit

answered 2010-09-14 23:59:04 +0800

masum gravatar image masum
33 1
www.optinfra.com

Hi xmedeko,

Now I trying to EJB3 with Jboss and zk application . I have a appropriate solution from zk . but it works good . Here I can not use local interface of ejb3 session bean.
so , I want to use your feature and jboss .
pls give me a link or any suggestion .

Thanks
Masum

link publish delete flag offensive edit

answered 2010-09-15 02:57:40 +0800

xmedeko gravatar image xmedeko
1021 1 16
http://xmedeko.blogspot.c...

Hi Masum,
the keyword is CallByValue. See the difference between servers server\default and server\standard, particularly check the conf and deployers subdirs for this keyword. If you use "default" server, then CallByValue=false and you should be able to use JNDI local calls. At least I am using them in JBoss 5.1.0GA. The "standard" server should behave more like JEE spec.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2010-06-21 22:06:32 +0800

Seen: 1,107 times

Last updated: Sep 15 '10

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More