aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes import question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "import question" Watch "import question" New topic
Author

import question

Luke Lee
Greenhorn

Joined: Dec 20, 2004
Posts: 2
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

Joined: Dec 19, 2004
Posts: 3
Because it uses Advice and AdviceHome classes which are present in the Headfirst package.
Eric Benoit
Greenhorn

Joined: Apr 11, 2002
Posts: 13
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<br /> <br />SCJP 1.4<br />SCWCD 1.3<br />SCBCD 1.3 (in progress)
Eric Benoit
Greenhorn

Joined: Apr 11, 2002
Posts: 13
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

Joined: Apr 11, 2002
Posts: 13
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

Joined: Dec 20, 2004
Posts: 2
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: import question
 
Similar Threads
Basic question, please help me guys
import a package
Importing Classes
Docking Windows
index.jsp Error 300: Class XYZ not found