Page 1 of 1

Serviio Java Problem on DS214Play

PostPosted: Fri Oct 24, 2014 12:04 pm
by Nicostaf
Hi all, I'm Niko and i write from Italy.
i have the nas in object with DSM 5.0-4528.
I have installed java version "1.7.0_71" and serviio version 1.4.1.2-0026.
The serviio log file says:

2014-10-24 11:15:59,663 ERROR [ApplicationInstanceManager] DiskStation: DiskStat
java.net.UnknownHostException: DiskStation: DiskStation
at java.net.InetAddress.getLocalHost(InetAddress.java:1473)
at org.serviio.ApplicationInstanceManager.registerInstance(ApplicationIn
at org.serviio.MediaServer.checkForRunningInstances(MediaServer.java:283
at org.serviio.MediaServer.main(MediaServer.java:106)
Caused by: java.net.UnknownHostException: DiskStation
at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:901)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:129
at java.net.InetAddress.getLocalHost(InetAddress.java:1469)
... 3 more
2014-10-24 11:15:59,716 INFO [MediaServer] ------------------------------------
2014-10-24 11:15:59,716 INFO [MediaServer] Serviio DLNA media streaming server
2014-10-24 11:15:59,717 INFO [MediaServer] Petr Nejedly 2009-2014
2014-10-24 11:15:59,717 INFO [MediaServer] http://www.serviio.org
2014-10-24 11:15:59,717 INFO [MediaServer]
2014-10-24 11:15:59,717 INFO [MediaServer] Java 1.7.0_71-Oracle Corporation
2014-10-24 11:15:59,718 INFO [MediaServer] OS Linux i386 3.2.40
2014-10-24 11:15:59,718 INFO [MediaServer] File encoding: UTF-8
2014-10-24 11:15:59,720 INFO [MediaServer] Headless mode enabled: true
2014-10-24 11:15:59,720 INFO [MediaServer] User: serviio
2014-10-24 11:15:59,721 INFO [MediaServer] User home dir: /var/services/homes/s
- serviio.log 1/55 1%
at java.net.InetAddress.getLocalHost(InetAddress.java:1469)
... 3 more
2014-10-24 11:15:59,716 INFO [MediaServer] ------------------------------------------------------------------------
2014-10-24 11:15:59,716 INFO [MediaServer] Serviio DLNA media streaming server v 1.4.1.2 (rev. 3753eff81a2f+)
2014-10-24 11:15:59,717 INFO [MediaServer] Petr Nejedly 2009-2014
2014-10-24 11:15:59,717 INFO [MediaServer] http://www.serviio.org
2014-10-24 11:15:59,717 INFO [MediaServer]
2014-10-24 11:15:59,717 INFO [MediaServer] Java 1.7.0_71-Oracle Corporation
2014-10-24 11:15:59,718 INFO [MediaServer] OS Linux i386 3.2.40
2014-10-24 11:15:59,718 INFO [MediaServer] File encoding: UTF-8
2014-10-24 11:15:59,720 INFO [MediaServer] Headless mode enabled: true
2014-10-24 11:15:59,720 INFO [MediaServer] User: serviio
2014-10-24 11:15:59,721 INFO [MediaServer] User home dir: /var/services/homes/serviio
2014-10-24 11:15:59,721 INFO [MediaServer] Temp dir: /tmp
2014-10-24 11:15:59,721 INFO [MediaServer] ------------------------------------------------------------------------
2014-10-24 11:16:00,265 INFO [WebServer] Socket buffer set to 65535 bytes
2014-10-24 11:16:00,272 INFO [RestletServer] Starting Restlet server (/rest) exposed on port 23423
2014-10-24 11:16:00,418 INFO [RestletServer] Starting Restlet server (/cds) exposed on port 23424
2014-10-24 11:16:00,419 INFO [RestletServer] Starting Restlet server (/mediabrowser) exposed on port 23424
2014-10-24 11:16:00,461 INFO [DBSchemaUpdateExecutor] Checking if DB schema needs to be updated
2014-10-24 11:16:00,498 INFO [DatabaseManager] Using DERBY database language
2014-10-24 11:16:05,048 INFO [DBSchemaUpdateExecutor] Updating DB schema
2014-10-24 11:16:12,474 INFO [DBSchemaUpdateExecutor] Cleaning temporary cache
2014-10-24 11:16:12,570 INFO [Device] Created UPnP Device with UUID: 83403509-60a4-3ac0-bae1-94340baf2344, bound address: 192.168.1.2
2014-10-24 11:16:12,884 INFO [DBSchemaUpdateExecutor] Cleaning persistent cache
2014-10-24 11:16:12,957 WARN [IndexedDiskCache] Region [online_technical_metadata] Reseting cache
2014-10-24 11:16:13,200 INFO [prefs] Created user preferences directory.
2014-10-24 11:16:13,425 INFO [MediaServer] ------------------------------------------------------------------------
2014-10-24 11:16:13,425 INFO [MediaServer] License: PRO (EVALUATION, id: 11111111-1111-1111-1111-111111111113)
2014-10-24 11:16:13,425 INFO [MediaServer] ------------------------------------------------------------------------
2014-10-24 11:16:13,549 WARN [ProfilesDefinitionParser] Cannot get name of the local computer: DiskStation: DiskStation
2014-10-24 11:16:14,505 INFO [ProfilesDefinitionParser] Parsing Profiles definition
2014-10-24 11:16:14,605 ERROR [MediaServer] An unexpected error occured. Ending the application. Message: replacement
java.lang.NullPointerException: replacement
at java.util.regex.Matcher.replaceFirst(Matcher.java:950)
at java.lang.String.replaceFirst(String.java:2119)
at org.serviio.profile.ProfilesDefinitionParser.getDeviceDescription(ProfilesDefinitionParser.java:378)
at org.serviio.profile.ProfilesDefinitionParser.processProfileNode(ProfilesDefinitionParser.java:229)
at org.serviio.profile.ProfilesDefinitionParser.parseDefinition(ProfilesDefinitionParser.java:164)
at org.serviio.profile.ProfileManager.parseProfilesFromFile(ProfileManager.java:181)
at org.serviio.profile.ProfileManager.loadProfiles(ProfileManager.java:156)
at org.serviio.MediaServer.main(MediaServer.java:122)
2014-10-24 11:16:14,609 WARN [IndexedDiskCache] Region [tokens] Disk cache not shutdown properly, shutting down now.
2014-10-24 11:16:14,609 WARN [IndexedDiskCache] Region [online_technical_metadata] Disk cache not shutdown properly, shutting down now.
2014-10-24 11:16:14,610 WARN [IndexedDiskCache] Region [thumbnails] Disk cache not shutdown properly, shutting down now.



I check my /etc/hosts and there are this lines:
127.0.0.1 localhost
192.168.1.2 DiskStation


I have tryed to reinstall serviio packet many times and with th java version 6 and 7 i have the same issue.
Please i need help...
Thaks

Re: Serviio Java Problem on DS214Play

PostPosted: Sun Nov 23, 2014 9:21 pm
by Shaggy
I have the exact same problem on alphaos, a arch linux derivative

I have no explanation for you other than a workaround

it seems serviio is expecting a hostname of format "number name"
Speculating here but serviio may expect "ip-number name"?????

so if I set hostname to something like "1 DiskStation" it works.

on linux you do from terminal
  Code:
hostname "1 DiskStation"


You may be able to change /etc/hostname file instead to "1 DiskStation"
if that file is present on your system

with this you avoid the part with
  Code:
java.lang.NullPointerException: replacement
at java.util.regex.Matcher.replaceFirst(Matcher.java:950)

Re: Serviio Java Problem on DS214Play

PostPosted: Mon Nov 24, 2014 4:17 pm
by Shaggy
after further digging I came across this thread

https://community.oracle.com/message/7079881

and maybe the developer of serviio could do some variation of this code

  Code:
   /**
    * Best attempt to get the local hostname, with or without the existence of a DNS entry.
    * @author mcarter@uk.ibm.com
    * @return Short version of the local hostname.
    * @throws UnknownHostException There is a problem with the DNS entry for this host and/or this JVM implementation
    * does not return the standard error string.
    */
   public static String getLocalHostName() throws UnknownHostException {
      try {
           return (InetAddress.getLocalHost()).getHostName();
      } catch ( UnknownHostException uhe ) {
          String host = uhe.getMessage(); // host = "hostname: hostname"
          if ( host!=null ) {
              int colon = host.indexOf(':');
              if ( colon>0 ) {
                 return host.substring(0, colon); // Dangerous, this is JVM dependant code.
              }
          }
          throw uhe;
      }
   }


perhaps use something like below in ProfilesDefinitionParser


  Code:
try
  {
       COMP_NAME = InetAddress.getLocalHost().getHostName();
    } catch (UnknownHostException e) {
       log.warn(String.format("Cannot get name of the local computer: %s", new Object[] { e.getMessage() }));
           String host = e.getMessage(); // host = "hostname: hostname"
           if ( host!=null ) {
              int colon = host.indexOf(':');
              if ( colon>0 ) {
                 COMP_NAME=host.substring(0, colon);   
              }
         }
     }

Re: Serviio Java Problem on DS214Play

PostPosted: Tue Nov 25, 2014 9:00 pm
by Shaggy
Found another fix that works for me

installed dnsmasq on my computer and configured it to act as a nameserver
now my hostname gets a valid nslookup and also serviio is happy

wich evidently makes me happy :D

Re: Serviio Java Problem on DS214Play

PostPosted: Mon Dec 01, 2014 6:18 pm
by patters
I guess this issue is rare since many broadband routers act as local DNS servers. I've certainly never had it in the time I've run Serviio (spanning two different ISPs).