Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

javax.naming. NameNotFoundException  RSS feed

 
Elango
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • 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?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!