File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

First Program in HF

 
Gayatri Ganesh
Ranch Hand
Posts: 143
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic