Lakshmi Saradha

Ranch Hand
+ Follow
since Oct 21, 2003
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Lakshmi Saradha

Hi All,
I took the exam today and passed with 81%. I read through the EJB spec and head First EJB book and took all mock tests listed in this forum. Though I did not post a lot of questions ,I have been a silent observer.
Thanks a bunch to Javaranch and Kathy & Bert.

Thank you all,
Lakshmi.
14 years ago
Hi,

I gave the JNDI name as 'ejb/TEST'.

As specified in the J2EE RI docs, I included this in the default-web.xml.

<ejb-ref>
<ejb-ref-name>ejb/TEST</ejb-ref-name>
<jndi-name>corbaname:iiop:localhost#ejb/TEST</jndi-name>
</ejb-ref>

My clinet source code is

import javax.naming.*;
import javax.rmi.PortableRemoteObject;
import hf.AdviceHome;
import hf.Advice;
import java.rmi.*;
import javax.ejb.*;
import java.util.*;

public class AdviceClient{


public static void main(String args[]){

new AdviceClient().go();
}

public void go(){

try{




Context ic = new InitialContext();
//Object o = ic.lookup("TEST");




AdviceHome ac = (AdviceHome)PortableRemoteObject.narrow(ic.lookup("java:comp/env/ejb/TEST"),AdviceHome.class);



Advice adcomp = ac.create();
System.out.println(adcomp.getAdvice());
}
catch(Exception e)
{
e.printStackTrace();
//System.out.println(e.getMessage());
}


}//end of method



}

I still get a NmaNotFoundException.

Please advice.
Hi,

I am in the first chapter of HFEJB book. I get a 'nameNotFound' Exception when I try to run the client program.

import javax.naming.*;
import javax.rmi.PortableRemoteObject;
import hf.AdviceHome;
import hf.Advice;
import java.rmi.*;
import javax.ejb.*;
import java.util.*;

public class AdviceClient{


public static void main(String args[]){

new AdviceClient().go();
}

public void go(){

try{




Context ic = new InitialContext();
//Object o = ic.lookup("TEST");




AdviceHome ac = (AdviceHome)PortableRemoteObject.narrow(ic.lookup("TEST"),AdviceHome.class);



Advice adcomp = ac.create();
System.out.println(adcomp.getAdvice());
}
catch(Exception e)
{
e.printStackTrace();
//System.out.println(e.getMessage());
}


}//end of method



}

Here is the error.
======================
javax.naming.NameNotFoundException: TEST not found
<<no stack trace available>>


==========
Any thoughts on the cause?
Hi Sawan,
Thank you for the reply.
Could you please explain me 'serverPropertiesObj'? Is this an instance of 'Properties'?If so,what is the key-value pair that should be stored here?
Hi ,

I am in the first chapter of HFEJB book. I am getting a 'Can'tSerialContextProvider' error. here is my source code of the Client program.

import javax.naming.*;
import javax.rmi.PortableRemoteObject;
import hf.AdviceHome;
import hf.Advice;
import java.rmi.*;
import javax.ejb.*;


public class AdviceClient{


public static void main(String args[]){

new AdviceClient().go();
}

public void go(){

try{
Context ic = new InitialContext();
//Object o = ic.lookup("TEST");




AdviceHome ac = (AdviceHome)PortableRemoteObject.narrow(ic.lookup("AdviceBean"),AdviceHome.class);



Advice adcomp = ac.create();
System.out.println(adcomp.getAdvice());
}
catch(Exception e)
{
e.printStackTrace();
//System.out.println(e.getMessage());
}


}//end of method



}

Here is the stack trace.
===========================================
javax.naming.CommunicationException: Can't find SerialContextProvider
at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:63)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:120)
at javax.naming.InitialContext.lookup(InitialContext.java:345)
at AdviceClient.go(AdviceClient.java:26)
at AdviceClient.main(AdviceClient.java:14)

=======================================

Any thoughts on the cause?
Hi All,
Would any one of you mind in helping me getting out of this?
Hi Arun,

I tried but am getting the same results.
Hi All,
I am encountering compiler errors in the AdviceClient.java found in chapter 1 of K AND B book.

Here is the source code.

import javax.naming.*;
import javax.rmi.*;
import hf.*;
import java.rmi.*;
import javax.ejb.*;


public class AdviceClient{


public static void main(String args[]){

new AdviceClient().go();
}

public void go(){

try{
Context ic = new InitialContext();
Object o = ic.lookup("TEST");




AdviceHome ac = (AdviceHome)PortableRemoteObject.narrow(o,AdviceHome.class);



Advice adcomp = ac.create();
System.out.println(adcomp.getAdvice());
}
catch(Exception e)
{
e.printStackTrace();
}


}//end of method

}

This is the list of errors I get
======================================
AdviceClient.java:25: inconvertible types
found : java.lang.Object
required: AdviceHome
AdviceHome ac = (AdviceHome)PortableRemoteObject.narrow(o,AdviceHome.class);
^
AdviceClient.java:29: cannot resolve symbol
symbol : method create ()
location: class AdviceHome
Advice adcomp = ac.create();
^
AdviceClient.java:30: cannot resolve symbol
symbol : method getAdvice ()
location: class Advice
System.out.println(adcomp.getAdvice());
^
3 errors======================================================

Any idea of what is causing the error?
I have the j2ee.jar file in the classpath and also the ejb-jar file in the class path. But I get the same error.
Hi Christopher,

I visited the forum to post this question and saw your post.

I guess somebody would help us.
Thank you all.

How is this exam? Does it require a lot of practice like the SCJP?
I am trying to build adn deploy the sample applciation which comes along with weblogic 6.1. I would like to run the 'ant' command to compile and deploy. In Windows explorer, I am able to see the contents of the directory wlserver6.1. But when it comes to command prompt, when I try to change to this directory, I get 'Invalid Directory'. Also I could find that the directory has 0 bytes.

Has anyone encountered this earlier?
15 years ago
Hi,
I have purchased a voucher for the BCD exam. I am very new to EJB. Currently I have started reading Enterprise Javabeans by RMH. Is there a place where I can come to know about
1)downloading an IDE(Do you suggest this or do you suggest typing the code in a notepad?)
2)Downloading the server?
3)Sample tutorials to write a 'hello world' program and deploy it.

Thanks,
Lakshmi.
Hi Rathi ji,
How did you find the test and what study materials did you use?

Thanks,
Lakshmi.