From user-return-9929-apmail-geronimo-user-archive=geronimo.apache.org@geronimo.apache.org Tue Apr 08 07:09:40 2008 Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 56608 invoked from network); 8 Apr 2008 07:09:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Apr 2008 07:09:39 -0000 Received: (qmail 56788 invoked by uid 500); 8 Apr 2008 07:09:37 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 56759 invoked by uid 500); 8 Apr 2008 07:09:37 -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 56748 invoked by uid 99); 8 Apr 2008 07:09:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Apr 2008 00:09:37 -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 (nike.apache.org: local policy) Received: from [98.136.44.61] (HELO smtp106.prem.mail.sp1.yahoo.com) (98.136.44.61) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 08 Apr 2008 07:08:43 +0000 Received: (qmail 55566 invoked from network); 8 Apr 2008 07:09:02 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:X-YMail-OSG:X-Yahoo-Newman-Property:Mime-Version:In-Reply-To:References:Content-Type:Message-Id:Content-Transfer-Encoding:From:Subject:Date:To:X-Mailer; b=O0Ujr/dKTg1unFW6Gf0G/Bni9housNw13JTe/EwsxP7JmHaC3j/9ib/cGS3c8/EXBs78+l3Vp0NLvdckh0jALwTautbsknbY+RF8a+WOK9o7vHGPfu/rHGfwoj0hR0PMYIS9TpSPrIynSLQKhPccDqgk6BG8BN81mCI12UA725o= ; Received: from unknown (HELO ?192.168.1.106?) (david_jencks@67.102.173.8 with plain) by smtp106.prem.mail.sp1.yahoo.com with SMTP; 8 Apr 2008 07:09:01 -0000 X-YMail-OSG: Q31DibkVM1lUQdmrdf8SDvdJLqTk1K4GSunqxXwdjmkg0LmyLsPeYueBeUIT08v5zjTQsxwdNOvNaTAgymBlsaYgMqBnYd6QzW1FwS_.obhwxOBZzXg7saHRQ_q6CWwgj02HW6ATCkA- X-Yahoo-Newman-Property: ymail-3 Mime-Version: 1.0 (Apple Message framework v753) In-Reply-To: <16547953.post@talk.nabble.com> References: <16392851.post@talk.nabble.com> <16417878.post@talk.nabble.com> <466797bd0804010414h2daeae7cq9af565b530bb6310@mail.gmail.com> <16442215.post@talk.nabble.com> <16444488.post@talk.nabble.com> <16465788.post@talk.nabble.com> <747B0F3C-0853-44C1-B5B0-218E6DC751B3@yahoo.com> <16482909.post@talk.nabble.com> <196DF5AB-3E48-4BD5-BD98-2D1F381E9B64@yahoo.com> <16535345.post@talk.nabble.com> <16547953.post@talk.nabble.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: David Jencks Subject: Re: how to run Ejb program on geronimo Date: Tue, 8 Apr 2008 00:09:01 -0700 To: user@geronimo.apache.org X-Mailer: Apple Mail (2.753) X-Virus-Checked: Checked by ClamAV on apache.org My apologies for not seeing that you are trying to name your ejb the same as the spec required MEJB. I recommend you remove the jndi-name tag from your openejb-jar.xml plan and use the default binding location that you can see by looking at the log of deployment of your app. In the future please examine the environment for signs of errors and report them all. In this case the deployment error occurred well before you tried to access the ejb and knowing about it would have helped give better advice sooner. BTW my previous comment that you are actually looking up the spec-required MEJB home rather than your ejb is borne out by the deployment error. thanks david jencks On Apr 7, 2008, at 11:22 PM, atul12345 wrote: > > Dear Sir, > > Thanks for help but this is not my solution. Anyway > sir i have > already provided all code that i am using for simple stateless session > bean.I am using two interface one is remote interface with one > method that > is add and second is home interface and one bean class which > implements the > sessionBean interface.and two xml which are ejb-jar.xml and other is > openejb.xml.after i created one jar file that include the two > interface,one > bean class and two xml which are exist in meta-inf.when i deployed > this jar > file into the server that show successfully deployed.bt when i checked > server log file it show Jndi(name=ejb/mgmt/MEJBRemoteHome) cannot > be bound > to Ejb(deployment-id=ejbsample1.jar/ejb/mgmt/MEJB). Name already > taken by > Ejb(deployment-id=mejb/ejb/mgmt/MEJB). > and when i run my client program get this kind of na error ........... > java.lang.ClassCastException at > com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow > (PortableR at > javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137) > at HelloWorld.main(HelloWorld.java:31) > Caused by: java.lang.ClassCastException: $Proxy0 cannot be cast to > org.omg.CORBA at > com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow > (PortableR > ... 2 more > And my client code is > > import java.util.*; > import javax.rmi.PortableRemoteObject; > import javax.naming.*; > import javax.rmi.*; > import javax.ejb.*; > import java.rmi.RemoteException; > //import com.prokriti.server.*; > > > 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.put("java.naming.provider.url","ejbd://localhost: > 4201"); > // > Context context = new InitialContext > (properties); > Object homeObject = > context.lookup("mgmt/MEJBRemoteHome"); > System.out.println("ic = "+homeObject); > //Object abc=PortableRemoteObject.narrow > (homeObject, > DemoHome.class); > DemoHome home = > (DemoHome)PortableRemoteObject.narrow(homeObject, DemoHome.class); > DemoInter remote =home.create(); > //remote.display(); > > > > > > > } catch(Exception e) { > System.err.println("NamingException: " + e.getMessage()); > } > // catch(RemoteException e) { > // System.err.println("RemoteException: " + e.getMessage()); > // } catch(CreateException e) { > // System.err.println("FinderException: " + e.getMessage()); > // } > > > > } > > } > > Problem is i think could not get the correct jndi name. so where to > find > correct jndi name and what m i doing wrong.please > help me ....becoz i have already spent lot of time to resolve that > problem > but could not get any suitable response to resolve this problem.so > i hope to > Anyone that can help me to resolve this problem.............. > > > > > > Kevan Miller wrote: >> >> On Mon, Apr 7, 2008 at 3:51 AM, atul12345 >> wrote: >> >>> >>> Dear Sir, >>> >>> Thanks for help but this is not my solution. Anyway >>> according >>> to u i am showing the ENTIRE stack trace for this exception and >>> include >>> the >>> exact source code........ >>> >>> >>> This is my Exception which is generated during the client program >>> execute....... >>> java.lang.ClassCastException >>> at >>> com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow >>> (PortableR >>> at >>> javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java: >>> 137) >>> at HelloWorld.main(HelloWorld.java:31) >>> Caused by: java.lang.ClassCastException: $Proxy0 cannot be cast to >>> org.omg.CORBA >>> at >>> com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow >>> (PortableR >>> ... 2 more >>> >>> Could anyone tell me what I'm doing wrong? Thanks a lot. Looking >>> forward >>> to >>> hearing from you. >>> >> >> Hi, >> I sent an earlier response, but it seems to have bounced. Trying >> again. >> Apologies, if this is redundant. >> >> The above stacktrace indicates a "HelloWorld" class. Yet, the code >> you >> supply below is a "Client" class and the line numbers don't match. >> Thus, >> we're not sure what you are actually running with... Please make >> sure you >> are running the code you think you are. Then, if you still have a >> problem, >> give us the code which matches your symptoms. >> >> --kevan >> >> >> >>> >>> >>> These are my code.......... >>> >>> ********remote interface******* >>> package My; >>> >>> import java.rmi.*; >>> >>> import javax.ejb.*; >>> >>> public interface DemoInter extends EJBObject >>> { >>> public int add(int a,int b) throws RemoteException; >>> } >>> >>> ************home interface*********** >>> package My; >>> >>> import javax.ejb.*; >>> import java.rmi.*; >>> >>> >>> >>> public interface DemoHome extends EJBHome >>> { >>> public DemoInter create() throws >>> CreateException,RemoteException; >>> } >>> *************bean class************* >>> >>> package My; >>> >>> import javax.ejb.*; >>> import java.rmi.*; >>> >>> public class DemoBean implements SessionBean >>> { >>> int a,b; >>> private SessionContext context; >>> public void setSessionContext(SessionContext ctx) >>> {this.context=ctx} >>> >>> public void ejbCreate( ) >>> { >>> >>> System.out.println("ejb Created"); >>> } >>> >>> public void ejbActivate(){System.out.println("ejbActivate()");} >>> public void ejbPassivate(){System.out.println("ejbPassivate()");} >>> public void ejbRemove(){System.out.println("distroyed");} >>> public int add(int a,int b) throws RemoteException >>> { >>> return(a+b); >>> } >>> } >>> >>> **********ejb-jar.xml**************** >>> >>> >>> >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >>> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee >>> http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd" >>> version="2.1"> >>> Example of a session bean >>> MyTimeBeanEJBName >>> >>> >>> >>> My.DemoEJB >>> My.DemoHome >>> My.DemoInter >>> My.DemoBean >>> >>> Stateful >>> Container>> type> >>> >>> >>> >>> >>> *************openejb.xml*********** >>> >>> >>> >> xmlns:nam="http://geronimo.apache.org/xml/ns/ >>> naming-1.1" >>> xmlns:pkgen="http://www.openejb.org/xml/ns/pkgen-2.0" >>> xmlns:security=" >>> http://geronimo.apache.org/xml/ns/security-1.1" >>> xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.1"> >>> >>> >>> >>> >>> My.DemoEJB >>> ejb/mgmt/MEJBRemoteHome >>> >>> >>> >>> >>> >>> ***********my client************** >>> >>> >>> >>> >>> import java.util.*; >>> import javax.rmi.PortableRemoteObject; >>> 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.put("java.naming.provider.url","ejbd://localhost:4201"); >>> >>> Context ctx=new InitialContext(properties); >>> System.out.println("ic = " + ctx); >>> >>> //MyTimeLocal myTimeLocal = >>> (MyTimeLocal)context.lookup("java:comp/env/ejb/MyTimeBean"); >>> // My.DemoInter remoteObj >>> =(My.DemoInter)ctx.lookup("ejb/mgmt/MEJBRemoteHome"); >>> Object >>> object=ctx.lookup("ejb/mgmt/MEJBRemoteHome"); >>> // System.out.println("hello" +object); >>> My.DemoHome ejbHome >>> =(My.DemoHome)PortableRemoteObject.narrow(object,My.DemoHome.class); >>> System.out.println("hello" +ejbHome); >>> My.DemoInter obj1=ejbHome.create(); >>> System.out.println(obj1.add(4,5)); >>> >>> >>> >>> >>> >>> } catch (Exception e) { >>> System.out.println(e); >>> // TODO: handle exception >>> } >>> >>> >>> >>> } >>> >>> } >>> >>> >>> this is log file.......... >>> >>> 13:02:24,839 INFO [SupportedModesServiceImpl] Portlet mode >>> 'edit' not >>> found >>> for portletId: '/plugin.Deployment!227983155|0' >>> 13:02:30,987 INFO [SupportedModesServiceImpl] Portlet mode >>> 'edit' not >>> found >>> for portletId: '/plugin.Deployment!227983155|0' >>> 13:02:34,611 INFO [SupportedModesServiceImpl] Portlet mode >>> 'edit' not >>> found >>> for portletId: '/plugin.Deployment!227983155|0' >>> 13:02:35,732 INFO [SupportedModesServiceImpl] Portlet mode >>> 'edit' not >>> found >>> for portletId: '/plugin.Deployment!227983155|0' >>> 13:02:40,045 INFO [config] Configuring Service(id=Default Stateless >>> Container, type=Container, provider-id=Default Stateless Container) >>> 13:02:40,045 INFO [config] Configuring Service(id=Default Stateful >>> Container, type=Container, provider-id=Default Stateful Container) >>> 13:02:40,045 INFO [config] Configuring Service(id=Default BMP >>> Container, >>> type=Container, provider-id=Default BMP Container) >>> 13:02:40,046 INFO [config] Configuring Service(id=Default CMP >>> Container, >>> type=Container, provider-id=Default CMP Container) >>> 13:02:40,046 INFO [config] Configuring app: >>> default/ejbsample1.jar/1207553559310/jar >>> 13:02:40,078 INFO [OpenEJB] Auto-deploying ejb DemoEJB: >>> EjbDeployment(deployment-id=ejbsample1.jar/DemoEJB) >>> 13:02:40,079 INFO [config] Loaded Module: >>> default/ejbsample1.jar/1207553559310/jar >>> 13:02:40,976 INFO [startup] Assembling app: >>> >>> /home/atul/santemp/geronimo-tomcat6-javaee5-2.1/var/temp/geronimo- >>> deployer17419.tmpdir/ejbsample1.jar >>> 13:02:40,985 INFO [startup] Jndi(name=DemoEJBRemoteHome) --> >>> Ejb(deployment-id=ejbsample1.jar/DemoEJB) >>> 13:02:40,985 INFO [startup] Created >>> Ejb(deployment-id=ejbsample1.jar/DemoEJB, ejb-name=DemoEJB, >>> container=Default Stateless Container) >>> 13:02:40,985 INFO [startup] Deployed >>> >>> Application(path=/home/atul/santemp/geronimo-tomcat6-javaee5-2.1/ >>> var/temp/geronimo-deployer17419.tmpdir/ejbsample1.jar) >>> 13:02:41,083 INFO [SupportedModesServiceImpl] Portlet mode >>> 'edit' not >>> found >>> for portletId: '/plugin.Deployment!227983155|0' >>> >>> >>> >>> >>> djencks wrote: >>>> >>>> We seem to be going around in circles. I don't believe the >>>> exception >>>> you show is consistent with the client code you show. Please show >>>> the ENTIRE stack trace for this exception and include the exact >>>> source code as a file so I can see the line numbers from the client >>>> code matching up with the stack trace. I cannot investigate >>>> further >>>> without some definite correspondence that I can see clearly between >>>> the pieces of information you supply. >>>> >>>> thanks >>>> david jencks >>>> >>>> On Apr 3, 2008, at 9:51 PM, atul12345 wrote: >>>> >>>>> >>>>> >>>>> >>>>> Dear sir, >>>>> >>>>> I am sure, when i running the client code, got that >>>>> Exception. I have already mentioned all exception which throw >>>>> during the >>>>> execution of client program. >>>>> if u want again so that is.... >>>>> please sir provide me write solution to resolve this problem becoz >>>>> i have >>>>> already spent two to three days resolve it problem. >>>>> >>>>> java.lang.ClassCastException >>>>> at >>>>> com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow >>>>> (PortableR >>>>> at >>>>> javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java: >>>>> 137) >>>>> at HelloWorld.main(HelloWorld.java:31) >>>>> Caused by: java.lang.ClassCastException: $Proxy0 cannot be cast to >>>>> org.omg.CORBA >>>>> at >>>>> com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow >>>>> (PortableR >>>>> ... 2 more >>>>> >>>>> Could anyone tell me what I'm doing wrong? Thanks a lot. Looking >>>>> forward to >>>>> hearing from you. >>>>> >>>>> >>>>> djencks wrote: >>>>>> >>>>>> Are you sure you are running the client code you show? The error >>>>>> indicates you are using PortableRemoteObject.narrow() rather >>>>>> than the >>>>>> simple cast in the client code you showed earlier. >>>>>> >>>>>> Is the CCE happening on the client? >>>>>> >>>>>> I'm unable to see how the exception you show can be coming >>>>>> from the >>>>>> code you show. More of the exception stack trace might >>>>>> possibly be >>>>>> helpful. >>>>>> >>>>>> david jencks >>>>>> >>>>>> >>>>>> On Apr 2, 2008, at 10:05 PM, atul12345 wrote: >>>>>> >>>>>>> >>>>>>> >>>>>>> Thanks for help but this is not problem that is when i run my >>>>>>> client >>>>>>> program that time i get error....... >>>>>>> java.lang.ClassCastException: $Proxy0 cannot be >>>>>>> cast to >>>>>>> My.DemoInter >>>>>>> >>>>>>> Actually sir i have already mentioned interfaces,bean class >>>>>>> and my >>>>>>> client >>>>>>> and xml. so please check that code and tell me what i am doing >>>>>>> wrong. >>>>>>> Actually sir i had spent already three days to run one simple >>>>>>> ejb >>>>>>> program i >>>>>>> think geronimo server is not good for ejb. >>>>>>> >>>>>>> >>>>>>> please help me to give suitable response.......... >>>>>>> >>>>>>> >>>>>>> vhnguy2 wrote: >>>>>>>> >>>>>>>> Hi Atul, >>>>>>>> >>>>>>>> It looks like you're doing a remote lookup. I think your client >>>>>>>> code >>>>>>>> should look something similar to >>>>>>>> >>>>>>>> My.DemoInter remoteObj =(My.DemoInter)ctx.lookup(>>>>>>> remote >>>>>>>> interface>); >>>>>>>> >>>>>>>> Let me know if this works. >>>>>>>> >>>>>>>> Thanks, >>>>>>>> Viet >>>>>>>> >>>>>>>> >>>>>>>> On Wed, Apr 2, 2008 at 4:12 AM, atul12345 >>>>>>>> wrote: >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> atul12345 wrote: >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> Hi Sir, >>>>>>>>>> Thanks for help. I appreciate your attention. See >>>>>>>>>> ya! >>>>>>>>>> This is my ejb-jar.xml file here i do have all the >>>>>>>>>> classes >>>>>>>>> means >>>>>>>>>> interface name. >>>>>>>>>> >>>>>>>>>> >>>>>>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >>>>>>>>>> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee >>>>>>>>>> http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd" >>>>>>>>>> version="2.1"> >>>>>>>>>> Example of a session bean >>>>>>>>>> MyTimeBeanEJBName >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> My.DemoEJB >>>>>>>>>> My.DemoHome >>>>>>>>>> My.DemoInter >>>>>>>>>> My.DemoBean >>>>>>>>>> >>>>>>>>>> Stateful >>>>>>>>>> Container>>>>>>>>> transaction- >>>>>>>>>> type> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> When I try to execute my client , I receive this error >>>>>>>>>> message: >>>>>>>>>> java.lang.ClassCastException. >>>>>>>>>> >>>>>>>>>> java.lang.ClassCastException >>>>>>>>>> at >>>>>>>>>> com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow >>>>>>>>>> (PortableR >>>>>>>>>> at >>>>>>>>>> javax.rmi.PortableRemoteObject.narrow >>>>>>>>>> (PortableRemoteObject.java: >>>>>>>>>> 137) >>>>>>>>>> at HelloWorld.main(HelloWorld.java:31) >>>>>>>>>> Caused by: java.lang.ClassCastException: $Proxy0 cannot be >>>>>>>>>> cast to >>>>>>>>>> org.omg.CORBA >>>>>>>>>> at >>>>>>>>>> com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow >>>>>>>>>> (PortableR >>>>>>>>>> ... 2 more >>>>>>>>> >>>>>>>>> >>>>>>>>>> >>>>>>>>>> Could anyone tell me what I'm doing wrong? Thanks a lot. >>>>>>>>>> Looking >>>>>>>>> forward >>>>>>>>>> to hearing from you. >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> manucet wrote: >>>>>>>>>>> >>>>>>>>>>> Hi Atul, >>>>>>>>>>> I am not sure but did you specify the home and >>>>>>>>>>> remote >>>>>>>>>>> interfaces in the ejb-jar.xml file? If yes it will be >>>>>>>>>>> helpful >>>>>>>>>>> if you >>>>>>>>>>> can provide a test case. >>>>>>>>>>> >>>>>>>>>>> Regards >>>>>>>>>>> Manu >>>>>>>>>>> >>>>>>>>>>> On Tue, Apr 1, 2008 at 4:33 PM, atul12345 >>>>>>>>>>> >>>>>>>>> wrote: >>>>>>>>>>>> >>>>>>>>>>>> Actually after resolved jndi name problem i get one new >>>>>>>>>>>> error >>>>>>>>>>>> that >>>>>>>>> is >>>>>>>>>>>> >>>>>>>>>>>> java.lang.ClassCastException: $Proxy0 cannot be cast to >>>>>>>>>>>> My.DemoHome >>>>>>>>>>>> if anyone have any idea what is this so please give me >>>>>>>>>>>> suitable >>>>>>>>>>>> soluation >>>>>>>>>>>> to resolve that problem......... >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> 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="http://www.openejb.org/xml/ns/openejb-jar-2.1" >>>>>>>>>>>>> >>>>>>>>>>>> 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- >>>>>>>>> tp16392851s134p16417878.html >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> Sent from the Apache Geronimo - Users mailing list >>>>>>>>>>>> archive at >>>>>>>>>>>> Nabble.com. >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> View this message in context: >>>>>>>>> http://www.nabble.com/how-to-run--Ejb-program-on-geronimo- >>>>>>>>> tp16392851s134p16444488.html >>>>>>>>> >>>>>>>>> >>>>>>>>> Sent from the Apache Geronimo - Users mailing list archive at >>>>>>>>> Nabble.com. >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> -- >>>>>>> View this message in context: http://www.nabble.com/how-to- >>>>>>> run--Ejb- >>>>>>> program-on-geronimo-tp16392851s134p16465788.html >>>>>>> Sent from the Apache Geronimo - Users mailing list archive at >>>>>>> Nabble.com. >>>>>>> >>>>>> >>>>>> >>>>>> >>>>> >>>>> -- >>>>> View this message in context: http://www.nabble.com/how-to-run-- >>>>> Ejb- >>>>> program-on-geronimo-tp16392851s134p16482909.html >>>>> Sent from the Apache Geronimo - Users mailing list archive at >>>>> Nabble.com. >>>>> >>>> >>>> >>>> >>> >>> -- >>> View this message in context: >>> http://www.nabble.com/how-to-run--Ejb-program-on-geronimo- >>> tp16392851s134p16535345.html >>> Sent from the Apache Geronimo - Users mailing list archive at >>> Nabble.com. >>> >>> >> >> > > -- > View this message in context: http://www.nabble.com/how-to-run--Ejb- > program-on-geronimo-tp16392851s134p16547953.html > Sent from the Apache Geronimo - Users mailing list archive at > Nabble.com. >