Ok, here are the snippets:
1) The xml config files for my particular EJB:
        - the application-client.xml looks like this:
<?xml version="1.0"?>
<!DOCTYPE application-client PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE
Application Client 1.2//EN"
"http://java.sun.com/j2ee/dtds/application-client_1_2.dtd">
<application-client>
        <ejb-ref>
                <ejb-ref-name>LinkEJB</ejb-ref-name>
                <ejb-ref-type>Session</ejb-ref-type>
                <home>tung.session.LinkGroupsHome</home>
                <remote>tung.session.LinkGroups</remote>
        </ejb-ref>
</application-client>

        - the ejb-jar.xml looks like this:
<?xml version="1.0"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise
JavaBeans 1.2//EN" "http://java.sun.com/j2ee/dtds/ejb-jar_1_2.dtd">

<ejb-jar>
        <display-name>Link Reference</display-name>
        <description>Link Reference page.</description>
        <enterprise-beans>
                <session>
                        <display-name>Link Groups</display-name>
                        <description>Categories for each section in the
content page.</description>
                        <ejb-name>LinkEJB</ejb-name>
                        <home>tung.session.LinkGroupsHome</home>
                        <remote>tung.session.LinkGroups</remote>
                        <ejb-class>tung.session.BLinkGroups</ejb-class>
                        <session-type>Stateless</session-type>
                        <transaction-type>Container</transaction-type>
                </session>
        </enterprise-beans>
        <assembly-descriptor>
        </assembly-descriptor>
</ejb-jar>

2) The xml config files for my application which contains the EJB:
- the application.xml
<?xml version="1.0"?>
<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE
Application 1.2//EN" "http://java.sun.com/j2ee/dtds/application_1_2.dtd">

<application>
        <display-name>linkcontent</display-name>
        <module>
                <ejb>Links</ejb>
        </module>
</application>

- the orion-application.xml
<?xml version="1.0"?>
<!DOCTYPE orion-application PUBLIC "-//Evermind//DTD J2EE Application
runtime 1.2//EN" "http://www.orionserver.com/dtds/orion-application.dtd">

<orion-application deployment-version="0.9.4">
        <ejb-module remote="false" path="Links" />
        <persistence path="persistence" />
        <principals path="principals.xml" />
        <log>
                <file path="application.log" />
        </log>
        <namespace-access>
                <read-access>
                <namespace-resource root="">
                        <security-role-mapping>
                                <group name="administrators" />
                        </security-role-mapping>
                </namespace-resource>
                </read-access>
                <write-access>
                <namespace-resource root="">
                        <security-role-mapping>
                                <group name="administrators" />
                        </security-role-mapping>
                </namespace-resource>
                </write-access>
        </namespace-access>
</orion-application>

- the principals.xml
<?xml version="1.0"?>
<!DOCTYPE principals PUBLIC "//Evermind - Orion Principals//"
"http://www.orionserver.com/dtds/principals.dtd">

<principals>
        <groups>
        </groups>
        <users>
        </users>
</principals>

3) I Modified the server.xml to load the application by adding this line
<application name="linkcontent" path="../default-web-app" />

4) The same code here works on a client application but not in a bean or JSP
page:
    Context ctx = new InitialContext();
    /**
    * Lookup the LinkGroups object. The reference should be retrieved from
the
    * application-local context (java:comp/env, the variable is
    * specified in the assembly descriptor; META-INF/application-client.xml)
    * but for simplicity we use a global variable.
    */
    Object homeObject = ctx.lookup("java:comp/env/LinkEJB");
    //Object homeObject = ctx.lookup("LinkEJB");

Tung

-----Original Message-----
From: Senthil Kumaran [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 25, 2000 8:54 AM
To: [EMAIL PROTECTED]
Subject: Re: EJB with JSP question!


Hi!,

  I have never used the Orion application server, but generally when you are
looking up EJB components through JNDI you must specify whatever you have
specified under the beanHomeName property in your DeployDescriptor file for
that EJB.So....I hope it helps....if not it would be helpful for us to help
you if you send a code snippet.

Senthil.

> -----Original Message-----
> From: Tung Bui [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 26, 2000 5:58 AM
> To: [EMAIL PROTECTED]
> Subject: EJB with JSP question!
>
>
> Hello all gurus out there,
>
> I'm playing with the idea of using EJB in JSP to possibly replace my
> beans.
> I use Orion Server build 0.9.4 and am able to set up the EJB to work.
> However, the same code, which works in a client application, does not
> work
> in the JSP page. So I told myself to go one step at a time and still had
> the
> bean but this bean instead uses the EJB. After all the changes, I'm back
> to
> the starting point. I still get the same error:
> "javax.naming.NameNotFoundException: LinkEJB not found". Anyone out
> there
> has been able to use EJB in their JSP pages on Orion Server, please tell
> me
> how you got it work. I am at my wit's end now!
>
> Thanks,
> Tung
>
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Tung Bui
>
> [EMAIL PROTECTED]
> CitySearch.com at http://www.citysearch.com
> My Home page at http://home.sprynet.com/~txbui
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> ========================================================================
> ===
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to