Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Exception while Looking up a local bean  RSS feed

 
BalajiNityaa Varadharajan
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to lookup a local bean. I am getting the following error.

javax.naming.NameNotFoundException: Context: ctsincsitxw4/nodes/ctsincsitxw4/servers/avwssql, name: SequenceSession: First component in name SequenceSession not found. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL mg.org/CosNaming/NamingContext/NotFound:1.0

Could anyone let me know what could be the problem.

Thanks in advance
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post your code and deployment descriptors, and tell us what you are trying to do when this failure occurs.
 
BalajiNityaa Varadharajan
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My code which does the Lookup is this...

InitialContext ctx = new InitialContext();
ReferencedLocalHome home = (ReferencedLocalHome)ctx.lookup("ejb/Referenced");
ReferencedLocal local = home.create();
local.referenced();

My ejb-jar.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar id="ejb-jar_ID">
<display-name>SessionReference</display-name>
<enterprise-beans>
<session id="Refer">
<ejb-name>Refer</ejb-name>
<home>sample.ReferHome</home>
<remote>sample.Refer</remote>
<ejb-class>sample.ReferBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<ejb-local-ref id="EJBLocalRef_1138347802993">
<ejb-ref-name>ejb/Referenced</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>sample.ReferencedLocalHome</local-home>
<local>sample.ReferencedLocal</local>
<ejb-link>Referenced</ejb-link>
</ejb-local-ref>
</session>
<session id="Referenced">
<ejb-name>Referenced</ejb-name>
<local-home>sample.ReferencedLocalHome</local-home>
<local>sample.ReferencedLocal</local>
<ejb-class>sample.ReferencedBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
</ejb-jar>


The bean that i am looking up has the JNDI Name: ReferencedLocalHome

I am doing this look up from a Session Bean.

Even if i give the ejb-ref-name same as the JNDI name i am getting this exception.

Please let me know the problem.

Thanks
 
Reid M. Pinchback
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you are forgetting the "java:comp/env" on your JNDI lookup.
 
BalajiNityaa Varadharajan
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Yaar. You were right.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!