Solved

Stub not found - RMI

Posted on 1998-08-16
13
755 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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
countPairs challenge 7 58
strDist challenge 35 84
where is session ID cache stored 1 40
maven example error 3 36
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

760 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now