I am currently working with apache commons in my Project to gain access to my FTP Server.
Uploading a file is no problem at all, but If I want to download a file, I get an UnknownHost Exception what is strange because it is the same ftp server.
client.connect("ftp.liamissimo.li.ohost.de",21);
client.login("XXX", "XXX");
client.enterLocalPassiveMode();
This code works like this for uploading, but if I use it to download I got an UnknownHost exception.
I had a problem like this and I got it to work by using the IP of the hostname instead of the actual hostname...
check permissions in manifest file.
uses-permission android:name="android.permission.INTERNET"/>
Related
I'm trying to connect to Ant media webrtc server wss://abcd.com:1234/demoApp/websocket. However it always throws.
de.tavendo.autobahn.WebSocketReader: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
de.tavendo.autobahn.WebSocketWriter: Socket is closed
I'm using ant media webrtc framework sample android example and changing the URL. It worked fine with test server of antmedia
wss://test.antmedia.io:5443/demo1234/websocket(URL changed for security purposes)
However I was never able to connect to the main server. This is the code at android which I'm using to connect with server.
webRTCClient = WebRTCClient(this#LiveSessionActivity, this)
webRTCClient.setVideoRenderers(mLiveSessionBinding?.pipViewRenderer, mLiveSessionBinding?.localGLSurfaceView)
webRTCClient.init(ANT_MEDIA_URL, mLiveSessionViewModel?.streamKey, IWebRTCClient.MODE_PUBLISH, "null", intent)
Any help is much appreciated. Thanks!
It's known issue in v2.2.1. You need to set chain.pem file to Ant Media Server. Here are the instructions:
Copy chain.pem to conf.
sudo cp /etc/letsencrypt/live/your_domain/chain.pem /usr/local/antmedia/conf
PS: Please change your_domain to your domain address.
1- Add this line
http.ssl_certificate_chain_file=conf/chain.pem
after
http.ssl_certificate_file=conf/fullchain.pem
in /usr/local/antmedia/conf/red5.properties file.
2- Add this line
<entry key="SSLCertificateChainFile" value="${http.ssl_certificate_chain_file}" />
after
<entry key="SSLCertificateFile" value="${http.ssl_certificate_file}" />
in /usr/local/antmedia/conf/jee-container.xml file
I am trying to send post request to a website with port configured. http://example.com:8080/. When i send the request, it show some error
http.post('example.com:8080/apps/api.php', body: {'name': 'doodle', 'color': 'blue'}).then((response) {
print(response);
});
Unhandled Exception: SocketException: Failed host lookup: 'example.com' (OS Error: No address associated with hostname, errno = 7)
The port is ignored there. Is there any way i can do to fix this? Or is there any other http library that i can use?
This is probably not a port issue. Make sure you set the correct permissions in the Android manifest file (android/app/src/main/AndroidManifest.xml) to be able to make HTTP calls from your Android app:
<uses-permission android:name="android.permission.INTERNET" />
More details on that here and the official documentation from Android on permissions here.
If you have added this line
<uses-permission android:name="android.permission.INTERNET" />
at android/app/src/main/AndroidManifest.xml
then try restarting emulator or computer itself.
In my case, I restarted my laptop and it was fine. Most of the times restarting computer will solve the problems like this.
Error 1:
Failed to fetch URL http://dl-ssl.google.com/android/repository/addons_list-2.xml, reason: Unknown Host www.google.de
Error 2:
Failed to fetch URL http://dl-ssl.google.com/android/repository/repository-10.xml, reason: IO Unknown Host www.google.de
Can I download and insert this xml files manually?
Are then this problems solved?
There are some people who has posted about downloading SDK tools without SDK manager.
Like in this site.
But you should check your internet connection. I have same problem but after that i came to know that it was because of bad internet connection.
I have retried it and it was downloaded successfully.
I encountered the same problem and here is what I did to solve the problem.
Since I use proxy server for accessing internet i have edited the file
"C:\Users\.AndroidStudio\config\options\other.xml" as
Notice the PROXY_HOST value there is no "http://" part, this is important. In my case when I insert that it did not work I did not know why.
2. I have edited the file
"C:\Users\\AppData\Local\Android\sdk\tools\android.bat"
I have changed the line at the end of android.bat file from
call "%java_exe% %REMOTE_DEBUG%" ....
to
call "%java_exe% **-Djava.net.preferIPv4Stack=true** %REMOTE_DEBUG%"...
Notice the value in bold
I've followed Amazon's Getting Started guide, and (after Exporting the Amazon library, increasing the heap size available to Eclipse and adding the necessary permissions to the application manifest), I now have the sample S3_UploaderActivity Android app running.
However, when I try to upload an image I get this error message on my device's screen:
Unable to execute HTTP request: Unable to resolve host
"my-unique-namexxxxxxxxxxxxxxxpicture-bucket.s3-us-west-2.amazonaws.com": No address associated with hostname
Although this wasn't mentioned in the Getting Started guide, I presumably need to change the "my-unique-name" and "picture-bucket" strings (the latter which is stored in a constant called PICTURE_BUCKET).
But what do I change these values to??
Did you add the internet permission to your manifest file ?
<uses-permission android:name="android.permission.INTERNET" />
am working https webservice and the certificate is self signed, so import this into my project and create bks file for overriding the error , but still i get SSLPeerUnverfiedException . I had also check with following so question HttpGet with HTTPS : SSLPeerUnverifiedException ,this also not help me
Have you tried this approach by bob lee: http://blog.crazybob.org/2010/02/android-trusting-ssl-certificates.html
It solved my issue