File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes First Program in HF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "First Program in HF" Watch "First Program in HF" New topic

First Program in HF

Gayatri Ganesh
Ranch Hand

Joined: Dec 23, 2003
Posts: 143
Hi Everyone,

I am trying to run the 1st ejb in the headfirst book on page #18.
I have the exact code as in the book. But the AdviceHome always fails.
It says although it has the in the same package as AdviceHome.
Can antone please tell me what is wrong, I have attached the code for and


------------------------------------- cannot resolve symbol
symbol : class Advice
location: package headfirst
import headfirst.Advice;
^ cannot resolve symbol
symbol : class Advice
location: interface headfirst.AdviceHome
public Advice create() throws RemoteException, CreateException;
2 errors
package headfirst;

import javax.ejb.EJBHome;
import javax.ejb.CreateException;
import java.rmi.RemoteException;
import headfirst.Advice;

public interface AdviceHome extends EJBHome {
public Advice create() throws RemoteException, CreateException;
package headfirst;

import javax.ejb.EJBObject;
import java.rmi.RemoteException;

public interface Advice extends EJBObject {
public String getAdvice() throws RemoteException;
Ankush Wali

Joined: May 20, 2005
Posts: 4
Hi Gayatri,

Pls check the package structure of your projects folder.

Moreover, we don't need to add "import headfirst.Advice;" in, as both the files are in the same package.


SCJP 1.2
I agree. Here's the link:
subject: First Program in HF
It's not a secret anymore!