Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Stub not found - RMI

Posted on 1998-08-16
13
Medium Priority
?
772 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
Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
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.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

715 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