Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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.
 
The human mind is a dangerous plaything. This tiny ad is pretty safe:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic