*
The moose likes EJB and other Java EE Technologies and the fly likes question on my first EJB program? thanks all Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "question on my first EJB program? thanks all" Watch "question on my first EJB program? thanks all" New topic
Author

question on my first EJB program? thanks all

tang tang
Greenhorn

Joined: Dec 22, 2002
Posts: 8
I follow <master ejb> chapter 4

first: I complie the Remote interface(Count.java) and complie successfully
code is follow::
package examples;
import javax.ejb.*;
import java.rmi.RemoteException;
public interface Count extends EJBObject {
public int count() throws RemoteException;
}

scoend ::
when I use javac.exe to compile Home interface(CountHome.java)
package examples;
import javax.ejb.*;
import java.rmi.RemoteException;
public interface CountHome extends EJBHome{
Count create(int val)throws RemoteException,CreateException;
}
third::
it cannot compile sucessfully and give me the follow error message:
CountHome.java:5: cannot resolve symbol
symbol : class Count
location: interface examples.CountHome
Count create(int val)throws RemoteException,CreateException
How can I do to resove the problem??? thanks alll
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
This is a simple Classpath issue. It has to do with the fact that, despite being compiled, the Count class is not on your Classpath.
The solution is to make sure you explicitly include all of the classes on your Classpath when running javac. You can override the Classpath setting for javac with the -classpath flag.
Therefore if your examples are located at:
C:\masteringejb\examples
Then you would run javac similar to this:
C:\masteringejb>javac -classpath ".;%CLASSPATH%" examples\*.java
BTW, this is basic Java question and I would be wary of jumping further into J2EE before you have an understanding of these types of basics. Things only get worse from here.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: question on my first EJB program? thanks all