Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 45583 invoked from network); 19 Jun 2006 12:36:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 19 Jun 2006 12:36:17 -0000 Received: (qmail 89895 invoked by uid 500); 19 Jun 2006 12:36:02 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 89831 invoked by uid 500); 19 Jun 2006 12:36:01 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 89819 invoked by uid 99); 19 Jun 2006 12:36:00 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Jun 2006 05:36:00 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [68.142.200.237] (HELO smtp102.biz.mail.mud.yahoo.com) (68.142.200.237) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 19 Jun 2006 05:35:56 -0700 Received: (qmail 42219 invoked from network); 19 Jun 2006 12:28:41 -0000 Received: from unknown (HELO SIBISOFTTahir) (tahir@spectrum-tech.com@202.141.252.246 with login) by smtp102.biz.mail.mud.yahoo.com with SMTP; 19 Jun 2006 12:28:40 -0000 From: "Tahir Akhtar" To: "'Jakarta Commons Users List'" Subject: RE: HttpClient : Sending Multipart request from applet Date: Mon, 19 Jun 2006 17:29:29 +0500 MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1250" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.5510 In-Reply-To: <20060619115934.81286.qmail@web30010.mail.mud.yahoo.com> Thread-Index: AcaTl/U2bcWaLk+/SSuNUG3TV4UYAwAASeVA X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 X-Virus-Checked: Checked by ClamAV on apache.org Message-Id: <20060619123600.784FC10FB001@asf.osuosl.org> X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N It looks like Access control exception occurs when HTTPClient tries to open a local file for logging. Try to confirm by disabling the logging. -----Original Message----- From: shiv shankar [mailto:shiva_ibm@yahoo.com] Sent: Monday, June 19, 2006 5:00 PM To: Jakarta Commons Users List Subject: RE: HttpClient : Sending Multipart request from applet Hello Kedar, Let me put in this way, Below is a applet where I have given the statemnt PostMethod pMethod = new PostMethod(targetUrl); public class FileStreamApplet extends Applet { public void init() { try { String targetURL = "http://localhost:8080/echo/echo"; PostMethod filePost = new PostMethod(targetURL); } catch(Exception e) { e.printStackTrace(); } } } I have complied and signed this applet , It is giving me the following exception java.lang.ExceptionInInitializerError at org.apache.commons.httpclient.HttpMethodBase.(HttpMethodBase.java:10 2) at FileStreamApplet.init(FileStreamApplet.java:21) at sun.applet.AppletPanel.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission org.apache.commons.logging.LogFactory.HashtableImpl read) at java.security.AccessControlContext.checkPermission(Unknown Source) at java.security.AccessController.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPropertyAccess(Unknown Source) at java.lang.System.getProperty(Unknown Source) at org.apache.commons.logging.LogFactory.createFactoryStore(LogFactory.java:320 ) at org.apache.commons.logging.LogFactory.(LogFactory.java:1725) ... 4 more I have taken out the OutputStream stuff. R.Shiv Shankar --- Kedar Panse wrote: > OutputStream oc = new > FileOutputStream("c:/shiv/filewrite.txt"); > You may need to add this file in to acl for reading > > http://java.sun.com/sfaq/#read > > > > > Kedar > > -----Original Message----- > From: shiv shankar [mailto:shiva_ibm@yahoo.com] > Sent: Monday, June 19, 2006 3:57 PM > To: commons-user@jakarta.apache.org > Subject: HttpClient : Sending Multipart request from > applet > > Hello all, > > > I need help on the httpclient . I have used this api > in a JFrame and sending > mutipart request to servlet, which is doing a fine > job of uploading the the > file. > > > But when the same is done using applet, it is gving > me > > > java.Security.AccessConlroleException. > > The problem come when it process a statement > > PostMethod pMethod = new PostMethod(url); > > The following is a small program.Which I tred to > execute and giving me > lava.security.AccesscontroleException EVEN AFTER > SIGNING THE APPLET > > > > import java.io.*; > import java.awt.*; > import java.applet.*; > > import org.apache.commons.httpclient.HttpClient; > import org.apache.commons.httpclient.HttpStatus; > import > org.apache.commons.httpclient.methods.PostMethod; > import > org.apache.commons.httpclient.methods.multipart.FilePart; > import > org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity; > import > org.apache.commons.httpclient.methods.multipart.Part; > import > org.apache.commons.httpclient.params.HttpMethodParams; > > > public class FileStreamApplet extends Applet { > > public void init() { > > try { > > String targetURL = > "http://localhost:8080/echo/echo"; > PostMethod filePost = new > PostMethod(targetURL); > > > System.out.println("Hello from FileStream > Applet"); > Label l1 = new Label("Write into file using > applet"); > this.add(l1); > OutputStream oc = new > FileOutputStream("c:/shiv/filewrite.txt"); > oc.write("Welcome to eriting a > applet".getBytes()); > oc.close(); > Label l = new Label("Write into file using > applet"); > this.add(l); > > > } > catch(Exception e) { > e.printStackTrace(); > } > > } > } > > > > > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam > protection around > http://mail.yahoo.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: > commons-user-help@jakarta.apache.org > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: > commons-user-help@jakarta.apache.org > > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.9.0/368 - Release Date: 6/16/2006 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.9.0/368 - Release Date: 6/16/2006 --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org