Discussion Locked

Security Exception

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Dear all,

I am developing an wireless application using J2ME and NTT DoCoMo

I want to read one text file using HttpConnection, but it is throwing
"security exception" saying package URL mismatch.The code is like this.

HttpConnection hc
=(HttpConnection)Connector.open("http://perumal:80/values.csv");
InputStream is = hc.openInputStream();

The first line of the code is throwing exception. I have handled all the
exceptions. still I could not able to solve it.

I want your guidance in this regards

regards
peter

6 replies

by okujava

hi!

I would try to use

InputConnection ic=(InputConnection)Connector.open("http://perumal:80/values.csv");
InputStream is = ic.openInputStream();

regards,

s.okujava

by okujava

And why not the following:

InputStream is = Connector.openInputStream("http://perumal:80/values .csv"); ?

by charbell

One problem you have is the url string,
http://perumal:80/value s.csv

you have a space in the file name which is not supposed to be there.

http://perumal:80/values.csv

This discussion is closed to new replies.