Solved: Error enabling UPnPServer or Sonos on Subsonic 5.2
FYI - posting this in case it's useful to someone.
I was getting errors such as the below when enabling Sonos or UPnP support in Subsonic 5.2. My setup is slightly odd as I'm running Subsonic in a FreeBSD Jail, but this may apply if you are having issues with binding UPnP to a particular address.
I fixed this by editing the subsonic start script (found in /usr/bin/subsonic) to add an extra argument to the java command to tell the UPnP library used by Subsonic which interface(s) to bind to:
where 192.168.1.1 is the address of the interface you want Subsonic to serve UPnP requests from. (This can be a comma separated list of addresses).
Full java command showing where I added the extra line:
I was getting errors such as the below when enabling Sonos or UPnP support in Subsonic 5.2. My setup is slightly odd as I'm running Subsonic in a FreeBSD Jail, but this may apply if you are having issues with binding UPnP to a particular address.
- Code: Select all
ava.lang.NullPointerException
at net.sourceforge.subsonic.service.UPnPService.getSonosControllerHosts(UPnPService.java:174)
at net.sourceforge.subsonic.service.SonosService.setMusicServiceEnabled(SonosService.java:166)
at net.sourceforge.subsonic.controller.SonosSettingsController.handleParameters(SonosSettingsController.java:85)
at net.sourceforge.subsonic.controller.SonosSettingsController.handleRequestInternal(SonosSettingsController.java:51)
I fixed this by editing the subsonic start script (found in /usr/bin/subsonic) to add an extra argument to the java command to tell the UPnP library used by Subsonic which interface(s) to bind to:
- Code: Select all
-Dorg.fourthline.cling.network.useAddresses=192.168.1.1 \
where 192.168.1.1 is the address of the interface you want Subsonic to serve UPnP requests from. (This can be a comma separated list of addresses).
Full java command showing where I added the extra line:
- Code: Select all
${JAVA} -Xmx${SUBSONIC_MAX_MEMORY}m \
-Dsubsonic.home=${SUBSONIC_HOME} \
-Dsubsonic.host=${SUBSONIC_HOST} \
-Dsubsonic.port=${SUBSONIC_PORT} \
-Dsubsonic.httpsPort=${SUBSONIC_HTTPS_PORT} \
-Dsubsonic.contextPath=${SUBSONIC_CONTEXT_PATH} \
-Dsubsonic.defaultMusicFolder=${SUBSONIC_DEFAULT_MUSIC_FOLDER} \
-Dsubsonic.defaultPodcastFolder=${SUBSONIC_DEFAULT_PODCAST_FOLDER} \
-Dsubsonic.defaultPlaylistFolder=${SUBSONIC_DEFAULT_PLAYLIST_FOLDER} \
-Djava.awt.headless=true \
-Dorg.fourthline.cling.network.useAddresses=192.168.1.1 \
-verbose:gc \
-jar subsonic-booter-jar-with-dependencies.jar > ${LOG} 2>&1 &