• 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
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

EJB Loca interface lookup problem with Websphere 6

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All

Iam new to websphere 6, I try to lookup the Local Ejb in java Client as well as jspclient. I got the following error. please help me to solve the problem. but remote Interface working fine.


javax.naming.NameNotFoundException: Context: S6324Node01Cell/nodes/S6324Node01/s
ervers/myEJB, name: time: First component in name time not found. [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL mg.org/CosNaming/NamingContext/NotFound:1.0]
javax.naming.NameNotFoundException: Context: S6324Node01Cell/nodes/S6324Node01/servers/myEJB, name: time: First component in name time not found. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL mg.org/CosNaming/Nami
ngContext/NotFound:1.0 at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHe
lper.java:85)
at m.ibm.WsnOptimizedNaming._NamingContextStub.resolve_complete_info(Unknown Source)
at com.ibm.ws.naming.jndicos.CNContextImpl.cosResolve(CNContextImpl.java
:4045)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1
776)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1
737)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:
1444)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:132
4)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:144)
at javax.naming.InitialContext.lookup(InitialContext.java:361)
at ejb.bind.ejbBindCheck.main(ejbBindCheck.java:87)



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">
<description>
ejb-jar.xml for LocalizationDepwb component
</description>
<display-name>time</display-name>
<enterprise-beans>
<session id="Session_MyTime">
<description>An EJB named MyTimeBean</description>
<display-name>MyTimeBeanName</display-name>
<ejb-name>MyTimeBean</ejb-name>
<local-home>mytimepak.MyTimeLocalHome</local-home>
<local>mytimepak.MyTimeLocal</local>
<ejb-class>mytimepak.MyTimeBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
</ejb-jar>

JNDI Name = time

But both remote and local interface working fine in JBOSS server. please Help me to solve the problem..

Thanks lots.....
 
author and cow tipper
Posts: 5000
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, could you show us the code you're using to do the lookup. Does it look anything like this:




I have a tutorial on doing JNDI lookup with WebSphere, and how to work with JNDI clients. It might help you out:

Doing WebSphere JNDI Lookups with Local and Remote EJB Interfaces

Good luck!

-Cameron McKenzie
 
babujava jayaraman
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

this my client code.



public static void main(String a[]){
try {
/*************** WAS *************/
Properties p = new Properties();
p.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");
p.put(javax.naming.Context.PROVIDER_URL, "iiop://172.26.9.124:2812";);
InitialContext context = new InitialContext(p);
System.out.println("=====context created finished.....");
Object result = ic.lookup("time");

System.out.println("lookup finished.....");
MyTimeLocal myTimeLocal = myTimeHomeLocal.create();
System.out.println("create finished.....");
String server_time = myTimeLocal.getTime();
System.out.println("SERVER TIME =: "+server_time);
}
catch (Exception e) {
System.out.println(e);
e.printStackTrace();
}
}



ejb-jar.xml
-----------

<enterprise-beans>
session id="Session_MyTime">
description> An EJB named MyTimeBean /description>
display-name> MyTimeBeanName /display-name>
ejb-name> MyTimeBean </ejb-name>
local-home> mytimepak.MyTimeLocalHome /local-home>
local> mytimepak.MyTimeLocal /local>
ejb-class> mytimepak.MyTimeBean /ejb-class>
session-type> Stateless /session-type>
transaction-type> Container /transaction-type>
/session>
</enterprise-beans>



[ April 29, 2007: Message edited by: babujava jayaraman ]

[ April 29, 2007: Message edited by: babujava jayaraman ]
[ April 29, 2007: Message edited by: babujava jayaraman ]
 
I don't even know how to spell CIA. But this tiny ad does:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic