The global jndi name basically starts at the root, and does not implement the java:/comp environment.
So when you do a lookup of the home in the global from an MBean, you just get an InitialContext() and then lookup: MyLocalHome or ejb/MyLocalHome It also helps to use the JNDIViewer in the JMX-Console which gives you a map of the entire JNDI tree. I never leave home without it :) //Nicholas --- Steven Harris <[EMAIL PROTECTED]> wrote: > 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 ===== Nicholas Whitehead Home: (973) 377 9335 Cell: (201) 615 2716 [EMAIL PROTECTED] Get Your News From The Crowbar: http://crowbar.dnsalias.com:443/crowbar/ ------------------------------------------------------- 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
