Linux Setup on CentOS - "replacement" error
Hi all,
I set up ServIIO on CentOS following the instructions on the wiki: http://wiki.serviio.org/doku.php?id=howto:linux:install
After following these instructions, I noticed that ServIIO wasn't running. I checked the log files and saw this message:
After a bit of debugging, I solved the issue. The problem was that ServIIO requires that your machine's hostname match a valid DNS entry. Unfortunately, the server didn't tell me that - I thought that maybe my "profiles.xml" file was damaged due to the way it said "replaceFirst" in a regex string was the error.
The solution was to fix my machine's "hostname" to match an entry in the "/etc/hosts" file. My hostname is "themistocles" and I have this line in "/etc/hosts":
After I made that minor change, ServIIO ran successfully. Perhaps this note will save someone else some trouble!
I set up ServIIO on CentOS following the instructions on the wiki: http://wiki.serviio.org/doku.php?id=howto:linux:install
After following these instructions, I noticed that ServIIO wasn't running. I checked the log files and saw this message:
- Code:
2012-05-31 12:13:52,849 ERROR [ApplicationInstanceManager] themistocles: themistocles
java.net.UnknownHostException: themistocles: themistocles
at java.net.InetAddress.getLocalHost(InetAddress.java:1426)
at org.serviio.ApplicationInstanceManager.registerInstance(ApplicationInstanceManager.java:68)
at org.serviio.MediaServer.checkForRunningInstances(MediaServer.java:242)
at org.serviio.MediaServer.main(MediaServer.java:93)
2012-05-31 12:13:52,855 INFO [MediaServer] ------------------------------------------------------------------------
2012-05-31 12:13:52,855 INFO [MediaServer] Serviio DLNA media streaming serverv 0.6.2 (rev. 6a61243292ee)
2012-05-31 12:13:52,855 INFO [MediaServer] Petr Nejedly 2009-2011
2012-05-31 12:13:52,855 INFO [MediaServer] http://www.serviio.org
2012-05-31 12:13:52,855 INFO [MediaServer]
2012-05-31 12:13:52,855 INFO [MediaServer] Java 1.6.0_22-Sun Microsystems Inc.
2012-05-31 12:13:52,855 INFO [MediaServer] OS Linux amd64 2.6.32-220.13.1.el6.x86_64
2012-05-31 12:13:52,855 INFO [MediaServer] File encoding: UTF-8
2012-05-31 12:13:52,856 INFO [MediaServer] Headless mode enabled: true
2012-05-31 12:13:52,856 INFO [MediaServer] User home dir: /opt/serviio
2012-05-31 12:13:52,856 INFO [MediaServer] Temp dir: /tmp
2012-05-31 12:13:52,856 INFO [MediaServer] ------------------------------------------------------------------------
2012-05-31 12:13:52,921 INFO [RestletServer] Starting Restlet server exposed on port 23423
2012-05-31 12:13:52,950 INFO [DBSchemaUpdateExecutor] Checking if DB schema needs to be updated
2012-05-31 12:13:53,626 WARN [ProfilesDefinitionParser] Cannot get name of thelocal computer: themistocles: themistocles
2012-05-31 12:13:53,780 INFO [ProfilesDefinitionParser] Parsing Profiles definition
2012-05-31 12:13:54,062 ERROR [MediaServer] An unexpected error occured. Ending the application. Message: replacement
java.lang.NullPointerException: replacement
at java.util.regex.Matcher.replaceFirst(Matcher.java:867)
at java.lang.String.replaceFirst(String.java:2158)
at org.serviio.profile.ProfilesDefinitionParser.getDeviceDescription(ProfilesDefinitionParser.java:331)
at org.serviio.profile.ProfilesDefinitionParser.processProfileNode(ProfilesDefinitionParser.java:194)
at org.serviio.profile.ProfilesDefinitionParser.parseDefinition(ProfilesDefinitionParser.java:143)
at org.serviio.profile.ProfileManager.loadProfiles(ProfileManager.java:156)
at org.serviio.MediaServer.main(MediaServer.java:105)
2012-05-31 12:23:05,136 ERROR [ApplicationInstanceManager] themistocles: themistocles java.net.UnknownHostException: themistocles: themistocles
at java.net.InetAddress.getLocalHost(InetAddress.java:1426)
at org.serviio.ApplicationInstanceManager.registerInstance(ApplicationInstanceManager.java:68)
at org.serviio.MediaServer.checkForRunningInstances(MediaServer.java:242)
at org.serviio.MediaServer.main(MediaServer.java:93)
After a bit of debugging, I solved the issue. The problem was that ServIIO requires that your machine's hostname match a valid DNS entry. Unfortunately, the server didn't tell me that - I thought that maybe my "profiles.xml" file was damaged due to the way it said "replaceFirst" in a regex string was the error.
The solution was to fix my machine's "hostname" to match an entry in the "/etc/hosts" file. My hostname is "themistocles" and I have this line in "/etc/hosts":
After I made that minor change, ServIIO ran successfully. Perhaps this note will save someone else some trouble!