• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

question on my first EJB program? thanks all

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
A lot of people cry when they cut onions. The trick is not to form an emotional bond. This tiny ad told me:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic