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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Java applet socket problem

Status
Not open for further replies.

modalman

Programmer
Feb 14, 2001
156
GB
Hi. I'm writing an applet that uses ftp. Whenever I try to set up a socket just before using the PORT command I get errors. Is this because I need to have permissions set in order to set this socket up?

My code to set the socket up is:(I is a socket that I am using on port 21 to send commands to the server):

try{
localAddress = I.getInetAddress();
svrSkt=new ServerSocket(0,1,localAddress);
}
catch(Exception e){
}

The error I get is:

com.ms.security.SecurityExceptionEx[d.tryPortPasv]: cannot access 0
at com/ms/security/permissions/NetIOPermission.check (NetIOPermission.java)
at com/ms/security/PolicyEngine.deepCheck (PolicyEngine.java)
at com/ms/security/PolicyEngine.checkPermission (PolicyEngine.java)
at com/ms/security/StandardSecurityManager.chk (StandardSecurityManager.java)
at com/ms/security/StandardSecurityManager.checkListen (StandardSecurityManager.java)
at java/net/ServerSocket.<init> (ServerSocket.java)
at d.tryPortPasv (d.java)
at Explorer.doCmd (Explorer.java)
at Explorer.getDirList (Explorer.java)

Huge thanks in advance for any help. ASCII silly question, get a silly ANSI
 
Hi Please sign your applet and run your application. Then it is possible.

Are u opening the connection with the same server or to other server where the applet is downloaded. Then u need to sign it.

I mean Applet can open connection only to the server where it is downloaded from, otherwise u need a signed applet for to this work Shyam
 
Many thanks Shyam. That does make sense. Is that why PASV works and not PORT because PASV is setting a socket up on the server and not the client whereas port is trying to set up a socket on the client.

Thanks anyway

PS Do you happen to know any good signing tutorials? ASCII silly question, get a silly ANSI
 
Please Look into iplanet website for signing the jar.

ww.iplanet.com and search for it. I downloaded the tool from this site and worked out.

You will get signtool based on your OS.

Shyam Shyam
 
many thanks guys ASCII silly question, get a silly ANSI
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top