remove -----Original Message----- From: JoseMa [mailto:[EMAIL PROTECTED]] Sent: 17 January 2002 08:30 To: Orion-Interest Subject: Re: Lookup EJB's in another application
Hi Patrik, I had the same problem and I look for some information about how to resolv this problem. Although the aplications are in the same server the connection become as if they was in differents servers. I used the RMIContextFactory with the next code: Context context = null; Hashtable env = new Hashtable(); env.put("java.naming.factory.initial","com.evermind.server.rmi.RMIInitialCon textFactory"); env.put("java.naming.provider.url", "ormi://localhost:<rmi port>/<application name>"); try { context = new InitialContext (env); context.lookup("EjbName"); } catch (Exception e) { System.out.println("Conection error"); } If you don't change the values of rmi.xml in the Orion config you don't need specify the rmi port. The applicacion name is the name that appear in server.xml and identify the application. Is possible that you need especify a username and password for connect to applicacion, I don't need it. For specify these parametrers you need to put the next: env.put(Context.SECURITY_PRINCIPAL, "admin"); env.put(Context.SECURITY_CREDENTIALS, "<password>"); I hope that this information can help you. Best regards, ----- Original Message ----- From: "Patrik Strid" <[EMAIL PROTECTED]> To: "Orion-Interest" <[EMAIL PROTECTED]> Sent: Thursday, January 17, 2002 12:47 AM Subject: Lookup EJB's in another application > Hi, > > If you have two applications in the same orion > container. One application with web components and > another with just EJB's. From the application with web > components, I want to lookup an EJB that is deployed > in the other application - is that possible via the > InitialContext or do I have to call it via an URL and > getting the extra RMI call? > > I can get it to work using a provider URL to the other > application, but using the InitialContext, the local > context - it cannot find the bean, or more correct, > the JNDI name could not be found. > > Any help is appreciated ! > > Thanks, > Patrik > > __________________________________________________ > Do You Yahoo!? > Send FREE video emails in Yahoo! Mail! > http://promo.yahoo.com/videomail/ > >
************************************************************************ Your Communications Ltd Hathersage Road Chorlton-on-Medlock Manchester M13 0EH Switchboard number : 0161 609 7000. The information contained in this e-mail is intended only for the individual to whom it is addressed. It may contain privileged and confidential information. If you have received this message in error or there are any problems, please notify the sender immediately and delete the message from your computer. The unauthorised use, disclosure, copying or alteration of this message is forbidden. Your Communications Limited will not be liable for direct, special, indirect or consequential damage as a result of any virus being passed on, or arising from alteration of the contents of this message by a third party. Your Communications Limited (England and Wales No. 3842309) registered office Dawson House, Great Sankey, Warrington, WA5 3LW ************************************************************************