Hello, everybody!

Could somebody give me detailed instructions on how to make EJB, jsp and
servlets work together under Orion? 
I've digged tons of information and after 2 weeks of fighting my EJBs still
don't work. Please describe what should I do to use EJB from servlets
(dispatched on Orion or on remote servlet engine) or from JSPs.

What I did:
1. installed Orion, set port 8070 for web-apps (have httpd already running
on port 80)
2. made EJB bean (as part of application with its own web module) and put it
to applications/test/test-ejb
3. altered config files: 
3.1 config/server.xml - added <application name="test"
path="../applications/test/" />
3.2 config/default-web-site.xml - added <web-app application="test"
name="test-web" root="/test" />
3.3 applications/test/META-INF/application.xml looks like:
...
<display-name>Test</display-name>
        <module>test-ejb</module>
        <module>
                <web>
                        <web-uri>test-web</web-uri>
                </web>
        </module>
..
3.4 applications/test/test-ejb/META-INF/ejb-jar.xml looks like:
<ejb-jar>
    <display-name>Test Package</display-name>
    <description>Sample Test</description>
    <enterprise-beans>
        <entity>
            <display-name>StoryRef</display-name>
            <description></description>
            <ejb-name>com.nh.StoryRef</ejb-name>
            <home>com.nh.StoryRefHome</home>
            <remote>com.nh.StoryRef</remote>
            <ejb-class>com.nh.StoryRefBean</ejb-class>
            <persistence-type>Bean</persistence-type>
            <primkey-class>com.nh.StoryRefPK</primkey-class>
            <reentrant>False</reentrant>
        </entity>
    </enterprise-beans>
</ejb-jar>

3.5 applications/test/test-web/WEB-INF/web.xml contains:
        <taglib>
                <taglib-uri>ejbtags</taglib-uri>
                <taglib-location>/WEB-INF/lib/ejbtags.jar</taglib-location>
        </taglib>
4. EJB bean resides in applications/test/test-ejb/com/nh/ :
StoryRef.class, StoryRefBean.class, StoryRefHome.class, StoryRefPK.class
5. JSP code looks like this:
...
<ejb:useHome id="home" type="com.nh.StoryRefHome"
location="com.nh.StoryRef"/>
<ejb:useBean id="news" type="com.nh.StoryRef"
value="<%=home.findByPrimaryKey(new com.nh.StoryRefPK(1))%>" />
<%=news.method2("New String")%>
...
Execution of this code results an error: javax.servlet.jsp.JspException:
NamingException: com.nh.StoryRef not found

6. Trying to lookup the same bean from servlet results the same error.

Where am I wrong????

PS: I'm running Orion on RedHat Linux.

Best wishes,
             Stanislav Maximov
_____________________
SW Interactive
www.swinteractive.com




Reply via email to