users@glassfish.java.net

Re: an EJB2.1 stateless session bean with remote and local interface -- how

From: <glassfish_at_javadesktop.org>
Date: Fri, 11 Jan 2008 08:47:31 PST

[b]Marina/Dies - thankyou very much for the attention you've given my question.

Dies - I have tried using "refs", as you indicated, but it doesn't seem to have any effect...
I.e., [/b]
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar version="2.1" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
  <enterprise-beans>
        <session>
            <display-name>DddEJBSB</display-name>
            <ejb-name>DddEJBBean</ejb-name>
            <home>ddd.ejb.DddEJBRemoteHome</home>
            <remote>ddd.ejb.DddEJBRemote</remote>
            <local-home>ddd.ejb.DddEJBLocalHome</local-home>
            <local>ddd.ejb.DddEJBLocal</local>
            <ejb-class>ddd.ejb.DddEJBBean</ejb-class>
            <session-type>Stateless</session-type>
            <transaction-type>Container</transaction-type>
            <ejb-ref>
                <ejb-ref-name>DddEJBRemoteHome</ejb-ref-name>
                <ejb-ref-type>Session</ejb-ref-type>
                <home>ddd.ejb.DddEJBRemoteHome</home>
                <remote>ddd.ejb.DddEJBRemote</remote>
                <ejb-link>dddEAR-ejb.jar#DddEJBBean</ejb-link>
            </ejb-ref>
            <ejb-local-ref>
                <ejb-ref-name>DddEJBLocalHome</ejb-ref-name>
                <ejb-ref-type>Session</ejb-ref-type>
                <local-home>ddd.ejb.DddEJBLocalHome</local-home>
                <local>ddd.ejb.DddEJBLocal</local>
                <ejb-link>dddEAR-ejb.jar#DddEJBBean</ejb-link>
            </ejb-local-ref>
        </session>
        </enterprise-beans>
    <assembly-descriptor>
        <container-transaction>
            <method>
                <ejb-name>DddEJBBean</ejb-name>
                <method-name>*</method-name>
            </method>
            <trans-attribute>Required</trans-attribute>
        </container-transaction>
        </assembly-descriptor>
    </ejb-jar>

  

[b](see the attached sample enterprise project where I do this...NOTE: I have removed the jar/war files to reduce the size to ~60k - thx)

The mystery to me is - why is the JNDI lookup successful when there is only a local interface... and why does it fail when the local interface is combined with a remote interface?

Let me know what you think.

thank again!

sd[/b]
[Message sent by forum member 'sairndain' (sairndain)]

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