Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Stub not found - RMI

Posted on 1998-08-16
13
Medium Priority
?
777 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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 400 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
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…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Suggested Courses

963 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