Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 78113 invoked from network); 20 Aug 2007 09:22:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Aug 2007 09:22:46 -0000 Received: (qmail 45957 invoked by uid 500); 20 Aug 2007 09:22:37 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 45935 invoked by uid 500); 20 Aug 2007 09:22: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 45890 invoked by uid 99); 20 Aug 2007 09:22:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Aug 2007 02:22:36 -0700 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: local policy) Received: from [69.147.95.78] (HELO smtp115.plus.mail.sp1.yahoo.com) (69.147.95.78) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 20 Aug 2007 09:22:32 +0000 Received: (qmail 80113 invoked from network); 20 Aug 2007 09:22:10 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:X-YMail-OSG:Mime-Version:In-Reply-To:References:Content-Type:Message-Id:Content-Transfer-Encoding:From:Subject:Date:To:X-Mailer; b=uMg2BCzsRBWtQJSiS3GE6s9qE3MlYgEpyzXjRrC1xGI381eUwudtJcz2VMsTFI3YxnUTTwLmCGtr/dyce0l9+Hj5xWAqi8lH7ilrUTcHLwdC7Qeg0xTYuaCMOBn8SFat7JORU5rQp+UaBLIq+V+XsI/mwF3P3pqH1uRvR3QzRWk= ; Received: from unknown (HELO ?192.168.1.106?) (david_jencks@67.102.173.8 with plain) by smtp115.plus.mail.sp1.yahoo.com with SMTP; 20 Aug 2007 09:22:10 -0000 X-YMail-OSG: Vj3HnegVM1lFZwIqPp7gxRQ4pCJkLCFc0RlY5VwljfZe69n_gQp3OrkKuhkuD09j7i2GQf4yWCr7eSKOmt0e0PbkEkkyYJ5B0qS0640z2gVJijB0YZcuztgdL6er Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: <46C95AE7.3030605@wp.pl> References: <12197581.post@talk.nabble.com> <46C95AE7.3030605@wp.pl> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: David Jencks Subject: Re: Is there any reason to use @Remote for session bean... Date: Mon, 20 Aug 2007 02:22:14 -0700 To: user@geronimo.apache.org X-Mailer: Apple Mail (2.752.3) X-Virus-Checked: Checked by ClamAV on apache.org On Aug 20, 2007, at 2:12 AM, Tomasz Mazan wrote: > 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?! I think you need to append the name of the interface you are trying to get. You could list the context to find out exactly what is bound there. > > 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". This is not a problem. > > 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. entity managers are not bound to global jndi, so this is not surprising. Can your session bean get its entity manager? thanks david jencks > > Please, help me to understand this strange behaviour. > > Tomasz Mazan > > PS. Let's changing jndi name format to near future.