geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tomasz Mazan <>
Subject Re: Is there any reason to use @Remote for session bean...
Date Mon, 20 Aug 2007 09:12:07 GMT
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://" + 
> 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
> your var/log/ 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:
> 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();
        this.ctx = new InitialContext(properties);

and try to get remote SB with method
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
        at javax.naming.InitialContext.lookup(
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.

View raw message