Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 75576 invoked from network); 20 Aug 2007 09:12:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Aug 2007 09:12:37 -0000 Received: (qmail 27273 invoked by uid 500); 20 Aug 2007 09:12:33 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 27251 invoked by uid 500); 20 Aug 2007 09:12:33 -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 27240 invoked by uid 99); 20 Aug 2007 09:12:33 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Aug 2007 02:12:33 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of wind22@wp.pl designates 212.77.101.5 as permitted sender) Received: from [212.77.101.5] (HELO mx1.wp.pl) (212.77.101.5) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Aug 2007 09:13:00 +0000 Received: (wp-smtpd smtp.wp.pl 24289 invoked from network); 20 Aug 2007 11:12:08 +0200 Received: from ip-195.114.160.156.netia.pl (HELO [172.16.84.39]) (wind22@[195.114.160.156]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with AES256-SHA encrypted SMTP for ; 20 Aug 2007 11:12:08 +0200 Message-ID: <46C95AE7.3030605@wp.pl> Date: Mon, 20 Aug 2007 11:12:07 +0200 From: Tomasz Mazan User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: user@geronimo.apache.org Subject: Re: Is there any reason to use @Remote for session bean... References: <12197581.post@talk.nabble.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-WP-AV: skaner antywirusowy poczty Wirtualnej Polski S. A. X-WP-SPAM: NO 0000000 X-Virus-Checked: Checked by ClamAV on apache.org David Blevins pisze: > > On Aug 17, 2007, at 3:51 AM, Tomasz Mazan wrote: > >> >> ..if there's no global jndi context and I can't get SBean within my >> standalone java application client? >> In addition - there's no chance to run old EJB2 application with remote >> client on Geronimo 2.0. May I'm wrong - so, please help me to understand >> this "feature". > > EJB 1.1, EJB 2.x and EJB 3.0 standalone clients do work. > > To connect to the server using the default settings: > > Properties props = new Properties(); > props.put("java.naming.factory.initial", > "org.apache.openejb.client.RemoteInitialContextFactory"); > props.put("java.naming.provider.url", "foo://127.0.0.1:" + > port); > InitialContext context = new InitialContext(props); > > The JNDI Names for each bean are printed in INFO in the > OpenEJB.startup log cagetory, which you can enable by adding this: > > log4j.logger.OpenEJB.startup=INFO > > ..to your var/log/server-log4j.properties file > > The output should look similar to the following: > > INFO - Assembling app: > /Users/dblevins/work/openejb3/itests/openejb-itests-beans/target/classes > INFO - Jndi(name=client/tests/entity/cmp/BasicCmpHome) > INFO - Jndi(name=client/tests/entity/cmp/ComplexCmpHome) > INFO - Jndi(name=client/tests/entity/cmp/UnknownCmpHome) > INFO - Jndi(name=client/tests/entity/cmp2/BasicCmpHome) > INFO - Jndi(name=client/tests/entity/cmp2/ComplexCmpHome) > INFO - Jndi(name=client/tests/entity/cmp2/UnknownCmpHome) > INFO - Jndi(name=client/tests/entity/cmp/allowed_operations/EntityHome) > INFO - Jndi(name=client/tests/entity/cmp2/allowed_operations/EntityHome) > INFO - Jndi(name=client/tests/entity/cmp/EncBean) > INFO - Jndi(name=client/tests/entity/cmp2/EncBean) > INFO - Jndi(name=client/tests/entity/cmp/ContextLookupCmpBean) > INFO - Jndi(name=client/tests/entity/cmp/RMI-over-IIOP/EJBHome) > INFO - Jndi(name=client/tests/entity/cmp2/RMI-over-IIOP/EJBHome) > INFO - Jndi(name=client/tests/entity/cmr/oneToOne/PersonLocal) > INFO - Jndi(name=client/tests/entity/cmr/oneToOne/LicenseLocal) > INFO - Jndi(name=client/tests/entity/cmr/oneToMany/ArtistLocal) > INFO - Jndi(name=client/tests/entity/cmr/oneToMany/SongLocal) > INFO - Jndi(name=client/tests/entity/cmr/manyToMany/GameLocal) > > There is an open issue (GERONIMO-2884) regarding the default jndi > names you may want to check out if you names like > "geronimo-deploymentUtil5840.tmpdir/FooBeanBusinessRemote. > > Changing the format of the JNDI names is fine. The only drawback is > offical javaee 5 application-client.xml style clients will no longer > be able to look up ejbs (well, not using the java:comp/env snytax > anyway, they could still look them up as standalone applications do). > See the info on this page on how to reset the openejb.jndiname.format > system variable: > > http://openejb.apache.org/jndi-names.html > > The default value is "{deploymentId}/{interfaceClass}" > > Hmmm... Looking at the code right now I see that its actually a bit > tricky to set the "openejb.jndiname.format" property -- normally > setting it as a system property would do the trick, but I see we're > not checking to see if it was set before stuffing in the default. > > If you want to change the format, let me know and I will show you a > couple options. > > -David David, thank you for your response, and.... please help :-) I've configured connection to context with theese settings Properties properties = new Properties(); properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory"); properties.setProperty(Context.PROVIDER_URL, "ejbd://localhost:4201"); this.ctx = new InitialContext(properties); and try to get remote SB with method this.ctx.lookup("EJBtest-1.0.jar/CustomerFacade"); and get instance of.... org.apache.openejb.client.JNDIContext.. where is my session bean?! There is CustomerFacade in JNDIViewer tree - Geronimo Console, but.... 1) when I deploy my application the console prints warn like: 10:45:38,906 WARN [Runtime] The property named "openjpa.ClassTransformerOptions" was not recognized and will be ignored, although the name closely matches a valid property called "openjpa.ClassResolver". 2) Although I set key log4j.logger.OpenEJB.startup to value INFO, there's no jndi messages on console 3) May it be independent troublem, but I use persistence unit, with properly configured (on server) connectio pool, and when I explore (click) via jndi viewer, geronimo console prints error like javax.naming.NotContextException: geronimo/env/pl.netia.fonbsa.core.dao.facade.impl.CommonFacadeImpl/entityManager at org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContext.java:161) at org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContext.java:611) at org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContext.java:152) at org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContext.java:597) at javax.naming.InitialContext.lookup(InitialContext.java:351) at org.apache.openejb.core.ivm.naming.JndiUrlReference.getObject(JndiUrlReference.java:34) This problem is common for my application and geronimo examples from official site. Please, help me to understand this strange behaviour. Tomasz Mazan PS. Let's changing jndi name format to near future.