• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

import question

 
Luke Lee
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to EJB. I have a question about page 57 of HFEJB.
Why AdviceClient.java need to import headfirst.* ? Could sby give me a answer? Thanks
 
Ashwin
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because it uses Advice and AdviceHome classes which are present in the Headfirst package.
 
Eric Benoit
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I try this example from Head First EJB and when I compile AdviceClient.java I got an error telling me that headfirst.* package doesn't exist. It's the same thing for javax.ejb..

I added lib/j2ee.jar to the classpath and always the same things... somebody can help me?

Thanks,
 
Eric Benoit
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found the problem :

In the book, it's {CLASSPATH}:AdviceAppClient.jar

but in WinXP, it's %CLASSPATH%AdviceAppClient.jar

So that problem is now resolved but I got an exception in thread main.. NoClassDefFoundError AdviceClient..
 
Eric Benoit
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got it to work fine, seems to be another classpath error... I have to add the working directory in the classpath..
 
Luke Lee
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for reply.
But I think we already have a jar file which contains the advice.class and adviceHome.class. And we add the jar file to the javac command. I use windows 2000. When i compile, it is showed that javax.ejb.* and headfirt.* can not be found. I hope next edition of HFE could add content on how to compile and run this application on windows.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic