What is this "global" JNDI name? Could you give me an example?

-----Original Message-----
From: Alexey Loubyansky [mailto:[EMAIL PROTECTED]
Sent: Saturday, August 23, 2003 11:33 AM
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] How to get EJB's LocalHome from MBean?


Milen Dyankov wrote:

> Hi,
> 
> can you please explain how can one call Session or Entity Bean from an 
> MBen?
> 
> I was under the impression that because the EJB and the MBean are 
> deployed in
> the same JBoss instance (does this means same VM?)

Yes.

The code below is ok except you should use bean's (global) JNDI name.
MBean's do not have Enterprise Naming Context (aka ENC) like EJB.

alex

> something like :
> 
> ...
> Context initial = new InitialContext();
> MyBeanLocalHome objref = 
> (MyBeanLocalHome)initial.lookup("java:comp/env/MyBean");
> ...
> 
> will work in my MBean, but it doesn't. I get 
> "javax.naming.NameNotFoundException: env not bound"
> May be I should configure this in "jboss-service.xml". Currently it is 
> generated by XDoclet and
> looks something like
> 
>   <mbean code="pl.laser"
>          name="LASER:application=MyApp,service=MyService"
>          xmbean-dd="pl/laser/myservice.xml">
> 
>   </mbean>
> 
> 
> Can someone provide an example code of single-method MBean calling 
> "helloWorld" of some SLSB?
> 
> 
> Thanks in advance
> Milen
> 
> 
> 
> 
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: VM Ware
> With VMware you can run multiple operating systems on a single machine.
> WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
> at the same time. Free trial click 
> here:http://www.vmware.com/wl/offer/358/0
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
> 



-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to