Hello,
I am new to ejb ,I had a problem while running a
client ,I through a exception by name
javax.naming.NameNotFoundException:'HelloHome';
Remaining Name:'HelloHome'.
I am using stateless session bean in weblogic
server.Using DDCreator utility,i created manifest and
jar file sussesfully.
And also i changed weblogic property file.

My program is given below:
1)

import javax.ejb.*;
import java.rmi.*;
public interface Hello extends EJBObject
{
String sayHello(String s) throws RemoteException;
}

2)
import javax.ejb.*;
public interface HelloHome extends EJBHome

{
public Hello create() throws java.rmi.RemoteException,
javax.ejb.CreateException;
}


3)

import javax.ejb.*;

public class HelloBean implements SessionBean
{
SessionContext ctx;
public void ejbCreate()
{
}
public String sayHello(String s)
{
return "Hello There,"+s;
}
public void ejbRemove()
{
}
public void ejbPassivate()
{
}
public void ejbActivate()
{
}
public void setSessionContext(SessionContext ctx)
{
this.ctx = ctx;
}
}

4)
Client program

import java.rmi.*;
import javax.naming.*;
public class HelloClient
{
public static void main(String arg[])
{
try
{
InitialContext ic = new InitialContext();
HelloHome home=(HelloHome) ic.lookup("HelloHome");
Hello hel= home.create();
String retval=hel.sayHello("VIKRAM");
System.out.println("returned:"+retval);
hel.remove();
}
catch(java.rmi.RemoteException e)
{
System.out.println("remote exception occured:"+e);
}
catch(javax.ejb.CreateException e)
{
System.out.println("create exception occured:"+e);
}
catch(javax.ejb.RemoveException e)
{
System.out.println("remote exception occured:"+e);
}
catch(javax.naming.NamingException e)
{
System.out.println("naming exception occured:"+e);
}
}
}

all the programs I am writing in the directory by name

d:\ejb including client.I am compiling all the program
in the same directory.
If i write package statement in the program i can't
able to create
DD.ser file.
Please help me in this problem.wheater i have to
import any other
things to the client program.



I set my classpath properyly.Please help me in this.I
also change my weblogic property file
ie
weblogic.ejb.deploy=/d:\weblogic\classes\HelloBean.jar;/
d:\weblogic is the directory where i store weblogic
server.
I am using weblogic 4.5.1 server.Because of that i
gives me error or
else i have to use higher version.






__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to