🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #283

Re: RMI question

#283
From: George
Date: Wed, 31 Mar 2004 11:32
92 lines
4437 bytes
Whoa Petar,

I just logged on to post that I had found what the problem was and here I
see your post!

Even after making sure (as John McGrath suggested) that the stub was not
getting erased when I started the server, I found the same problem.  After
some stumbling around in the documentation, I got it to work.

Yes the "problem" is indeed that you have to
pass -Djava.rmi.server.codebase=file:///ATest/classes/  to the VM.  So you
have to set this in the runtime configuration as one of the parameters to be
passed.  Of course the path I am setting in codebase is already in the
classpath that JBuilder is passing to javaw.  So I don't quite understand
what's going on.  Maybe somebody can explain.

Just a note of documentation
regarding -Djava.rmi.server.codebase=file:///ATest/classes/
Three slashes are required after file: on Windows (well at least 98!); (2
slashes wont work);  also the slash after classes is required!

Also, I was wrong when I said in my last post that I don't see a way to
generate stubs from the IDE in JBuilder X Foundation.  Well as it turns out
you can right click the file in the Project pane and from the Properties
menu item indicate that you want rmi stub to be generated.

Thank you guys for the help.
George


"Petar Banicevic" <petar2@kupi.biz> wrote in message
news:4065f86c@newsgroups.borland.com...
> Perhaps this isn't a case, but anyway: don't forget about
> "java.rmi.server.codebase" ...
>
> Petar
>
>
> "George" <geo@geo1.com> wrote in message
> news:405d1169@newsgroups.borland.com...
> > I just started learning Java RMI and am having a problem getting my
first
> > server up and running.
> >
> > I am using JBuilder X Foundation on Win 98.  I have a project called
Test
> > located at C:\ATest.  There are 3 source files in a package called test
> > located at C:\ATest\src\test.  The class files go to
> C:\ATest\classes\test.
> > The 3 source files are WeatherIntf.java  (the remote interface),
> > WeatherServer.java (the server program), and RMIdemo.java (the client
> > program).  (Yes, this is the example program from Peter van der Linden's
> > book Just Java.)
> >
> > I build the project in JBuilder.  Then from a DOS window I run the rmic
on
> > WeatherServer.class to generate the stub and skeletons (I don't see a
way
> to
> > do this in JBuilder X Foundation).  These two files go to
> > C:\ATest\classes\test  (i.e same directory as all other classes in
> project).
> > I then start the RMIRegistry from Tools | RMIRegistry  in JBuilder.  I
> then
> > run WeatherServer from JBuilder using a runtime configuration set up
with
> a
> > policy file that grants the required socket permissions (connect and
> > accept).
> >
> > At this point I get the following error:
> >
> > RemoteException occurred in server thread; nested exception is:
> >  java.rmi.UnmarshalException: error unmarshalling arguments; nested
> > exception is:
> >  java.lang.ClassNotFoundException: test.WeatherServer_Stub
> >
> > In the output window in JBuilder I also see the following fragment along
> > with a list of other paths:
> > C:\JBUILDERX\JDK1.4\bin\javaw -classpath "C:\ATest\classes;".......
> >
> > Since C:\ATest\classes is in the class path, I don't understand why
> > test.WeatherServer_Stub cannot be found.  It is in the very same
> directory.
> >
> > Any help would be greatly appreciated.
> > Thanks
> > George
> >
> >
>
>
Technical Details
Message-ID: <406a8078@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!newsfeed2.telusplanet.net!newsfeed.telus.net!bigfeed.bellsouth.net!news.bellsouth.net!peer01.cox.net!cox.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <405d1169@newsgroups.borland.com> <4065f86c@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,8ff13b2f02af21f5
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2004-03-31 00:39:39 PST
From: "George" <geo@geo1.com>
Newsgroups: borland.public.jbuilder.java.api
References: <405d1169@newsgroups.borland.com> <4065f86c@newsgroups.borland.com>
Subject: Re: RMI question
Date: Wed, 31 Mar 2004 03:32:57 -0800
Lines: 94
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 12.75.205.120
Message-ID: <406a8078@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1080721528 12.75.205.120 (31 Mar 2004 00:25:28 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!newsfeed2.telusplanet.net!newsfeed.telus.net!bigfeed.bellsouth.net!news.bellsouth.net!peer01.cox.net!cox.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail