Hi, My FBN assignment is fairly close to handing in, so I thought i'd have a test run before checking though all my classes one last time to ensure i've not missed something stupidly. Anyhow, what I did was create three JAR files, FBNClient.jar, FBNServer.jar and FBNCommon.jar. Into the FBNClient I put simply the classes that were to produce my client. Into the FBNServer I put the class that started the server, and my rmi stubs. Into the Common I put everything else. In the manifest for FBNClient.jar, I have:
When I do: java -jar FBNClient.jar The client seems to work fine. So, I pretty much mirrored this in the manifest for FBNServer.jar:
Then I ran into some problems. My server, which was working fine when I was executing it from the directory that the class compile too, it was working fine. I had a policy file that granted AllPermission. etc. I was doing the following:
What i'm doing now (and i'm not totally sure that it's correct is):
However, i'm getting the following:
Now, obviously according to this I don't have access to the C:\db.db file that I do have access too when i'm executing the server from its classes directory. And I have no idea why. Do I need to give my jar files permissions or something? Maybe their own copy of the policy file? Is my java.rmi.server.codebase incorrect now that the classes are in a jar file? I'm really confused and don't know where i'm going wrong. Any help is greatly appreciated. Thanks Gary [Andrew: edited exception report so that horizontal scrolling is not required] [ May 11, 2004: Message edited by: Andrew Monkhouse ]
Hi, Erm, probably from some kind of RMI tutorial i've followed in the past, I have in my code:
My policy file:
As I said, using this policy file and running the server from the classes directory, everything seems to work fine. After adding the files to a jar file, I get the exception described above and I have no idea what's wrong. Thanks Gary
Although in the FBNS assignment it does suggest the possible use of security manager (i.e. as part of the acceptable command line features) it is optional not mandatory. At least in my FBNS assignment.
I originally intended to use a security manager but, for the assignment, judged that this was an overkill and removed it. I explained my reasons for doing so in the Design Decisions documentation and I don't think that not using it had any effect upon my marking.
My understanding is that the new assignment details explicitly state not to use a security manager. Hope this helps - I had similar fun while trying to use a security manager!