Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 93191 invoked from network); 20 Nov 2007 14:18:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Nov 2007 14:18:17 -0000 Received: (qmail 87365 invoked by uid 500); 20 Nov 2007 14:18:02 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 87344 invoked by uid 500); 20 Nov 2007 14:18:02 -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 87333 invoked by uid 99); 20 Nov 2007 14:18:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Nov 2007 06:18:01 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of vhnguy2@gmail.com designates 66.249.92.173 as permitted sender) Received: from [66.249.92.173] (HELO ug-out-1314.google.com) (66.249.92.173) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Nov 2007 14:17:51 +0000 Received: by ug-out-1314.google.com with SMTP id 29so1290531ugc for ; Tue, 20 Nov 2007 06:17:43 -0800 (PST) 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=fpx/RTHjJLpvGZ4LxYcmqDOCZpQc7DMrhwBISR5S7fU=; b=WW+iyzW57iq7CgllKbqDV14dTytFAUeUTyqxzDg4MONGuo7ldscuRaUnJrnHa5zwAaVJtBBWlh7QrP0MkvCK8QTLr/plRc9ra3tszHn+ouJ3zBksa6hxgH5E60Vds/8TgGko3C1NhLWmMqbQLNPvFcAUpz7jhE6RHAbN6CNQFL8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ovsTzr654DK8qf8FYTru4h41AK/Ms8X6E5bJaZfXx2T1iRTbZ75wTjcKBaACIR8csiuL6rhdi7zoNE/JE+C9mQNBKXBBc5FQuIxkfkPl+UZACP95pPqawplBMKytMkia0yzbgt+BFzyY3ZLjkaUX5b0YYRJRfMWq1sQdTOueFVs= Received: by 10.78.149.15 with SMTP id w15mr6682791hud.1195568262759; Tue, 20 Nov 2007 06:17:42 -0800 (PST) Received: by 10.78.203.6 with HTTP; Tue, 20 Nov 2007 06:17:42 -0800 (PST) Message-ID: Date: Tue, 20 Nov 2007 09:17:42 -0500 From: "Viet Nguyen" To: user@geronimo.apache.org Subject: Re: java.lang.ClassCastException while getting the home-interface! In-Reply-To: <13857671.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <13857671.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org I think that you are not having the FirstHome class in your client's classpath. Try running the client with something like java -cp=3D --Viet On Nov 20, 2007 9:10 AM, Kest wrote: > Hi, everybody. I'm new to J2EE=99-applications development. At this mome= nt > I'm trying to get started with Enterprise JavaBeans=99. I've made, packed= into > JAR-file, and successfully deployed on Geronimo 2.0 a very simple EJB=99 > called first.jar. It just takes two integer numbers, adds them, and then > prints the result to the console. I'd like to make it work along with my > application client (standalone, not servlet or Java Server Page; I run it > from a command line). After I had deployed my JavaBean=99, I looked throu= gh > Geronimo log-file and found this string: > > 11:50:14,968 INFO [OpenEJB] Auto-deploying ejb First: > EjbDeployment(deployment-id=3Dfirst/First, container-id=3Dnull) > > > I assumed that I should specify the name for my EJB=99 as "first/First".= That > is why I put those pieces of code in my application client: ... > Properties properties =3D new Properties(); > properties.put(Context.INITIAL_CONTEXT_FACTORY, > "org.apache.openejb.client.RemoteInitialContextFactory"); > properties.put(Context.PROVIDER_URL, "rmi://localhost:4201"); > try{ > System.out.println("Starting Client..."); > InitialContext initialContext =3D new InitialContext(properties); > if(initialContext !=3D null) System.out.println("Got context!"); > Object objRef =3D initialContext.lookup("first/First"); > System.out.println("Got home EJB-object reference!"); > FirstHome firstHome =3D (FirstHome)PortableRemoteObject.narrow(objRef, > FirstHome.class); > First first =3D firstHome.create(); > System.out.println("2 + 5 =3D " + first.add(2, 5)); > } > ... > > > When I try to "narrow" the object reference and to get my EJB's > home-interface, I receive this error message: java.lang.ClassCastExceptio= n. > Could anyone tell me what I'm doing wrong? Thanks a lot. Looking forward= to > hearing from you. > ________________________________ > View this message in context: java.lang.ClassCastException while getting > the home-interface! > Sent from the Apache Geronimo - Users mailing list archive at Nabble.com= . >