Forums Register Login

HF EJB compile error

+Pie Number of slices to send: Send
Hi - I'm doing the Head First EJB book and am getting the following error when I go to compile from the command line like it wants:


C:\My_Programs\EJBClass\Advice\src\headfirst>javac advice.java
advice.java:4: package javax.ejb does not exist
import javax.ejb.*;
^
advice.java:11: cannot find symbol
symbol: class EJBObject
public interface Advice extends EJBObject

It does build in the Netbeans IDE - however the book would prefer that I not use the IDE so that I learn the nuts and bolts of everything 1st.

So - what's wrong in my setup?


^
+Pie Number of slices to send: Send
You're missing the EJB classes in your classpath. You need to do something like "javac -classpath XYZ.jar advice.java", where XYZ.jar is the file that contains the EJB classes. Check your EJB container, it should include it.
+Pie Number of slices to send: Send
Is this what you were talking about? If so - it still doesn't work.

C:\My_Programs\EJBClass\Advice\src>javac -d ../classes headfirst/*.java

So, Where do the EJB classes exist? I've been looking for them and my path is

C:\My_Programs\EJBClass\Advice>path
PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Common Files\Adaptec Shared\System;C:\Sun\AppServer\bin;C:\Program Files\Java\jdk1.5.0_06\bin

Did I miss downloading something?
I have JAVA_HOME set to...C:\Program Files\Java\jdk1.5.0_06
and J2EE_HOME set to... C:\Sun\AppServer

Could I be running into a version conflict?
+Pie Number of slices to send: Send
The "-d" switch merely tells the compiler where to put the class files, it has nothing to do with the "-classpath" switch that telli si where to look for additional classes.

Look through the jar files in the C:\Sun\AppServer directory - somewhere in there you should find the required jar file.

Also, you could download the class files from this page.
[ January 04, 2007: Message edited by: Ulf Dittmer ]
Who among you feels worthy enough to be my best friend? Test 1 is to read this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 637 times.
Similar Threads
Problem with compiling the examples
Trying to Compile code From "Head First EJB"
having issues with compile for AdviceBean from HF EJB
error compiling ejb, first time prompt compile
Does javax.ejb exists!!
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 09:27:20.