Solved

Stub not found - RMI

Posted on 1998-08-16
13
765 Views
Last Modified: 2008-03-03
Hi,

I was woundering if anybody can help me.
I've compiled my RMI server. And I generated the Stub and Skel. And I ran the rmiregistry.
But when I run my program this error occurs:
java.rmi.UnexpectedException: Unexpected exception; nested exception is:
        java.lang.ClassNotFoundException: StatsServer_Stub
The StatsServer_Stub.class is in the same directory as my server class.

What didn't I do right?

thanks
0
Comment
Question by:BabyFace
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
  • 2
  • +1
13 Comments
 
LVL 3

Expert Comment

by:sailwind
ID: 1219982
You probably checked these, but let's run through it again.

1. Is your class path set correctly to include the directory you're working in?
2. Is your class defined with the correct upper and lower case letters?
3. Did you call the class with the correct upper and lower case letters?
4. Is the file's permission set correctly? Meaning is it readable.

Just some ideas.
0
 
LVL 1

Author Comment

by:BabyFace
ID: 1219983
I check 2 and 3. And I'm pretty sure 1 is right.
But I'm not sure about 4?
0
 
LVL 1

Author Comment

by:BabyFace
ID: 1219984
I don't know what you mean by 4.

0
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
LVL 3

Expert Comment

by:sailwind
ID: 1219985
You can check 1 by typing "set" at the prompt. Then look to see if you have
a classpath defined and the classpath include your working directory.

4 is for unix systems. There are permission flags on each file that's set.
If the file is not set to be readable, then you won't be able to access the
class files. If you're not running an unix box, don't worry about it.
0
 
LVL 1

Author Comment

by:BabyFace
ID: 1219986
Just to make sure I set my CLASSPATH to the correct directory.
I deleted the Stub and Skel class files. Set the CLASSPATH and recompiled them.
Then I ran the rmiregistry. And ran my Server.
Same error.
Oh ya, I use Win'95
0
 
LVL 1

Expert Comment

by:dryang
ID: 1219987
hi BabyFace

Is it possible to see your classpath statement?

Thanks
0
 
LVL 1

Author Comment

by:BabyFace
ID: 1219988
set CLASSPATH=F:\javatemp
0
 
LVL 3

Expert Comment

by:sailwind
ID: 1219989
Hmm.. curious. You don't include the files in your jdk bin directory in your class
files? I wonder how they found the java.awt, etc. files without you specifying the
JDK bin directory.  Are you running any other compilers? Like symantec or
a JRE plugin from sun?
0
 

Expert Comment

by:jdso
ID: 1219990
Hi
  Two questions:
    Is your StatsServer inside a package?
    Is your rmiresgistry with the same classpath?
0
 
LVL 1

Author Comment

by:BabyFace
ID: 1219991
To sailwind:
In my autoexec, I set path to equal C:\jdk1.1.6\bin and thats why I could access the programs in the bin.
I use VJ++, I think they put classes.zip inside my C:\windows\java directory, and that's why I could access java.awt.* and the rest of the packages.
To jdso:
StatsServer is not inside a package. But it is in it's own directory.
And no rmiregistry is not in the same classpath. It is place inside c:\jdk1.1.6\bin.
I excute it from the dos prompt.
0
 

Expert Comment

by:jdso
ID: 1219992
Sorry, what I meant was if you launched rmiregistry from a dos shell with the same classpath as the one you're trying to run your program from. But, from what you said, you do something like "start rmiregistry" at the dos shell. Right? That shouldn't be a problem.


0
 
LVL 3

Expert Comment

by:sailwind
ID: 1219993
Oh yeah, make sure you include your current working path to the
classpath or else Java won't know where to look for the classes.
0
 
LVL 3

Accepted Solution

by:
sailwind earned 200 total points
ID: 1219994
As a final note, let's hope that it has fixed your problem:

In your class path statement, make sure you add
   
    a. the path where you're working in, namely, the path where your project classes
       are stored.
    b. the    .    directory. This ensures that java will go to the current directory to
       look for the compiled classes
    c. The class.zip directory, this should be where your jdk is located at.


0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This video teaches viewers about errors in exception handling.
Suggested Courses

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question