• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

question on my first EJB program? thanks all

 
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
 
Ranch Hand
Posts: 2713
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic