You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Jo...@bgs-ag.de on 2008/05/20 15:44:38 UTC

JNDI-Lookup with Global-JNDI-Name from stand-alone JAVA-Client doesn't work any more in 2.1.1

Hi all,

I just wanted to do some JUNIT-Testing with EJB3 and Remote-Beans. The 
test works on 2.0.2, but not with 2.1.1 any more. Here the code:

JUNIT-4 Testclass:
        @Test
        public void testAnlegenPasswortregel() throws NamingException {
                Subject user = null;
 
                Properties p = new Properties();
                p.setProperty(Context.INITIAL_CONTEXT_FACTORY, 
"org.openejb.client.RemoteInitialContextFactory");
                p.setProperty(Context.PROVIDER_URL, 
"ejbd://localhost:4201");

                // Minimum required for login
                p.setProperty(Context.SECURITY_PRINCIPAL, "system");
                p.setProperty(Context.SECURITY_CREDENTIALS, "manager");

                // Optional param for specifying a specific Geronimo 
security realm
                p.put("openejb.authentication.realmName", 
"vesuv-db-sha256");

                InitialContext ctx = new InitialContext(p);
 
 
                LoginManager loginManager = null;
                try {
                        loginManager = (LoginManager) 
ctx.lookup("LoginManagerImplRemote");
                } catch (NamingException e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
                }
                                .....

EJB-3 Bean:
        @Stateless(mappedName="LoginManagerImplRemote")
        @Remote(LoginManager.class)
        public class LoginManagerImpl implements LoginManager {


With Geronimo 2.0.2 the lookup succeeds. 
With Geronimo 2.1.1 the client-process doesn't ever terminate. I get no 
NamingException, nothing at all.

Any help on this topic would be wonderful

cu Josef Eisele

BGS Beratungsgesellschaft 
Software Systemplanung AG 
  
  
  
  
Niederlassung Rhein/Main 
Robert-Koch-Stra�e 41 
55129 Mainz 
Fon: +49 (0) 6131 / 914-0 
Fax: +49 (0) 6131 / 914-400 
www.bgs-ag.de 
Gesch�ftssitz Mainz 
Registergericht 
Amtsgericht Mainz 
HRB 62 50 
  
Aufsichtsratsvorsitzender 
Dr. Wolfgang Trommer 
Vorstand 
Hanspeter Gau 
Hermann Kiefer 
Nils Manegold 
Heinz-J�rg Zimmermann 


  

Antwort: Re: JNDI-Lookup with Global-JNDI-Name from stand-alone JAVA-Client doesn't work any more in 2.1.1

Posted by Jo...@bgs-ag.de.
Hi Trygve,

I should have asked you yesterday, I would have saved a lot of time...
Thats exact the fix for my problem. I had even 3.0-beta1 which is bundled 
in Geronimo App.server 2.1.1

THANX :-)

Josef





"Trygve Hardersen" <tr...@gmail.com> 
20.05.2008 16:12
Bitte antworten an
user@geronimo.apache.org


An
user@geronimo.apache.org
Kopie

Thema
Re: JNDI-Lookup with Global-JNDI-Name from stand-alone JAVA-Client doesn't 
work any more in 2.1.1






Hello

I had a similar problem which was caused by the client still using the 
3.0-beta2 (I think) instead of the 3.0 version of OpenEJB. I could create 
the InitialContext but the lookup just hung forever with no error 
whatsoever. Upgrading OpenEJB on the client side solved the problem.

Trygve

2008/5/20 <Jo...@bgs-ag.de>:

Hi all,

I just wanted to do some JUNIT-Testing with EJB3 and Remote-Beans. The 
test works on 2.0.2, but not with 2.1.1 any more. Here the code:

JUNIT-4 Testclass:
        @Test
        public void testAnlegenPasswortregel() throws NamingException {
                Subject user = null;
 
                Properties p = new Properties();
                p.setProperty(Context.INITIAL_CONTEXT_FACTORY, 
"org.openejb.client.RemoteInitialContextFactory");
                p.setProperty(Context.PROVIDER_URL, 
"ejbd://localhost:4201");

                // Minimum required for login
                p.setProperty(Context.SECURITY_PRINCIPAL, "system");
                p.setProperty(Context.SECURITY_CREDENTIALS, "manager");

                // Optional param for specifying a specific Geronimo 
security realm
                p.put("openejb.authentication.realmName", 
"vesuv-db-sha256");

                InitialContext ctx = new InitialContext(p);
 
 
                LoginManager loginManager = null;
                try {
                        loginManager = (LoginManager) 
ctx.lookup("LoginManagerImplRemote");
                } catch (NamingException e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
                }
                                .....

EJB-3 Bean:
        @Stateless(mappedName="LoginManagerImplRemote")
        @Remote(LoginManager.class)
        public class LoginManagerImpl implements LoginManager {


With Geronimo 2.0.2 the lookup succeeds. 
With Geronimo 2.1.1 the client-process doesn't ever terminate. I get no 
NamingException, nothing at all.

Any help on this topic would be wonderful

cu Josef Eisele

BGS Beratungsgesellschaft
Software Systemplanung AG
 
 
 

 
Niederlassung Rhein/Main
Robert-Koch-Straße 41
55129 Mainz
Fon: +49 (0) 6131 / 914-0
Fax: +49 (0) 6131 / 914-400
www.bgs-ag.de
Geschäftssitz Mainz
Registergericht
Amtsgericht Mainz
HRB 62 50
 
Aufsichtsratsvorsitzender
Dr. Wolfgang Trommer
Vorstand
Hanspeter Gau
Hermann Kiefer
Nils Manegold
Heinz-Jörg Zimmermann


 


BGS Beratungsgesellschaft 
Software Systemplanung AG         Niederlassung Rhein/Main 
Robert-Koch-Straße 41 
55129 Mainz 
Fon: +49 (0) 6131 / 914-0 
Fax: +49 (0) 6131 / 914-400 
www.bgs-ag.de Geschäftssitz Mainz 
Registergericht 
Amtsgericht Mainz 
HRB 62 50 
  Aufsichtsratsvorsitzender 
Dr. Wolfgang Trommer 
Vorstand 
Hanspeter Gau 
Hermann Kiefer 
Nils Manegold 
Heinz-Jörg Zimmermann 


  

Re: JNDI-Lookup with Global-JNDI-Name from stand-alone JAVA-Client doesn't work any more in 2.1.1

Posted by Trygve Hardersen <tr...@gmail.com>.
Hello

I had a similar problem which was caused by the client still using the
3.0-beta2 (I think) instead of the 3.0 version of OpenEJB. I could create
the InitialContext but the lookup just hung forever with no error
whatsoever. Upgrading OpenEJB on the client side solved the problem.

Trygve

2008/5/20 <Jo...@bgs-ag.de>:

>
> Hi all,
>
> I just wanted to do some JUNIT-Testing with EJB3 and Remote-Beans. The test
> works on 2.0.2, but not with 2.1.1 any more. Here the code:
>
> JUNIT-4 Testclass:
>         @Test
>         public void testAnlegenPasswortregel() throws NamingException {
>                 Subject user = null;
>
>                 Properties p = new Properties();
>                 p.setProperty(Context.INITIAL_CONTEXT_FACTORY,
> "org.openejb.client.RemoteInitialContextFactory");
>                 p.setProperty(Context.PROVIDER_URL,
> "ejbd://localhost:4201");
>
>                 // Minimum required for login
>                 p.setProperty(Context.SECURITY_PRINCIPAL, "system");
>                 p.setProperty(Context.SECURITY_CREDENTIALS, "manager");
>
>                 // Optional param for specifying a specific Geronimo
> security realm
>                 p.put("openejb.authentication.realmName",
> "vesuv-db-sha256");
>
>                 InitialContext ctx = new InitialContext(p);
>
>
>                 LoginManager loginManager = null;
>                 try {
>                         loginManager = (LoginManager)
> ctx.lookup("LoginManagerImplRemote");
>                 } catch (NamingException e1) {
>                         // TODO Auto-generated catch block
>                         e1.printStackTrace();
>                 }
>                                 .....
>
> EJB-3 Bean:
>         @Stateless(mappedName="LoginManagerImplRemote")
>         @Remote(LoginManager.class)
>         public class LoginManagerImpl implements LoginManager {
>
>
> With Geronimo 2.0.2 the lookup succeeds.
> With Geronimo 2.1.1 the client-process doesn't ever terminate. I get no
> NamingException, nothing at all.
>
> Any help on this topic would be wonderful
>
> cu Josef Eisele
> ------------------------------
>  BGS Beratungsgesellschaft
> Software Systemplanung AG          *Niederlassung Rhein/Main*
> Robert-Koch-Straße 41
> 55129 Mainz
> Fon: +49 (0) 6131 / 914-0
> Fax: +49 (0) 6131 / 914-400
> www.bgs-ag.de *Geschäftssitz Mainz*
> *Registergericht*
> Amtsgericht Mainz
> HRB 62 50
>   *Aufsichtsratsvorsitzender*
> Dr. Wolfgang Trommer
> *Vorstand*
> Hanspeter Gau
> Hermann Kiefer
> Nils Manegold
> Heinz-Jörg Zimmermann [image: BGS Systemplanung AG] <http://www.bgs-ag.de>
>
>  [image: Ein Unternehmen der nextevolution consulting group]<http://www.nextevolution.de>