Thread View: borland.public.jbuilder.java.api
6 messages
6 total messages
Started by George
Sun, 21 Mar 2004 07:00
RMI question
Author: George
Date: Sun, 21 Mar 2004 07:00
Date: Sun, 21 Mar 2004 07:00
37 lines
2592 bytes
2592 bytes
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
Re: RMI question
Author: John McGrath [TeamB]
Date: Thu, 25 Mar 2004 02:57
Date: Thu, 25 Mar 2004 02:57
46 lines
2859 bytes
2859 bytes
On 3/21/2004 at 2:00:01 AM, George wrote:
> 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
One possibility is that the stub and skeleton class files are being
deleted before the program runs. The default is to to a build before
running the program and the default for the build setup is to delete
files from the output path that are not created by the build.
If that is the case, you could change this several different ways:
1) You can modify the run configuration to not perform a build before
running by changing the "Build Target" to <None>.
2) You can modify the build settings so that JBuilder will not delete
files from the output path. This is controlled under the Project
Properties dialog box under Build | Java. Uncheck the "Synchronize
output dir" checkbox.
3) You can create an Ant script to run rmic and integrate that into the
build process, in the post-compile phase. Based on the JBuilder
feature matrix, I am pretty sure this should work in Foundation, but I
am not sure about that.
--
Regards,
John McGrath [TeamB]
---------------------------------------------------
Before sending me e-mail, please read:
http://www.JPMcGrath.net/newsgroups/e-mail.html
Re: RMI question
Author: Petar Banicevic
Date: Sat, 27 Mar 2004 21:56
Date: Sat, 27 Mar 2004 21:56
53 lines
2860 bytes
2860 bytes
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 > >
Re: RMI question
Author: George
Date: Wed, 31 Mar 2004 11:32
Date: Wed, 31 Mar 2004 11:32
92 lines
4437 bytes
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 > > > > > >
Re: RMI question
Author: Owen Green
Date: Wed, 31 Mar 2004 11:34
Date: Wed, 31 Mar 2004 11:34
15 lines
1399 bytes
1399 bytes
On Wed, 31 Mar 2004 03:32:57 -0800, George wrote: > 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. AFAIK, the RMI codebase can be remote, so in many real life deployments in wouldn't and couldn't appear on the classpath. There are probably some security implications to making it an explicit VM parameter as well. -- Owen
Re: RMI question
Author: Petar Banicevic
Date: Wed, 31 Mar 2004 21:41
Date: Wed, 31 Mar 2004 21:41
112 lines
5081 bytes
5081 bytes
I am not good in explaining things, however, if you need more help send me a mail to petar.banicevic@siemens.com.nospam (I can't use newsgroups from the office) and I can give you an examples of RMI server, options and security file ... etc... (remove nospam). P. PS: please don't send attachments to mail unless they are zipped with a password or rarred (with or without) a password. "George" <geo@geo1.com> wrote in message news:406a8078@newsgroups.borland.com... > 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 > > > > > > > > > > > >
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads