what App Server are you using?

if it is JBoss, then for each Bean, you need to add such a tag:

@ejb.util
        generate="physical"

it will generate JNDI_NAME. The default is logical, which will then generate
COMP_NAME in the Util class.

Marc.

> -----Urspr�ngliche Nachricht-----
> Von:  tek1 [SMTP:[EMAIL PROTECTED]]
> Gesendet am:  Donnerstag, 28. November 2002 17:55
> An:   [EMAIL PROTECTED]
> Betreff:      [Xdoclet-user] xdoclet1.2beta1 bug?: xxxUtil.getHome() using
> COMP_NAME instead of JNDI_NAME?
> 
> i wrote a very simple client that tries to obtain the home interface of an
> 
> entity, say "Name", as in:
> 
> NameUtil.getHome();
> 
> however, i'm getting the error, "javax.naming.NameNotFoundException: comp 
> not bound" when i run the client.
> 
> here is the xdoclet-generated source for the NameUtil.getHome() method:
> 
> 
>     public static NameHome getHome() throws NamingException
>     {
>        // Obtain initial context
>        InitialContext initialContext = new InitialContext();
>        try {
>           java.lang.Object objRef =
> initialContext.lookup(NameHome.COMP_NAME);
>           return (NameHome) PortableRemoteObject.narrow(objRef,
> NameHome.class);
>        } finally {
>           initialContext.close();
>        }
>     }
> 
> 
> in the NameHome class, COMP_NAME="java:comp/env/ejb/Name", which i thought
> 
> was for in-jvm (internal/local) calls?
> 
> in my client program, if i do the following:
> 
>       InitialContext initialContext = new InitialContext();
>       java.lang.Object objRef = initialContext.lookup(NameHome.JNDI_NAME);
>       NameHome home = (NameHome) PortableRemoteObject.narrow(objRef,
> NameHome.class);
> 
> it works.
> 
> 
> should the NameUtil.getHome() method use:
> 
>       java.lang.Object objRef = initialContext.lookup(NameHome.JNDI_NAME);
> 
>       instead of
> 
>       java.lang.Object objRef = initialContext.lookup(NameHome.COMP_NAME);
> 
> 
> ?
> 
> thank you. 
> 
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: Get the new Palm Tungsten T 
> handheld. Power & Color in a compact size! 
> http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en
> _______________________________________________
> Xdoclet-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/xdoclet-user


-------------------------------------------------------
This SF.net email is sponsored by: Get the new Palm Tungsten T
handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en
_______________________________________________
Xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to