Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate to jupnp (previously cannot upgrade to cling 2.1.2) #74

Open
courville opened this issue Mar 20, 2019 · 16 comments
Open

migrate to jupnp (previously cannot upgrade to cling 2.1.2) #74

courville opened this issue Mar 20, 2019 · 16 comments

Comments

@courville
Copy link
Contributor

Issue is similar to 4thline/cling#164 that should have been fixed.
No device discovered on Android.

@courville
Copy link
Contributor Author

Perhaps time to switch to https://github.com/jupnp/jupnp

@courville
Copy link
Contributor Author

jupnp switch is not possible since it does not contain any AndroidUpnpServiceImpl.
Yes I did all the modifications sed -i "s/org.fourthline.cling/org.jupnp/g"

@courville
Copy link
Contributor Author

courville commented May 5, 2020

Compilation done using java8
Add in pom.xml <additionalparam>--allow-script-in-comments</additionalparam> in javadoc

diff --git a/pom.xml b/pom.xml
index be885ea..81f0c90 100644
--- a/pom.xml
+++ b/pom.xml
@@ -161,6 +161,7 @@
                     <configuration>
                         <quiet>true</quiet>
                         <additionalparam>-Xdoclint:none</additionalparam>
+                       <additionalparam>--allow-script-in-comments</additionalparam>
                     </configuration>
                 </plugin>

Need to install also android sdk 15 via Android Studio it is the easiest or /opt/android-sdk/tools/bin/sdkmanager "platforms;android-15"

JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 mvn install -rf :cling-support
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 mvn install -rf :cling-support

@courville
Copy link
Contributor Author

courville commented May 5, 2020

On macOS:

brew tap adoptopenjdk/openjdk
brew cask install adoptopenjdk8
JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home mvn install

@courville
Copy link
Contributor Author

Note that hosts visible are due to:

05-05 19:53:53.819 17645 17845 W trieveRemoteDescriptors: Could not hydrate device or its services from descriptor: (RemoteDevice) Identity: (RemoteDeviceIdentity) UDN: uuid:00113228-8879-0011-7988-798828321100, Descriptor: http://192.168.0.2:50001/desc/device.xml, Root: true
05-05 19:53:53.819 17645 17845 W trieveRemoteDescriptors: Cause was: org.xml.sax.SAXNotRecognizedException: http://apache.org/xml/features/disallow-doctype-decl

@courville
Copy link
Contributor Author

See 4thline/cling#247

@courville
Copy link
Contributor Author

courville commented May 5, 2020

Thus this is a seamless issue 4thline/seamless@74e6678
Reverting this one makes cling happy.

@courville
Copy link
Contributor Author

In order to work Medialib needs:

    api files('libs/cling-core-2.1.2.jar');
    implementation files('libs/cling-support-2.1.2.jar');
    implementation files('libs/seamless-util-1.1.2.jar');
    implementation files('libs/seamless-http-1.1.2.jar');
    implementation files('libs/seamless-xml-1.1.2.jar');

courville added a commit to nova-video-player/seamless that referenced this issue May 5, 2020
@courville
Copy link
Contributor Author

v4-jcifsng.xml is now using cling 2.1.2

@courville
Copy link
Contributor Author

For jupnp migration see UniversalMediaServer/UniversalMediaServer#2789

@courville
Copy link
Contributor Author

Tentative migration to jupnp ongoing in dev/jupnp branches.
See jupnp/jupnp#144 preventing 2.7.0 usage.
See jupnp/jupnp#153 for loss of Android turnkey replacement.

@courville courville reopened this May 4, 2023
@courville courville changed the title cannot upgrade to cling 2.1.2 migrate to jupnp (previously cannot upgrade to cling 2.1.2) May 4, 2023
@courville
Copy link
Contributor Author

Note that I tried to find an open-source Android app using jupnp and so far I failed: all apps listed on f-droid are still using cling.

courville added a commit to nova-video-player/cling that referenced this issue May 5, 2023
use UDA10ServiceDescriptorBinderImpl instead of UDA10ServiceDescriptorBinderSAXImpl in AndroidUpnpServiceConfiguration

See 4thline#247

See nova-video-player/aos-AVP#74
courville added a commit to nova-video-player/aos-MediaLib that referenced this issue Feb 18, 2024
@Dedesese1990
Copy link

I search for online subtitles and found what I need but when i selected it not loading in the list ...

@courville
Copy link
Contributor Author

jupnp has been reverted in latest release to get around the following error playing multiple files (it works only with first one):

com.archos...pRawLister org.courville.nova W  failure on (ActionInvocation) (Action, Arguments: 10) Browse response 500 Internal Server Error, Error: Error reading SOAP response message. Can't transform message payload (HTTP response was: 500 Internal Server Error)
2024-04-2

Tested that jupnp fix suggested in jupnp/jupnp#232 makes it work:

diff --git a/bundles/org.jupnp/src/main/java/org/jupnp/transport/impl/PooledXmlProcessor.java b/bundles/org.jupnp/src/main/java/org/jupnp/transport/impl/PooledXmlProcessor.java
index f169d2df..c5ce69e1 100644
--- a/bundles/org.jupnp/src/main/java/org/jupnp/transport/impl/PooledXmlProcessor.java
+++ b/bundles/org.jupnp/src/main/java/org/jupnp/transport/impl/PooledXmlProcessor.java
@@ -134,6 +134,8 @@ public abstract class PooledXmlProcessor {

     private void returnBuilder(DocumentBuilder builder) throws FactoryConfigurationError, ParserConfigurationException {
         builder.reset();
-        builderPool.add(builder);
+        if (builder.isNamespaceAware()) {
+            builderPool.add(builder);
+        }
     }
 }

Waiting for proper jupnp release to make a nova release with this workaround if approved by maintainer.

courville added a commit to nova-video-player/aos-MediaLib that referenced this issue May 7, 2024
Fixes cannot play two different files in a row.

See nova-video-player/aos-AVP#74
See jupnp/jupnp#232
@courville
Copy link
Contributor Author

Latest version of jupnp fixes the problem.
However I get on sentry these reports:

java.lang.NoClassDefFoundError: org.eclipse.jetty.io.SelectorManager$$ExternalSyntheticLambda1
    at org.eclipse.jetty.io.SelectorManager.<init>(SourceFile:100)
    at org.eclipse.jetty.server.ServerConnector$ServerConnectorManager.<init>(SourceFile:532)
    at org.eclipse.jetty.server.ServerConnector.newSelectorManager(SourceFile:227)
    at org.eclipse.jetty.server.ServerConnector.<init>(SourceFile:220)
    at org.eclipse.jetty.server.ServerConnector.<init>(SourceFile:94)
    at org.jupnp.transport.impl.jetty.JettyServletContainer.addConnector(SourceFile:65)
    at org.jupnp.transport.impl.ServletStreamServerImpl.init(SourceFile:61)
    at org.jupnp.transport.RouterImpl.startAddressBasedTransports(SourceFile:403)
    at org.jupnp.transport.RouterImpl.enable(SourceFile:127)
    at org.jupnp.android.AndroidRouter.enable(SourceFile:88)
    at org.jupnp.UpnpServiceImpl.startup(SourceFile:263)
    at com.archos.mediacenter.filecoreextension.upnp2.UpnpServiceManager$2.onServiceConnected(SourceFile:274)
    at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1244)
    at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1261)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:148)
    at android.app.ActivityThread.main(ActivityThread.java:5431)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:810)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

Perhaps this is due to using an older version of jetty in order to not target API26:

    api 'org.jupnp:org.jupnp:3.0.2'
    api 'org.jupnp:org.jupnp.support:3.0.2'
    api 'org.jupnp:org.jupnp.android:3.0.2'
    // jetty required by jupnp and going above 9.4.14 requires minSdkVersion 26
    implementation ('org.eclipse.jetty:jetty-server:9.4.14.v20181114') {
        exclude group: 'org.eclipse.jetty.orbit', module: 'javax.servlet'
    }
    implementation ('org.eclipse.jetty:jetty-servlet:9.4.14.v20181114') {
        exclude group: 'org.eclipse.jetty.orbit', module: 'javax.servlet'
    }
    implementation ('org.eclipse.jetty:jetty-client:9.4.14.v20181114') {
        exclude group: 'org.eclipse.jetty.orbit', module: 'javax.servlet'
    }

Reverting for now to old cling until it is figured out.

@courville
Copy link
Contributor Author

Seems that there are still two issues reported to sentry when deployed on user base:

Need to solve these before switching to jupnp.
Check release 6.2.79 and 6.2.81 errors: there is a bump new issues (279).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants