This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Building Blockchain Apps and have Michael Yuan on-line!
See this thread for details.
Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

Exception while Looking up a local bean

 
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
 
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
 
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.
 
Getting married means "We're in love, so let's tell the police!" - and invite this tiny ad to the wedding:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!