Hi
I am usign a session bean to access my entity bean
But I am getting
javax.naming.NameNotFoundException: No object bound to name
java:comp/env/ejb/ForumBean
I am using the deploytool for deploying there is no option to set a JNDI name for Local Entity bean . Is it required to set a JNDI name for the local entity bean ?
My look up code is
Context initial = new InitialContext ();
(ForumHome) initial.lookup ("java:comp/env/ejb/ForumBean
");
My xml files are
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 8.0
EJB 2.1//EN" "http://www.sun.com/software/appserver/dtds/sun-ejb-jar_2_1-0.dtd">
<sun-ejb-jar>
<enterprise-beans>
<name>ForumJar</name>
<ejb>
<ejb-name>ForumBean</ejb-name>
</ejb>
<ejb>
<ejb-name>AccessForumBean</ejb-name>
<jndi-name>AccessForumBean</jndi-name>
</ejb>
<cmp-resource>
<jndi-name>MSG_DB</jndi-name>
</cmp-resource>
</enterprise-beans>
</sun-ejb-jar>
------------------------------------------------------------------------------- ----------------------------
<?xml version='1.0' encoding='UTF-8'?>
<ejb-jar
xmlns="http://java.sun.com/xml/ns/j2ee"
version="2.1"
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" >
<display-name>ForumJar</display-name>
<enterprise-beans>
<entity>
<ejb-name>ForumBean</ejb-name>
<local-home>com.forum.ejb.ForumHome</local-home>
<local>com.forum.ejb.Forum</local>
<ejb-class>com.forum.ejb.ForumBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>false</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>t_forum</abstract-schema-name>
<cmp-field>
<description>no description</description>
<field-name>forumId</field-name>
</cmp-field>
<cmp-field>
<description>no description</description>
<field-name>forumDesc</field-name>
</cmp-field>
<cmp-field>
<description>no description</description>
<field-name>updationDate</field-name>
</cmp-field>
<cmp-field>
<description>no description</description>
<field-name>userId</field-name>
</cmp-field>
<cmp-field>
<description>no description</description>
<field-name>forumTitle</field-name>
</cmp-field>
<cmp-field>
<description>no description</description>
<field-name>creationDate</field-name>
</cmp-field>
<primkey-field>forumId</primkey-field>
<security-identity>
<use-caller-identity>
</use-caller-identity>
</security-identity>
<query>
<query-method>
<method-name>findForums</method-name>
<method-params>
</method-params>
</query-method>
<ejb-ql>SELECT OBJECT(p) FROM t_forum p</ejb-ql>
</query>
<query>
<query-method>
<method-name>ejbSelectMaxFId</method-name>
<method-params>
</method-params>
</query-method>
<ejb-ql>SELECT MAX(x.forumId) FROM t_forum x</ejb-ql>
</query>
</entity>
<session>
<ejb-name>AccessForumBean</ejb-name>
<home>com.forum.ejb.AccessForumHome</home>
<remote>com.forum.ejb.AccessForum</remote>
<ejb-class>com.forum.ejb.AccessForumBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>
<ejb-local-ref>
<ejb-ref-name>ForumBean</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>com.forum.ejb.ForumHome</local-home>
<local>com.forum.ejb.Forum</local>
<ejb-link>ejb-jar-ic1.jar#ForumBean</ejb-link>
</ejb-local-ref>
<security-identity>
<use-caller-identity>
</use-caller-identity>
</security-identity>
</session>
</enterprise-beans>
<assembly-descriptor>
<method-permission>
<unchecked>
</unchecked>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>LocalHome</method-intf>
<method-name>remove</method-name>
<method-params>
<method-param>java.lang.Object</method-param>
</method-params>
</method>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>LocalHome</method-intf>
<method-name>create</method-name>
<method-params>
<method-param>java.lang.String</method-param>
<method-param>java.lang.String</method-param>
<method-param>int</method-param>
</method-params>
</method>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>updateForum</method-name>
<method-params>
<method-param>java.lang.String</method-param>
<method-param>java.lang.String</method-param>
<method-param>java.sql.Date</method-param>
</method-params>
</method>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>LocalHome</method-intf>
<method-name>findByPrimaryKey</method-name>
<method-params>
<method-param>java.lang.Integer</method-param>
</method-params>
</method>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>isIdentical</method-name>
<method-params>
<method-param>javax.ejb.EJBLocalObject</method-param>
</method-params>
</method>
</method-permission>
<method-permission>
<unchecked>
</unchecked>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>forumId</method-name>
</method>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>forumDesc</method-name>
</method>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>creationDate</method-name>
</method>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>LocalHome</method-intf>
<method-name>findForums</method-name>
</method>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>forumTitle</method-name>
</method>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>updationDate</method-name>
</method>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>userId</method-name>
</method>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>getPrimaryKey</method-name>
</method>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>remove</method-name>
</method>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>getEJBLocalHome</method-name>
</method>
</method-permission>
<container-transaction>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>forumTitle</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<container-transaction>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>updateForum</method-name>
<method-params>
<method-param>java.lang.String</method-param>
<method-param>java.lang.String</method-param>
<method-param>java.sql.Date</method-param>
</method-params>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<container-transaction>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>forumDesc</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<container-transaction>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>forumId</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<container-transaction>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>remove</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<container-transaction>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>creationDate</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<container-transaction>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>updationDate</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<container-transaction>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>userId</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>