[jboss-user] [JNDI/Naming/Network] - InitialContext results in Directory listing
jake142
do-not-reply at jboss.com
Wed Oct 18 13:24:55 EDT 2006
Hi,
Im a newbie to EJB. Im trying to access a statless session bean. Im using eclipse with the j2ee plugin with xdoclet. The problem is I get is that I get a Directory listing when running this code:
<%
String s = "empty";
try {
TestLocalHome testLocalHome = (TestLocalHome)new InitialContext().lookup("java:TestLocal");
TestLocal testBean = testLocalHome. create();
s = testBean.sum(10,10);
}
catch (Exception e)
{
s=e.toString();
}
%>
The result is <%=s %>
The ejb-jar.xml:
<![CDATA[An EJB named Test]]>
<display-name>Test</display-name>
<ejb-name>Test</ejb-name>
se.tesella.ejb.TestHome
se.tesella.ejb.Test
<local-home>se.tesella.ejb.TestLocalHome</local-home>
se.tesella.ejb.TestLocal
<ejb-class>se.tesella.ejb.TestSession</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
the jboss.xml:
<ejb-name>Test</ejb-name>
<jndi-name>Test</jndi-name>
<local-jndi-name>TestLocal</local-jndi-name>
<method-attributes>
</method-attributes>
The jboss-web.xml:
<jboss-web>
<context-root>ReAdvertWebModule</context-root>
<ejb-ref>
<ejb-ref-name>Test</ejb-ref-name>
<jndi-name>Test</jndi-name>
</ejb-ref>
</jboss-web>
The web.xml:
<ejb-ref>
<ejb-ref-name>Test</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
se.tesella.ejb.TestHome
se.tesella.ejb.Test
<ejb-link>TestBean</ejb-link>
</ejb-ref>
Also, anothe question, are all these xml files neccessary?
Kind regards
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3979153#3979153
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3979153
More information about the jboss-user
mailing list