[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

How do socket communicate with host by applet?

Posted on 2001-06-20
4
Medium Priority
?
239 Views
Last Modified: 2010-04-16
I have meet a problem following that recentainly:  
   Why can't the client send the message to server in UDP programing When I use applet and frame ?
   There are the following error in java control:
//************************************************//
com.ms.security.SecurityExceptionEx[JIMMessage.feedback]: cannot access 6767
   at com/ms/security/permissions/NetIOPermission.check
   at com/ms/security/PolicyEngine.deepCheck
   at com/ms/security/PolicyEngine.checkPermission
   at com/ms/security/StandardSecurityManager.chk
   at com/ms/security/StandardSecurityManager.checkListen
   at java/net/DatagramSocket.create
   at java/net/DatagramSocket.<init>
   at java/net/DatagramSocket.<init>
   at JIMMessage.feedback
   at JIMEnter.actionPerformed
   at java/awt/Button.processActionEvent
   at java/awt/Button.processEvent
   at java/awt/Component.dispatchEventImpl
   at java/awt/Component.dispatchEvent
   at java/awt/EventDispatchThread.run
com.ms.security.SecurityExceptionEx[JIMMessage.feedback]: cannot access "192.168.0.3":6767
   at com/ms/security/permissions/NetIOPermission.check
   at com/ms/security/PolicyEngine.deepCheck
   at com/ms/security/PolicyEngine.checkPermission
   at com/ms/security/StandardSecurityManager.chk
   at com/ms/security/StandardSecurityManager.chkex
   at com/ms/security/StandardSecurityManager.checkConnect
   at java/net/DatagramSocket.send
   at JIMMessage.feedback
   at JIMEnter.actionPerformed
   at java/awt/Button.processActionEvent
   at java/awt/Button.processEvent
   at java/awt/Component.dispatchEventImpl
   at java/awt/Component.dispatchEvent
   at java/awt/EventDispatchThread.run
Exception occurred during event dispatching:
com.ms.security.SecurityExceptionEx[JIMMessage.feedback]: cannot access "192.168.0.3":6767
   at com/ms/security/permissions/NetIOPermission.check
   at com/ms/security/PolicyEngine.deepCheck
   at com/ms/security/PolicyEngine.checkPermission
   at com/ms/security/StandardSecurityManager.chk
   at com/ms/security/StandardSecurityManager.chkex
   at com/ms/security/StandardSecurityManager.checkConnect
   at java/net/DatagramSocket.send
   at JIMMessage.feedback
   at JIMEnter.actionPerformed
   at java/awt/Button.processActionEvent
   at java/awt/Button.processEvent
   at java/awt/Component.dispatchEventImpl
   at java/awt/Component.dispatchEvent
   at java/awt/EventDispatchThread.run
//**********************************************//
If you can tell me,I would send all my points!Thank you!

0
Comment
Question by:coffeetea
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 1

Accepted Solution

by:
tonus earned 200 total points
ID: 6209724
Applet can communicate only to the server from which it is loaded. Because of client side security features, You are not allowed to access any other resources from the applet.
   Otherwise you have to grant permissions in the client side by manipulating the policy file located at
C:\Program Files\JavaSoft\JRE\1.3.0_02\lib\security\java.policy (if the browser uses jre plug-in) or you got sign the applet.
0
 

Expert Comment

by:sobhan_genie
ID: 6213669
What tonus said is correct I guess in addition to it these are the lines u have to add in the java.policy file

// allows anyone to listen on un-privileged ports
permission java.net.SocketPermission "localhost:1024-, "listen";

              This says on local host applets can listen on to any ports >= 1024. If you want it to be only 1024 then remove the - suffix.


// allows anyone to listen on un-privileged ports
permission java.net.SocketPermission "172.20.34.148:1729", "listen,accept,connect";

            The same thing above if you are about to access a remote machine you have to do this.

             Hope this helps.
bye,
Sobhan

0
 

Author Comment

by:coffeetea
ID: 6215073
Thank for your answer!I'll send all my points to you!
But now I have 70 points only,so I'm about to send 50 points to tonus ,and I'll send another 50 points to
sobhan_genie later!Thanks!
0
 

Author Comment

by:coffeetea
ID: 6230058
Dear sobhan_genie :
   I have 50 points,but I don't know how to send to you!
It's seemed that there is no way to send points again!  
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This video teaches viewers about errors in exception handling.
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question