• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

First Program in HF

 
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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;
}
-----------------------------------------------------------------
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic