users@glassfish.java.net

Desperate looking for a been from Java SE

From: <glassfish_at_javadesktop.org>
Date: Sat, 23 Jun 2007 01:52:57 PDT

Hi all:

I've a bean coded like this...

@Stateless(mappedName="ejb/CodeFormat_Bean")
public class CodeFormat_Bean implements CodeFormat_IDAORemote
{
      My bussines methods .......
}

deployed in a Glassfish v. 1.

From a Java SE client configured

like this...

properties.put("java.naming.factory.initial", "com.sun.appserv.naming.S1ASCtxFactory");
properties.put("java.naming.provider.url", "iiop://127.0.0.1:3700");

or like this ....

properties.put("java.naming.factory.initial", "com.sun.enterprise.naming.SerialInitContextFactory");
properties.put("java.naming.factory.url.pkgs", "com.sun.enterprise.naming");
properties.put("java.naming.factory.state", "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
properties.put("java.naming.provider.url", "iiop://localhost" + ":" + 3700);

and looking for registered beans in glassfish's container with code like this...

                    context = new InitialContext(properties);
                    NamingEnumeration ne = context.listBindings("ejb");
                    Binding b;
                    while(ne.hasMore())
                    {
                        b = (Binding) ne.next();
                        System.out.println(b.getName());
                    }

I get the following registered beans among others.....

CodeFormat_Bean
CodeFormat_Bean#cat.htmc.server.beans.interfaces.CodeFormat_IDAORemote


but whenever I try to get the bean with code like this...
                    
                    CodeFormat_IDAORemote remote_codeFormat = null;

                    try
                    {
                        remote_codeFormat = (IDAO) context.lookup("CodeFormat_Bean");
                        if (remote_codeFormat != null)
                            System.out.println("BINGO");
                    }

with all sort of lookups calls like....

lookup("CodeFormat_Bean");
lookup("CodeFormat_IDAORemote");
lookup("at.htmc.server.beans.interfaces.CodeFormat_IDAORemote");

and some other thousands that I'be been trying during 2 days...

I always get the same message
javax.naming.NameNotFoundException: CodeFormat_Bean not found
or
javax.naming.NameNotFoundException: CodeFormat_IDAORemote not found
or
......


The bean seams to be there but I can't catch up. Anyone can help me please. I've been reading FAQs, forums, etc and I haven't seen the light.

Thanks in advance....
[Message sent by forum member 'xavier_ferret' (xavier_ferret)]

http://forums.java.net/jive/thread.jspa?messageID=223639