[問題]有關在html檔用Applet執行Jmail的問題

看板java作者 (歐尼)時間16年前 (2009/11/19 04:49), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串1/2 (看更多)
小弟我寫一個程式是利用jmail做收信寄信 想要將程式用applet結合在html的網頁裡 該網頁是一個需登入的留言版 jmail程式的主要功能就是 有人登入留言時,就將該留言用pchome的帳號寄到相關群組成員的信箱 群組成員的信箱是用該登入留言者的帳號去資料庫作搜尋而得知 目前程式compile沒問題 但是用appletviewer去檢視嵌入程式的html檔時 會顯示applet載入並啟動 但是仍有錯誤訊息產生 訊息內容如下: java.security.AccessControlException: access denied (java.net.SocketPermission smtp.pchome.com.tw resolve) at java.security.AccessControlContext.checkPermission (AccessControlContext.java:264) at java.security.AccessController.checkPermission(AccessController.java:427) at java.lang.SecurityManager.checkPermission(SecurityManager.java:532) at java.lang.SecurityManager.checkConnect(SecurityManager.java:1031) at java.net.InetAddress.getAllByName0(InetAddress.java:1117) at java.net.InetAddress.getAllByName0(InetAddress.java:1098) at java.net.InetAddress.getAllByName(InetAddress.java:1061) at java.net.InetAddress.getByName(InetAddress.java:958) at java.net.InetSocketAddress.<init>(InetSocketAddress.java:124) at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:267) at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:227) at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1511) at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:453) at javax.mail.Service.connect(Service.java:291) at javax.mail.Service.connect(Service.java:172) at test.init(test.java:85) at sun.applet.AppletPanel.run(AppletPanel.java:378) at java.lang.Thread.run(Thread.java:595) 小弟到google上查詢相關資訊 只得知似乎是某種權限問題 需要在C:\Program Files\Java\jre1.6.0_07\lib\security\java.policy 的檔案中做某些修改 但對所搜尋到的可能解決問題之方法皆試過 但都無法解決 所以請板上的高手提供寶貴的意見 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 124.11.143.135

11/19 08:01, , 1F
精華區的 5-2-4 或 5-2-8
11/19 08:01, 1F
文章代碼(AID): #1B15t0k2 (java)
文章代碼(AID): #1B15t0k2 (java)