Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Jini problem : Error when creating a transaction

Status
Not open for further replies.

SH4F33

Programmer
Apr 1, 2005
58
MU
Hello everybody. Im currently learning java and jini. Im using jini version 2.1.
Ive been working on simple examples from books and I can read/write to the space. Im using only one computer,meaning that the jini services and the client are on the same computer.
I tried creating a transaction but I get the following error:

java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:4160 connect,resolve)

I thought that there was a problem with the policy file, but it seems OK. I even opened the port 4160 in my firewall but without any luck.

If I remove the code for creating the transaction, the program works fine;i.e, I can read/write to the space.

Is there something that I should add or remove?

Thanks in advance.
 
Thank you very much for your attention.

Here's wats in ther policy file:

Code:
grant {
    permission java.security.AllPermission;
};

The filename is jsk-all.policy. I just copied the one that jini is using and put it in my class folder ;p

JBuilder is launching my class with the following arguments:

Code:
D:\Borland\JBuilder2006\jdk1.5\bin\javaw -classpath "D:\bb\classes;
D:\Program Files\jini2_1\classes;
D:\Borland\JBuilder2006\jdk1.5\lib\jconsole.jar;
D:\Borland\JBuilder2006\jdk1.5\lib\dt.jar;
D:\Borland\JBuilder2006\jdk1.5\lib\htmlconverter.jar;
D:\Borland\JBuilder2006\jdk1.5\lib\tools.jar;
D:\Borland\JBuilder2006\jdk1.5\jre\lib\ext\dnsns.jar;D:\Borland\JBuilder2006\jdk1.5\jre\lib\ext\sunpkcs11.jar;
D:\Borland\JBuilder2006\jdk1.5\jre\lib\ext\sunjce_provider.jar;
D:\Borland\JBuilder2006\jdk1.5\jre\lib\ext\localedata.jar;
D:\Borland\JBuilder2006\jdk1.5\jre\lib\deploy.jar;
D:\Borland\JBuilder2006\jdk1.5\jre\lib\plugin.jar;
D:\Borland\JBuilder2006\jdk1.5\jre\lib\rt.jar;
D:\Borland\JBuilder2006\jdk1.5\jre\lib\im\indicim.jar;
D:\Borland\JBuilder2006\jdk1.5\jre\lib\im\thaiim.jar;
D:\Borland\JBuilder2006\jdk1.5\jre\lib\jce.jar;
D:\Borland\JBuilder2006\jdk1.5\jre\lib\jsse.jar;
D:\Borland\JBuilder2006\jdk1.5\jre\lib\javaws.jar;
D:\Borland\JBuilder2006\jdk1.5\jre\lib\charsets.jar"  
-Djava.security.policy=jsk-all.policy bb.test
 
Have you tried editing the default policy under JAVA_HOME, or providing a full path, eg :

-Djava.security.policy=D:\full\path\to\jsk-all.policy bb.test

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Since Im new to java, I dont know wat default policy is. I just copied the jsk-all.policy to the folder where all my classes are.

Ive also tried the following:

My classes are in c:\Java Projects\bb\classes\bb
And the policy file as well is in that same directory

Ive tried running the program with these VM arguments:

-Djava.security.policy=c:\Java Projects\bb\classes\bb\jsk-all.policy bb.test

-Djava.security.policy=c:\Java_Projects\bb\classes\bb\jsk-all.policy bb.test (I thought that the space in the directory name was the error)

-Djava.security.policy=jsk-all.policy bb.test

But again no luck.
 
Hi,

I have Steven Halter's Java Spaces Example by Example but it's for Jini 1.1 and having trouble getting example 1, finding a java space to work. Wondered which book(s) you might recommend that are useful for jini 2.1. Thanks.

 
Well, even if its for v1.1, u can still get the basics like read,readifexists and so on.

But I guess for the the space lookup service and the transaction manager lookup service, the code will b slightly different.

I can provide u the code for the lookups and a little exampe.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top