Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

AdviceAppClient.jar and AdviceClient.java compilation failure...again;-)

 
Raul Vieira
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone

I'm working through the Head First EJB (great book so far) and I've run into some trouble when trying to compile the AdviceClient.java. I know this is not the first time that this has been reported, but I've gone over all of the different postings without finding a resolution. I'm sure this is a environment variable issue, but I'm at a loss. Below is the contents of all the important stuff and the results of my compliation attempt. I'd appreciate any guidance that could be provided in solving this issue.

--ENVIRONMENT VARIABLES:

CLASSPATH = .;C:\j2sdk1.4.1_02\bin;C:\j2sdk1.4.1_02\lib;C:\j2sdkee1.3.1\bin;C:\j2sdkee1.3.1\lib\j2ee.jar

J2EE_CLASSPATH = C:\j2sdkee1.3.1\lib

J2EE_HOME = C:\j2sdkee1.3.1

PATH = .;C:\j2sdkee1.3.1\bin;C:\j2sdk1.4.1_02\bin

JAVA_HOME = C:\j2sdk1.4.1_02


--COMPILATION RESULTS:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Raul>CD C:\Documents and Settings\Raul\My Documents\Development\SCBD Prep\projects\advice

C:\Documents and Settings\Raul\My Documents\Development\SCBD Prep\projects\advice>javac -classpath %CLASSPATH%;AdviceAppClient.jar AdviceClient.java
AdviceClient.java:4: package headfirst does not exist
import headfirst.*;
^
AdviceClient.java:19: cannot resolve symbol
symbol : class AdviceHome
location: class AdviceClient
AdviceHome home = (AdviceHome) PortableRemoteObject.narrow(o, AdviceHome.class);
^
AdviceClient.java:19: cannot resolve symbol
symbol : class AdviceHome
location: class AdviceClient
AdviceHome home = (AdviceHome) PortableRemoteObject.narrow(o, AdviceHome.class);
^
AdviceClient.java:19: cannot resolve symbol
symbol : class AdviceHome
location: class AdviceClient
AdviceHome home = (AdviceHome) PortableRemoteObject.narrow(o, AdviceHome.class);
^
AdviceClient.java:21: cannot resolve symbol
symbol : class Advice
location: class AdviceClient
Advice advisor = home.create();
^
5 errors
 
T Rob Darrough
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't need any of the following on your classpath.

C:\j2sdk1.4.1_02\bin
C:\j2sdk1.4.1_02\lib
C:\j2sdkee1.3.1\bin

Try ...

CLASSPATH = C:\j2sdkee1.3.1\lib\j2ee.jar;.\classes

With this classpath you should not need to specify a classpath on the command line also. The AdviceAppClient.jar is also not needed, and in fact could cause problems. If anything you might put AdviceApp.jar (because it contains the headfirst package), but thats not needed as long as (1) the headfirst package is in your classes folder, (2) your classes folder is just off of your working folder (advidce) and (3) you compile from your working folder (advice). If you compile from your src folder, then use this instead ...

CLASSPATH = C:\j2sdkee1.3.1\lib\j2ee.jar;..\classes

If it still doesn't work then confirm that your headfirst package has all of the interfaces. They should all be there.
 
Serkan Yazici
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Raul,

Are you sure that you've placed all the java source files and AdviceAppClient.jar inside a "headfirst" folder:

And compile from folder using:

[ May 30, 2004: Message edited by: Serkan Yazici ]
 
Bhavesh K.
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys if you want to get this compiled and get moving look no further than what Rob says! Very accurate and to the point...just try that out...trust me. I was also but now
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic