Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 58005 invoked from network); 23 Sep 2005 03:26:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 23 Sep 2005 03:26:32 -0000 Received: (qmail 34890 invoked by uid 500); 23 Sep 2005 03:26:31 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 34498 invoked by uid 500); 23 Sep 2005 03:26:29 -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 34481 invoked by uid 99); 23 Sep 2005 03:26:29 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Sep 2005 20:26:29 -0700 X-ASF-Spam-Status: No, hits=0.4 required=10.0 tests=DNS_FROM_RFC_ABUSE X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [216.136.173.59] (HELO smtp015.mail.yahoo.com) (216.136.173.59) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 22 Sep 2005 20:26:37 -0700 Received: (qmail 37220 invoked from network); 23 Sep 2005 03:26:08 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:Mime-Version:In-Reply-To:References:Content-Type:Message-Id:Content-Transfer-Encoding:From:Subject:Date:To:X-Mailer; b=D46vIef4f/mUrb86HUQrwlfaF3usVhIXDQSV5+jRAi6dFGvEKwymhKtob2LmEx+5k6uu+++G6xN1sh4hubrfG2ZBmwgB2poGQkMSvyK8sA55I8SeO5Hf49RVThIULxTrv2KOiiuyoKsyce8HA4Pie5HGK7kn1Z1XSaD94QVgSqo= ; Received: from unknown (HELO ?192.168.1.105?) (david?jencks@65.167.96.102 with plain) by smtp015.mail.yahoo.com with SMTP; 23 Sep 2005 03:26:07 -0000 Mime-Version: 1.0 (Apple Message framework v622) In-Reply-To: <20050923023948.85088.qmail@web32504.mail.mud.yahoo.com> References: <20050923023948.85088.qmail@web32504.mail.mud.yahoo.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <32c4685d3dd7a1ff45d2feac336434f8@yahoo.com> Content-Transfer-Encoding: 7bit From: David Jencks Subject: Re: org.omg.CosNaming.NamingCntextPackage.NotFound Date: Thu, 22 Sep 2005 23:26:04 -0400 To: user@geronimo.apache.org X-Mailer: Apple Mail (2.622) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On Sep 22, 2005, at 10:39 PM, lin sun wrote: > Thanks again for the quick response and it is very helpful! Hope I > can get it working > any day soon!:-) > > So I decided to redesign my test scenario based on your > recommendations: > 1) Find a J2EE client and EJB sample that would work in geronimo > environment. Luckily, > I was able to get the MagicGball ear file deployed and the > MagicGball-client running in > the J2EE client container. I'd like to use this sample and modify it > so that the J2EE > client can communicate to EJBs via IIOP. > 2) Customize the EJBs and make them available through Corba > 3) Customize the client so that it can use the EJB through Corba > > I followed your guildance below on No. 2 and No. 3 but I could not get > much further. > Could you please help? > >> To make ejbs available through Corba (as servers), you need to: >> 1. include a tss-link for each ejb in the openejb-plan to a tss bean >> that is configured somewhere, such as the j2ee-server-corba-plan.xml >> 2. start the j2ee-server-corba-plan. The easiest way to do this is to >> include and "include" element in your openejb plan: >> >> >> org/apache/geronimo/ServerCORBA >> > > I created the openejb-jar.xml file myself, since MagicGball didn't > have one. > I could not find much example on ...so I assume I can put a > tss bean name like > "SSLClientCert" that is specified in the j2ee-server-corba-plan.xml. > Not sure if this > is correct, all I know is that the deployer didn't complain:-) > I put the .. before the but when > I tried to deploy > the ear file, the deployer complained that it expected a > tag instead. > Can I just set the parentID to "org/apache/geronimo/ServerCORBA" > to reach the same > goal? > > > > configId="MagicGBall" > parentId="org/apache/geronimo/Server"> > > > org/apache/geronimo/ServerCORBA > > > > > MagicGBall > SSLClientCert > > > > > > my apologies, this should be not means something very different and is not appropriate for ejb-jars. I don't think you can use o/a/g/ServerCORBA as the parentId, the openejb classes will be missing :-) >> To use an ejb from a j2ee application (such as a j2ee app client, web >> app, or ejb) you need to include in the geronimo/openejb plan ejb-ref >> information like this: > > I read Aaron's book on J2EE client application, and I didn't see > anywhere mentions > openejb-jar.xml, so I assume you mean geronimo-client.xml here? yes. I don't think his book covers app-clients using corba yet though. > >> 1. where the naming server is and the name >> 2. a css-link to supply the security info for csiv2 negotiation with >> the server. A typical element might look like this: >> >> >> ejb/Control >> corbaloc::> host>:> service port>/NameService >> targetEjbName >> SSLClientCert >> >> (fill in the correct values for the host and port) > > I tried to modify the geronimo application client xml file provided by > MagicGball as > follows, but the deployer complained the ns-corbaloc, name, css-link > elements were not > allowed when I deployed the ear file. This is the spec deployment descriptor, which you should not modify. What you should do is write a geronimo application plan that includes modules including the openejb-jar and a geronimo-app-client plan. You are going to need to add security to both the client and ejb. For the client, you need to supply a callback handler. The simplest approach is to hardcode the info, either user-pw or certificate. I think it will be easier to set up server security using user-pw: you can just use the existing properties-login. I think something faintly resembling this might work: magicGball-client.jar mGBall corbaloc::localhost:1055/NameService MagicGBall SSLClientPassword geronimo-properties-realm org.acme.UPCallbackHandler magicGball-ejb.jar org/apache/geronimo/ServerCORBA MagicGBall SSLClientPassword There are probably plenty of mistakes here but this might be a starting point. > > 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/applicationclient_1_4.xsd" > version="1.4"> > > Magic G Ball > > mGball > Session > org.acme.MagicGBallHome > org.acme.MagicGBall > magicGball-ejb.jar#MagicGBall > > corbaloc::localhost:1050/NameService > MagicGBall > SSLClientCert > > > > Deployer error: > E:\geronimo-1.0-SNAPSHOT\geronimo-1.0-SNAPSHOT>java -jar > bin\deployer.jar --user > system --password manager deploy > \build\geronimo\applications\magicGball\target > \magicGball.ear > Error: Unable to distribute magicGball.ear: Unable to parse > application-client.xml caused by Invalid deployment descriptor: > [error: cvc-complex-type.2.4b: Element not allowed: > ns-corbaloc@http://java.sun.com/xml/ns/j2ee in element > ejb-ref@http://java.sun.com/xml/ns/j2ee, error: > cvc-complex-type.2.4b: Element not allowed: > name@http://java.sun.com/xml/ns/j2ee in element > ejb-ref@http://java.sun.com/xml/ns/j2ee, error: > cvc-complex-type.2.4b: Element not allowed: > css-link@http://java.sun.com/xml/ns/j2ee in element > ejb-ref@http://java.sun.com/xml/ns/j2ee] > > > >> If your j2ee component is running in a server (it is a web app or >> ejb), >> you should include the ServerCORBA configuration as a parent, just >> like >> for a server ejb. If your j2ee component is an app client, which runs >> in a different jvm, you should include the ClientCORBA configuration. >> Unfortunately the clientCORBA configuration is still incomplete: you >> need some security gbeans. > > I think I need to change the ask(String question) method in > MagicGBallClient.java use > Corba. I am a bit lost here on what parm would ic.lookup() take? > Since I could have > define them via the ns-corbaloc tag. > > //linsun: look up MagicGBallHome in the naming context > InitialContext ic = new InitialContext(); > Object mgbObj = > ic.lookup("corbaname::localhost:1050/NameService"); you should look up the string java:comp/env/mGball just like in the original, and specify the name server location in the geronimo plan. > > //linsun: perform a safe downcast > MagicGBallHome home = > (MagicGBallHome)PortableRemoteObject.narrow(mgbObj,MagicGBallHome.class > ); you need to do this. > > //from the original sample > MagicGBall mGball = home.create(); > String answer = mGball.ask(question); I think this part should be OK. > > >> Finally, to use a ejb from a non-j2ee application through CORBA you >> need to set up most of the infrastructure that the gbeans set up for >> you: at least the Orb, the dynamic stub classloader, and some CSS >> implementation. This last part is something no one has tried yet as >> far as I know. >> >> On the other hand, if you can find someone elses example of a >> standalone non-j2ee client that accesses ejbs using csiv2 security >> over >> CORBA you should be able to communicate with those ejbs deployed in >> geronimo. However, I've never seen such an example. > > Gave up this approach--don't want to run into too much surprises!:-) :-) there will be plenty of surprises anyway! thanks david jencks