Page 1 of 1

[SOLVED]Potential problem with JAVA implementation in M6

PostPosted: Jul 25th, '17, 17:54
by mackowiakp
I wrote small script to cloning PC screen to Apple TV. It uses ready JAVA based program named "airplay.jar" from here https://github.com/jamesdlow/open-airplay
It worked properly in M5, but after upgrade to M6, this program rapports an errors listed below:

Code: Select all
[maciek@Piotr Pobrane]$ java -jar airplay.jar -h apple-tv -d
Press ctrl-c to quit
java.io.IOException: Server returned HTTP response code: 403 for URL: http://apple-tv:7000/photo
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1926)
        at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1921)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1920)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1490)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
        at com.jameslow.AirPlay.doHTTP(Unknown Source)
        at com.jameslow.AirPlay.doHTTP(Unknown Source)
        at com.jameslow.AirPlay.photoRaw(Unknown Source)
        at com.jameslow.AirPlay$PhotoThread.run(Unknown Source)
Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL: http://apple-tv:7000/photo
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1876)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
        at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
        ... 4 more


I know, airplay.jar is not something supported by Mageia but I think that it is Mageis 6 related problem (JAVA installation) , similar to topic https://forums.mageia.org/en/viewtopic.php?f=7&t=11842&p=69134#p69134

Any idea how to resolve that problem? Any workaround just like in topic listed above?

Re: Potential problem with JAVA implementation in M6

PostPosted: Jul 26th, '17, 13:14
by doktor5000
What do you get with e.g.
Code: Select all
curl -Lv http://apple-tv:7000/photo

Re: Potential problem with JAVA implementation in M6

PostPosted: Jul 26th, '17, 13:26
by mackowiakp
Thats output. But - as i wrote - it works correctly on M5 based my wife PC.

Code: Select all
[maciek@Piotr ~]$ curl -Lv http://apple-tv:7000/photo
*   Trying 192.168.0.10...
* TCP_NODELAY set
* Connected to apple-tv (192.168.0.10) port 7000 (#0)
> GET /photo HTTP/1.1
> Host: apple-tv:7000
> User-Agent: curl/7.54.1
> Accept: */*
>
< HTTP/1.1 403 Forbidden
< Content-Length: 0
< Server: AirTunes/320.20.1
<
* Connection #0 to host apple-tv left intact

Re: Potential problem with JAVA implementation in M6

PostPosted: Jul 27th, '17, 08:59
by doktor5000
mackowiakp wrote:But - as i wrote - it works correctly on M5 based my wife PC.

Code: Select all
< HTTP/1.1 403 Forbidden


You're repeating yourself, and that does not matter if it works for any other box.
This computer get's an HTTP 403 Forbidden status returned by the Apple TV webserver, that is your issue. This doesn't have anything to do with mga6 or java.

Re: Potential problem with JAVA implementation in M6

PostPosted: Jul 27th, '17, 09:31
by mackowiakp
THX. I will raport issue on airply.jar github

Re: [DONE]Potential problem with JAVA implementation in M6

PostPosted: Jul 28th, '17, 13:11
by mackowiakp
You are right. This is common problem after upgrade tvOS to ver 10.2.2. So airplay.jar must be inspected.

Re: [DONE]Potential problem with JAVA implementation in M6

PostPosted: Sep 20th, '17, 09:03
by mackowiakp
After today upgrade to tvOS ver 11 on Apple TV, everything works perfectly, using the same script. The only modigication in adding to criptremoveing og TCPv5 support because the same Apple unit was display in secelct window two times. One for ver 4 and another for ver 6.
Topic closed.