Prashant Jani

Greenhorn
+ Follow
since Mar 29, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Prashant Jani

alternatively you can edit the '.bat' files to set the variables.
i guess this should solve your problems

HI,
I am sure you have done the settings for the classpath.
well first try to run : j2ee -stop
This will stop any instance of the server. then you can start the server using j2ee -verbose (recommended).
You cannot start another instance if the server is already on. ( You must not have shut down the server ).
Always properly shut down the server j2ee -stop.
Do not try to kill the process using ctrl C or end process.

Originally posted by mcd:
It's hard to tell, with no code posted. Remember that in EJB 1.1 you have to specify the remote referenced in the deployment descriptor with the "ejb-ref" tag.
mcd


Well i am pating the code which i have used both in servlet ( which works) and the S'less session bean.

String JNDI_NAME="TestAcc";
javax.naming.Context initial=null;
java.util.Hashtable env =new java.util.Hashtable(1);
try{
initial = new javax.naming.InitialContext(env);
}
catch(Exception e) {
System.out.println("could not get initContext");
}
try{
Object objref = null;
objref = initial.lookup(JNDI_NAME);
//objref = initial.lookup("TestAcc"); // tried this also
TestAccHome home = (TestAccHome)PortableRemoteObject.narrow(objref, TestAccHome.class);
TestAcc duke = home.create("1", "Duke", "Earl", 50.00);
}
catch(javax.naming.NamingException e)
{
System.out.println("Lookup exception ");
}
catch(Exception e)
{
System.out.println("Lookup exception " + e);
}
I get "Lookup exception "

I guess this should be helpful to you.

regards
jani prashant
Hi,
I am using IPlanet NAS (SP1).
I want to call an entity bean from session bean. However i get lookup(Naming) exception.
The same code works fine when i call the bean from a servlet.
Can you tell me the possible reason for the look up failure fron S bean. Is there any other method to b followed in case of bean referring another bean ?
Other than findbyPrimaryKey the other finder methods give me an exception. I guess i dont have to write the code in my EJB class ??
Please help me on this.
regards
jani prashant
well you should first check for the object type.
pkObj is the primary key class and pk is the primary key String class.
eg .
public boolean equals(Object obj)
{
if (Obj.instance of pkObj)
{
if(((pkObj)obj).pk.equals(pkobj.pk))
{
return true
}
else return false;
}
else return false;
}