Hello all,
I'm a FreeBSD newbie as you can see from my presentation post. I hope this is the right place to post this thread.
I'm trying to make http://www.serviio.org/ works (it's a DLNA server made in Java) but I always had the same problem.
So, I'm asking you if someone can help me dealing with this.
The problem is, as you can see from serviio log, that the call to
gives an UnknownHostException:
I tried with three 1.6 jdks, OpenJDK, DiabloJDK and OracleJDK, still the same problem.
I also made a simple java class packaged in a runnable jar to check if the problem was on Serviio or on my system and the answer is... the second.
This is my java class:
and this is the output:
The java version is:
I read about the hosts file so I went looking around in /etc and I found tho files, /etc/host and /etc/hosts that I show you:
and
I don't know why the firs has Italian comments, anyway the IP address of my box is 192.168.0.160.
What should I do? Have you got any idea?
Thanks a lot.
I'm a FreeBSD newbie as you can see from my presentation post. I hope this is the right place to post this thread.
I'm trying to make http://www.serviio.org/ works (it's a DLNA server made in Java) but I always had the same problem.
So, I'm asking you if someone can help me dealing with this.
The problem is, as you can see from serviio log, that the call to
Code:
InetAddress.getLocalHost
Code:
2011-09-25 18:42:23,358 ERROR [ApplicationInstanceManager] :
java.net.UnknownHostException: :
at java.net.InetAddress.getLocalHost(InetAddress.java:1353)
at org.serviio.ApplicationInstanceManager.registerInstance(ApplicationInstanceManager.java:68)
at org.serviio.MediaServer.checkForRunningInstances(MediaServer.java:230)
at org.serviio.MediaServer.main(MediaServer.java:89)
2011-09-25 18:42:23,370 INFO [MediaServer] ------------------------------------------------------------------------
2011-09-25 18:42:23,370 INFO [MediaServer] Serviio DLNA media streaming server v 0.5.2 (rev. 4e3210bd9ff3)
2011-09-25 18:42:23,370 INFO [MediaServer] Petr Nejedly 2009-2011
2011-09-25 18:42:23,370 INFO [MediaServer] http://www.serviio.org
2011-09-25 18:42:23,370 INFO [MediaServer]
2011-09-25 18:42:23,371 INFO [MediaServer] Java 1.6.0_03-p4-Sun Microsystems Inc.
2011-09-25 18:42:23,371 INFO [MediaServer] OS FreeBSD amd64 8.2-RELEASE
2011-09-25 18:42:23,371 INFO [MediaServer] File encoding: ISO-8859-1
2011-09-25 18:42:23,371 INFO [MediaServer] ------------------------------------------------------------------------
2011-09-25 18:42:23,533 INFO [RestletServer] Starting Restlet server exposed on localhost:23423
2011-09-25 18:42:23,613 INFO [DBSchemaUpdateExecutor] Checking if DB schema needs to be updated
2011-09-25 18:42:23,621 DEBUG [DBLogDAOImpl] Checking if script 'script-0.1.sql' has been run
2011-09-25 18:42:25,074 DEBUG [DBLogDAOImpl] Checking if script 'script-0.1.1.sql' has been run
2011-09-25 18:42:25,075 DEBUG [DBLogDAOImpl] Checking if script 'script-0.2.sql' has been run
2011-09-25 18:42:25,076 DEBUG [DBLogDAOImpl] Checking if script 'script-0.3.1.sql' has been run
2011-09-25 18:42:25,077 DEBUG [DBLogDAOImpl] Checking if script 'script-0.4.sql' has been run
2011-09-25 18:42:25,078 DEBUG [DBLogDAOImpl] Checking if script 'script-0.4.1.sql' has been run
2011-09-25 18:42:25,079 DEBUG [DBLogDAOImpl] Checking if script 'script-0.4.2.sql' has been run
2011-09-25 18:42:25,080 DEBUG [DBLogDAOImpl] Checking if script 'script-0.5.sql' has been run
2011-09-25 18:42:25,082 DEBUG [DBLogDAOImpl] Checking if script 'script-0.5.1.sql' has been run
2011-09-25 18:42:25,089 WARN [ProfilesDefinitionParser] Cannot get name of the local computer: :
I tried with three 1.6 jdks, OpenJDK, DiabloJDK and OracleJDK, still the same problem.
I also made a simple java class packaged in a runnable jar to check if the problem was on Serviio or on my system and the answer is... the second.
This is my java class:
Code:
import java.net.InetAddress;
import java.net.UnknownHostException;
public class InetAddressTest {
public static void main(String[] args) {
String localHostName = "no name";
String localHostAddress = "no address";
try {
localHostName = InetAddress.getLocalHost().getHostName();
System.out.println("localHostName: " + localHostName);
} catch (UnknownHostException e) {
e.printStackTrace();
System.out.println("No name: " + e.getMessage());
}
try {
localHostAddress = InetAddress.getLocalHost().getHostAddress();
System.out.println("localHostAddress: " + localHostAddress);
} catch (UnknownHostException e) {
e.printStackTrace();
System.out.println("No address: " + e.getMessage());
}
}
}
and this is the output:
Code:
# java -jar /usr/home/Lorenzo/Desktop/Download/java/test/InetAddressTest.jar
java.net.UnknownHostException: :
at java.net.InetAddress.getLocalHost(InetAddress.java:1353)
at InetAddressTest.main(InetAddressTest.java:15)
No name: :
java.net.UnknownHostException: :
at java.net.InetAddress.getLocalHost(InetAddress.java:1353)
at InetAddressTest.main(InetAddressTest.java:23)
No address: :
The java version is:
Code:
# java -version
java version "1.6.0_03-p4"
Java(TM) SE Runtime Environment (build 1.6.0_03-p4-Lorenzo_25_sep_2011_16_30-b00)
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_03-p4-Lorenzo_25_sep_2011_16_30-b00, mixed mode)
I read about the hosts file so I went looking around in /etc and I found tho files, /etc/host and /etc/hosts that I show you:
Code:
# more /etc/host
# $FreeBSD$
#
# Host Database
# Questo file dovrebbe contenere gli indirizzi e gli alias
# per gli host locali che condividono questo file.
# In presenza di DNS o NIS, questo file potrebbe non essere consultato affatto;
# guarda /etc/nsswitch.conf per l'ordine di risoluzione.
#
#[Indirizzo Internet ] [nome host ufficiale] [alias1] [alias2] ...
#
::1 localhost
127.0.0.1 localhost FreeBSD
192.168.0.160 localhost FreeBSD
#
# Rete immaginaria.
#10.0.0.2 myname.my.domain myname
#10.0.0.3 myfriend.my.domain myfriend
#
# In accordo all'RFC 1918, puoi usare le seguenti classi di IP per reti private
# che non verranno mai connesse ad Internet:
#
# 10.0.0.0 - 10.255.255.255
# 172.16.0.0 - 172.31.255.255
# 192.168.0.0 - 192.168.255.255
#
# In caso volessi essere in grado di collegarti ad Internet, avrai bisogno
# di veri numeri ufficiali assegnati. PER FAVORE PER FAVORE PER FAVORE
# non tentare di inventarti i numeri della tua rete ma fattene assegnare
# uno dal tuo provider (se ne hai uno) o dall'Internet Registry (ftp su
# rs.internic.net, directory `/templates').
Code:
# more /etc/hosts
# $FreeBSD: src/etc/hosts,v 1.16.34.1.6.1 2010/12/21 17:09:25 kensmith Exp $
#
# Host Database
#
# This file should contain the addresses and aliases for local hosts that
# share this file. Replace 'my.domain' below with the domainname of your
# machine.
#
# In the presence of the domain name service or NIS, this file may
# not be consulted at all; see /etc/nsswitch.conf for the resolution order.
#
#
::1 localhost
127.0.0.1 localhost FreeBSD
192.168.0.160 localhost FreeBSD
#
# Imaginary network.
#10.0.0.2 myname.my.domain myname
#10.0.0.3 myfriend.my.domain myfriend
#
# According to RFC 1918, you can use the following IP networks for
# private nets which will never be connected to the Internet:
#
# 10.0.0.0 - 10.255.255.255
# 172.16.0.0 - 172.31.255.255
# 192.168.0.0 - 192.168.255.255
#
# In case you want to be able to connect to the Internet, you need
# real official assigned numbers. Do not try to invent your own network
# numbers but instead get one from your network provider (if any) or
# from your regional registry (ARIN, APNIC, LACNIC, RIPE NCC, or AfriNIC.)
#
I don't know why the firs has Italian comments, anyway the IP address of my box is 192.168.0.160.
What should I do? Have you got any idea?
Thanks a lot.