Hi all,
I am creating a novice web application using JBoss, Struts and Hibernate. I have problems creating a EJB Home object using JNDI lookup. The lookup method always throws an exception.
Here are some of the details of my program:
Action class (subclass of Action):
InitialContext ctx = new InitialContext();
mySchoolHome = (SchoolHome)ctx.lookup("java:comp/env/ejb/SchoolHome");
web.xml:
<jndi-link>
<jndi-name>java:comp/env/ejb</jndi-name>
<jndi-factory>org.jnp.interfaces.NamingContextFactory</jndi-factory>
</jndi-link>
jboss.xml:
<jboss>
<enterprise-beans>
<session>
<ejb-name>SchoolEJB</ejb-name>
<jndi-name>ejb/SchoolHome</jndi-name>
</session>
</enterprise-beans>
</jboss>
I am a novice to J2EE applications. Please help me out.
-
problems configuring JNDI name lookup (1 messages)
- Posted by: Pratik Patel
- Posted on: July 15 2005 15:58 EDT
Threaded Messages (1)
- problems configuring JNDI name lookup by vikas gupta on July 16 2005 03:16 EDT
-
problems configuring JNDI name lookup[ Go to top ]
- Posted by: vikas gupta
- Posted on: July 16 2005 03:16 EDT
- in response to Pratik Patel
Hi dear
i am sending you one thing coding part u should try this
<enterprise-beans>
<entity>
<description>Entity Bean ( CMP )</description>
<display-name>DodAuthorisation</display-name>
<ejb-name>DodAuthorisation</ejb-name>
<home>model.CMP.DodAuthorisationHome</home>
<remote>model.CMP.DodAuthorisation</remote>
<ejb-class>model.CMP.DodAuthorisationBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.String</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>DodAuthorisation</abstract-schema-name>
<cmp-field>
Context context = getInitialContext();
DodAuthorisationHome dodAuthorisationHome = (DodAuthorisationHome)PortableRemoteObject.narrow(context.lookup("DodAuthorisation"), DodAuthorisationHome.class));
this will help u out