Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

question on my first EJB program? thanks all

 
tang tang
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic