Solved

Stub not found - RMI

Posted on 1998-08-16
13
759 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
  • 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

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 …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…

770 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