• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Exception while Looking up a local bean

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Yaar. You were right.
 
My pie came with a little toothpic holding up this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic