Re: comp_name problem

Frank Langelage <[email protected]>
Newsgroups gmane.comp.java.xdoclet.user
Message-ID <[email protected]>
[email protected] wrote:
> hi all
> i'm using xdoclet with myeclipse for generating ejb.
> these are my tags :
>
>  * @ejb.bean name="RequestDispatcher"
>  *           display-name="Name for RequestDispatcher"
>  *           description="Description for RequestDispatcher"
>  *           jndi-name="ejb/RequestDispatcherHome"
>  *           type="Stateless"
>  *           view-type="remote"
>  *           transaction-type="Bean" 
>
> the problem is that xdoclet create in  RequestDispatcherHome
> the COMP_NAME="java:comp/env/ejb/RequestDispatcher";
> I mean there is nothing wrong in that but when I try to see my jndi tree in my jboss jndi viewer I cannot see that path bound.
> What's wrong?
> regards
>
>   
The COMP_NAME is build by using the ejb-bean.name. The one in the local 
home gets an "Local" as additional suffix.

    /**
     * Returns a suitable component name (which could be used, for 
example, in JNDI lookups) for a class.
     *
     * @param clazz  the class
     * @param type   interface view type, \"local\" or \"remote\"
     * @return       compname
     */
    public static String getCompNameFor(XClass clazz, String type)
    {
        String compName = getEjbNameFor(clazz).replace('.', '/');
        if (type.equals("local")) {
            compName = compName + LOCAL_SUFFIX;
        }
        return compName;
    }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.