File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

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 Advice.java in the same package as AdviceHome.
Can antone please tell me what is wrong, I have attached the code for AdviceHome.java and Advice.java.

Thanks,
-Gayatri.

-------------------------------------
AdviceHome.java:12: cannot resolve symbol
symbol : class Advice
location: package headfirst
import headfirst.Advice;
^
AdviceHome.java:15: 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
Greenhorn

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 AdviceHome.java, as both the files are in the same package.

cheers...


SCJP 1.2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: First Program in HF