commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kedar Panse" <ke...@bancbridge.com>
Subject RE: HttpClient : Sending Multipart request from applet
Date Mon, 19 Jun 2006 12:14:22 GMT
I assume this is the only code and no logging enabled?  From trace it looks
like its trying to log somewhere and don't have access. But I may be wrong

Kedar 

-----Original Message-----
From: shiv shankar [mailto:shiva_ibm@yahoo.com] 
Sent: Monday, June 19, 2006 5:30 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.<clinit>(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.<clinit>(LogFactory.java:1725)
	... 4 more

I have taken out the OutputStream stuff. 

R.Shiv Shankar



--- Kedar Panse <kedar@bancbridge.com> 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




---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message