Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 18761 invoked from network); 31 Mar 2008 11:15:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 31 Mar 2008 11:15:17 -0000 Received: (qmail 22190 invoked by uid 500); 31 Mar 2008 11:15:16 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 22163 invoked by uid 500); 31 Mar 2008 11:15:16 -0000 Mailing-List: contact user-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@geronimo.apache.org List-Id: Delivered-To: mailing list user@geronimo.apache.org Received: (qmail 22152 invoked by uid 99); 31 Mar 2008 11:15:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 31 Mar 2008 04:15:16 -0700 X-ASF-Spam-Status: No, hits=2.4 required=10.0 tests=DEAR_SOMETHING,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of manu.t.george@gmail.com designates 209.85.134.184 as permitted sender) Received: from [209.85.134.184] (HELO mu-out-0910.google.com) (209.85.134.184) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 31 Mar 2008 11:14:33 +0000 Received: by mu-out-0910.google.com with SMTP id w9so2430373mue.6 for ; Mon, 31 Mar 2008 04:14:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=0fazTZuzTbvZTLrKXhxDmRcqw7wRKpcpJ0YMTy/P374=; b=lqLjA4MgPgeeedm5ZH/DOsd6oUWdk8cmq3wIvKBJCDtPViwN8oyUFKZIyThnyofMEImzIPlY/ePJx99wdhHSaEPaeJHWP0ditThQR8IDIqLp1rPQ5zN3ErXJ9QcOnxDALXRge38pu7rbMcG26kzBR6PH7FnieRLewk7cZU+iwrY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=K66UBI5BaGe3e1ydWHZE0EYqEdyAx+oWmi/cZO6cL8Fce9mtKZLv8DePkdCH1odiRbPInXfipq2yfPl5zvc1OfJN383PsxiQtPIjAcEAKoYnNmTyx32G43S2KKKpEpz3EoLtg77EIvuOEq3CaQW8A29mEsQEouHOQi+eRJI1LUU= Received: by 10.78.144.11 with SMTP id r11mr19634907hud.78.1206962084049; Mon, 31 Mar 2008 04:14:44 -0700 (PDT) Received: by 10.78.198.20 with HTTP; Mon, 31 Mar 2008 04:14:44 -0700 (PDT) Message-ID: <466797bd0803310414h25601cb7nc3d039a051b09aec@mail.gmail.com> Date: Mon, 31 Mar 2008 16:44:44 +0530 From: "Manu George" To: user@geronimo.apache.org Subject: Re: how to run Ejb program on geronimo In-Reply-To: <16392851.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <16392851.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org Hi, The JNDI Name that you have given is not correct. If you see the log files you can find the correct JNDI Name. You will get lines similar to the one below where ejb/mgmt/MRCLocal is the JNDI Name 21:38:02,125 INFO [startup] Jndi(name=ejb/mgmt/MRCLocal) --> Ejb(deployment-id=agent-ejb.jar/ejb/mgmt/MRC) I am guessing that in your case it will be DemoRemote or DemoBeanRemote You just need to lookup ctx.lookup("DemoRemote"); I believe there is a bug in openejb whereby it doesn't pick the value in the jndi-name tag and instead uses 3.0 style name generation . Regards Manu On Mon, Mar 31, 2008 at 1:22 PM, atul12345 wrote: > > Dear Sir, > > I am new programmer to Geronimo and EJB which are running on > gentoo. i am createing stateful session bean like that........ > This is remote Interface.......... > package My; > > import java.rmi.*; > > import javax.ejb.*; > > public interface DemoInter extends EJBObject > { > public int add(int a,int b) throws RemoteException; > } > > > This is Home Interface.......... > package My; > > import javax.ejb.*; > import java.rmi.*; > > > > public interface DemoHome extends EJBHome > { > public DemoInter create() throws CreateException,RemoteException; > } > > This is Bean class............ > > package My; > > import java.rmi.*; > > import javax.ejb.*; > > public class DemoBean implements SessionBean > { > public DemoBean() { > // TODO Auto-generated constructor stub > } > public void ejbCreate() > { > System.out.println("ejbCreate()"); > } > > public void ejbRemove() > { > System.out.println("ejbRemove()"); > } > > > public void ejbActivate() > { > System.out.println("ejbActivate()"); > } > > public void ejbPassivate() > { > System.out.println("ejbPassivate()"); > } > > > public void setSessionContext(SessionContext ctx){} > > > public int add(int a,int b) throws RemoteException > { > return (a+b); > } > > } > > > open-ejb.xml is where i specified the jndi name > > xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.1" > xmlns:security="http://geronimo.apache.org/xml/ns/security-1.1" > xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.1"> > > > > Demo > org.geronimo.ejbsample.HomeBean > > > > > > > > > > > > and this is my client code........... > > import java.util.*; > import javax.naming.*; > import javax.rmi.*; > import My.*; > > > public class Client { > > /** > * @param args > */ > public static void main(String[] args) { > // TODO Auto-generated method stub > try { > > Properties properties=new Properties(); > properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, > "org.apache.openejb.client.RemoteInitialContextFactory"); > > properties.setProperty(Context.PROVIDER_URL, > "ejbd://localhost:4201" ); > > Context ctx=new InitialContext(properties); > > My.DemoHome > home=(My.DemoHome)ctx.lookup("java:org.geronimo.ejbsample.HomeBean"); > > My.DemoInter object =home.create(); > System.out.println(object.add(12,22)); > > that is my code, everything is ok means deploy successfully but problem is > when i execute client program, that time i get error that is > > javax.naming.NameNotFoundException: org.geronimo.ejbsample.HomeBean does not > exist in the system. Check that the app was successfully deployed. > So if anybody know how to resolve this problem then please give me suitable > suggestion to resolve this problem.. > > -- > View this message in context: http://www.nabble.com/how-to-run--Ejb-program-on-geronimo-tp16392851s134p16392851.html > Sent from the Apache Geronimo - Users mailing list archive at Nabble.com. > >