• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

javax.naming. NameNotFoundException

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hai,
I am new to EJB i am using Weblogic6.1,Windows 2000, j2ee1.3, j2sdk1.4.
When i run my client HelloClient.java
Exception thrown is
javax.naming.NameNotFoundException:

HelloClient.java

package examples;
import javax.ejb.*;
import javax.naming.Context;
import javax.naming.InitialContext;
import java.util.Properties;
// Example of Client Code invokes methods on a simple
// stateless session bean;
public class HelloClient{
public static void main(String[] args)
{
try{
Properties props = System.getProperties();
Context ctx = new InitialContext(props);
System.out.println(" 3 ");
Object obj = ctx.lookup("Hello");
System.out.println(" 4 ");
HelloHome home = (HelloHome)javax.rmi.PortableRemoteObject.narrow(obj,HelloHome.class);
System.out.println(" 5 ");
Hello hello = home.create();
System.out.println(hello.hello());
hello.remove();
}catch(Exception e){
System.out.println("the error is " + e);
}
}
}

weblogic-ejb-jar.xml
<?xml version="1.0"?>
<!DOCTYPE weblogic-ejb-jar PUBLIC
'-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN'
'http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd'>
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>Hello</ejb-name>
<jndi-name>Hello</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>

ejb-jar
<?xml version="1.0"?>
<!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>
<enterprise-beans>
<session>
<ejb-name>Hello</ejb-name>
<home>examples.HelloHome</home>
<remote>examples.Hello</remote>
<ejb-class>examples.HelloBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
</ejb-jar>
thanks in advance

Elango
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you remember to set the target for your ejb? If so, did you confirm your ejb deployed successfully in weblogic? You can do this by looking in the weblogic.log for your server.
Could a moderator move this to the WebLogic Forum?
 
He got surgery to replace his foot with a pig. He said it was because of this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic