java - JNLP + proxy + downloading file via stream problem -
i'm writing application downloading csv file web , inserting data table in database. problem need setup proxy via system.setproperty("http.proxyhost", "http-proxy.domain.com");
, on. application works fine when i'm running on local system, problem when launch jnlp. @ first have had problems signing jars (i've managed it, somehow) , i'm facing problem, application running, not connect web - throws exception message "connection timeout: connect".
jnlp file looks this:
<?xml version="1.0" encoding="utf-8" standalone="no"?> <jnlp href="launch.jnlp" spec="1.0+"> <information> <title>testimporter</title> <vendor>hol</vendor> <homepage href=""/> <description>testimporter</description> <description kind="short">testimporter</description> </information> <update check="always"/> <security> <all-permissions/> </security> <resources> <j2se version="1.6+"/> <jar href="testimporter.jar" main="true"/> <jar href="lib/ojdbc14.jar"/> <jar href="lib/mail.jar"/> </resources> <application-desc main-class="cz.test.importer"> </application-desc> </jnlp>
i'm connecting file code:
urlconnection yc = cnb.openconnection(); bufferedreader in = new bufferedreader( new inputstreamreader( yc.getinputstream()));
thanks in advance help!
you can try wrap code in doprivileged block. check 1 out:
http://download.oracle.com/javase/1.4.2/docs/api/java/security/accesscontroller.html
if after implementing it, code still fails, maybe make sense paste logs java console.
Comments
Post a Comment