Page 1 of 1

Cannot create instance of SOAP MessageFactory

PostPosted: Thu Dec 27, 2018 9:51 am
by NuttBoxer
I'm not able to connect to serviio from my blu-ray anymore, not sure if this is the cause:
  Code:
2018-12-27 09:07:04,661 ERROR [SOAPMessageParser] Cannot create instance of SOAP MessageFactory
javax.xml.soap.SOAPException: Unable to create message factory for SOAP: Unable to create SAAJ meta-factory: Provider com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl not found
   at javax.xml.soap.MessageFactory.newInstance(MessageFactory.java:120)
   at org.serviio.upnp.protocol.soap.SOAPMessageParser.<clinit>(SOAPMessageParser.java:35)
   at org.serviio.upnp.protocol.soap.ServiceInvoker.invokeService(ServiceInvoker.java:70)
   at org.serviio.upnp.webserver.ServiceControlRequestHandler.handleRequest(ServiceControlRequestHandler.java:65)
   at org.serviio.upnp.webserver.AbstractRequestHandler.handle(AbstractRequestHandler.java:66)
   at org.apache.http.protocol.HttpService.doService(HttpService.java:423)
   at org.serviio.upnp.webserver.ServiioHttpService.doService(ServiioHttpService.java:78)
   at org.apache.http.protocol.HttpService.handleRequest(HttpService.java:341)
   at org.serviio.upnp.webserver.WebServer$WorkerThread.run(WebServer.java:204)

  Code:
2018-12-27 08:52:19,411 INFO  [MediaServer] ------------------------------------------------------------------------
2018-12-27 08:52:19,411 INFO  [MediaServer] Serviio DLNA media streaming server v 1.10.1 (rev. 3e5b0ba57122)
2018-12-27 08:52:19,412 INFO  [MediaServer] Petr Nejedly 2009-2018
2018-12-27 08:52:19,412 INFO  [MediaServer] http://www.serviio.org
2018-12-27 08:52:19,412 INFO  [MediaServer]
2018-12-27 08:52:19,412 INFO  [MediaServer] Java 10.0.2-Oracle Corporation amd64
2018-12-27 08:52:19,412 INFO  [MediaServer] OS Linux 4.15.0-43-generic
2018-12-27 08:52:19,412 INFO  [MediaServer] File encoding: UTF-8
2018-12-27 08:52:19,413 INFO  [MediaServer] Headless mode enabled: true
2018-12-27 08:52:19,413 INFO  [MediaServer] User: serviio
2018-12-27 08:52:19,413 INFO  [MediaServer] User home dir: /home/serviio
2018-12-27 08:52:19,413 INFO  [MediaServer] Temp dir: /tmp
2018-12-27 08:52:19,413 INFO  [MediaServer] ------------------------------------------------------------------------

  Code:
● serviio.service - Serviio Media Server
   Loaded: loaded (/lib/systemd/system/serviio.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2018-12-27 09:34:02 UTC; 15min ago
  Process: 5714 ExecStop=/opt/serviio/bin/serviio.sh -stop (code=exited, status=0/SUCCESS)
 Main PID: 5776 (java)
    Tasks: 120 (limit: 3973)
   CGroup: /system.slice/serviio.service
           └─5776 java --add-modules jdk.unsupported -Xmx512M -Xms20M -XX:+UseG1GC -XX:GCTimeRatio=1 -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -Djava.net.preferIPv4Stack=true -Djava.awt.headless=tru

Dec 27 09:48:27 carmona serviio.sh[5776]:         at org.serviio.upnp.webserver.WebServer$WorkerThread.run(WebServer.java:204)
Dec 27 09:48:27 carmona serviio.sh[5776]: Exception in thread "Thread-1107" java.lang.NullPointerException
Dec 27 09:48:27 carmona serviio.sh[5776]:         at org.serviio.upnp.protocol.soap.SOAPMessageParser.parseSOAPMessage(SOAPMessageParser.java:48)
Dec 27 09:48:27 carmona serviio.sh[5776]:         at org.serviio.upnp.protocol.soap.ServiceInvoker.invokeService(ServiceInvoker.java:70)
Dec 27 09:48:27 carmona serviio.sh[5776]:         at org.serviio.upnp.webserver.ServiceControlRequestHandler.handleRequest(ServiceControlRequestHandler.java:65)
Dec 27 09:48:27 carmona serviio.sh[5776]:         at org.serviio.upnp.webserver.AbstractRequestHandler.handle(AbstractRequestHandler.java:66)
Dec 27 09:48:27 carmona serviio.sh[5776]:         at org.apache.http.protocol.HttpService.doService(HttpService.java:423)
Dec 27 09:48:27 carmona serviio.sh[5776]:         at org.serviio.upnp.webserver.ServiioHttpService.doService(ServiioHttpService.java:78)
Dec 27 09:48:27 carmona serviio.sh[5776]:         at org.apache.http.protocol.HttpService.handleRequest(HttpService.java:341)
Dec 27 09:48:27 carmona serviio.sh[5776]:         at org.serviio.upnp.webserver.WebServer$WorkerThread.run(WebServer.java:204)

Re: Cannot create instance of SOAP MessageFactory

PostPosted: Sun Dec 30, 2018 1:51 am
by NuttBoxer
This is actually affecting both of my devices that connect to serviio. The blu-ray is older and doesn't see serviio at all. The TV is newer and does see it, but when I click on the icon, just shows a loading animation, and never connects. I did see an older post that seems to indicate it could be an issue with my Java install, but would like confirmation before I start stabbing somewhat blindly for a solution.

Re: Cannot create instance of SOAP MessageFactory

PostPosted: Sun Dec 30, 2018 4:56 pm
by zip
It's due to Java 10, try running with Java 8. Although I thought this was fixed in 1.10.1. You could also try Java 11.

Re: Cannot create instance of SOAP MessageFactory

PostPosted: Sun Dec 30, 2018 6:05 pm
by NuttBoxer
Ok. I wondered about that, but kind of thought the same thing, that Java 10 was working even though official documentation says to use 8.

Re: Cannot create instance of SOAP MessageFactory

PostPosted: Sun Dec 30, 2018 7:04 pm
by NuttBoxer
Installed 8 and tried changing the version in the serviio.sh file but either that's not the right place, or I did it wrong, still getting 10 as version serviio is loading.

  Code:
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
    [ -n "$SERVIIO_HOME" ] &&
        SERVIIO_HOME=`cygpath --unix "$SERVIIO_HOME"`
    [ -n "$JAVA_HOME" ] &&
        JAVA_HOME=`/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java "$JAVA_HOME"`

Re: Cannot create instance of SOAP MessageFactory

PostPosted: Mon Dec 31, 2018 12:57 am
by atc98092
NuttBoxer wrote:Installed 8 and tried changing the version in the serviio.sh file but either that's not the right place, or I did it wrong, still getting 10 as version serviio is loading.

  Code:
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
    [ -n "$SERVIIO_HOME" ] &&
        SERVIIO_HOME=`cygpath --unix "$SERVIIO_HOME"`
    [ -n "$JAVA_HOME" ] &&
        JAVA_HOME=`/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java "$JAVA_HOME"`


You have to switch it at the OS level. When I was experimenting with Mint, I had the same issue. Do a search on the web for changing the default Java version in Linux and you should find the command string pretty fast.

Re: Cannot create instance of SOAP MessageFactory

PostPosted: Mon Dec 31, 2018 1:54 am
by NuttBoxer
In that case seems like I should just un-install 10. I thought there was a way to run everything else on 10 and just serviio on 8.

Re: Cannot create instance of SOAP MessageFactory

PostPosted: Mon Dec 31, 2018 2:27 am
by atc98092
I don't think so, but then I'm no expert on Linux. :)

Re: Cannot create instance of SOAP MessageFactory

PostPosted: Mon Dec 31, 2018 3:13 am
by NuttBoxer
Neither am I, but seems like there would be a way to choose a jre version in the Serviio settings somewhere.

Thinking about it, if I remove 10, it's just going to change again when I update the server, so keeping both does make more sense. Pointed Ubuntu over to 8, stopped and started the service, and everything is back up and running.

I kind of suspected 10 might be the issue as I think it was installed on the updates I ran right before serviio stopped working, but wanted to ask instead of just assuming. Appreciate everyone's help!

Re: Cannot create instance of SOAP MessageFactory

PostPosted: Mon Dec 31, 2018 11:56 am
by zip
you should be able to run many versions of Java on your OS.

Just set

  Code:
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre


either earlier in the serviio.sh file, or export it in your shell before running servio.sh

Re: Cannot create instance of SOAP MessageFactory

PostPosted: Wed May 22, 2019 8:20 pm
by kairoh
Just change one line in serviio.sh

  Code:
case "$JAVA_VERSION" in
    \1.8*) JAVA9_OPTS="" ;;
    *) JAVA9_OPTS="--add-modules jdk.unsupported" ;;
esac


to

  Code:
case "$JAVA_VERSION" in
    \1.8*) JAVA9_OPTS="" ;;
    *) JAVA9_OPTS="--add-modules java.xml.ws" ;;
esac


This works with java 9 and should work newer version.

Explanation : starting from java 9, JVM was cut in many modules.
Some of them aren't loaded by default, like SOAP webservice (java.xml.ws).
This option force to load this module.