[HOWTO] Install Serviio in Freenas 8.0.x

Status
Not open for further replies.

jordanius

Cadet
Joined
Sep 27, 2011
Messages
1
Hi All.

I have just install freenas-8.0.1-rc2 and have been trying to install serviio to no avail.

I have followed Stephs guide to the letter but get a heap of java errors when I try to execute serviio.sh

[root@freenas] /home/jordanius/serviio/bin# ./serviio.sh
Exception in thread "main" java.lang.NoClassDefFoundError: org/restlet/ext/gson/GsonRepresentation
at org.serviio.ui.restlet.RestletServer.runServer(RestletServer.java:68)
at org.serviio.MediaServer.main(MediaServer.java:100)
Caused by: java.lang.ClassNotFoundException: org.restlet.ext.gson.GsonRepresentation
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
... 2 more

Java installed without issue and the servio.sh is identical to the one provided in this thread. Any suggestion very much appreciated !

[root@freenas] /home/jordanius/serviio/bin# java -version
java version "1.6.0_07"
Diablo Java(TM) SE Runtime Environment (build 1.6.0_07-b02)
Diablo Java HotSpot(TM) 64-Bit Server VM (build 10.0-b23, mixed mode)
 
A

Athanasios Kakargias

Guest
Hey mate, cheers, but I installed Serviio onto my mounted volume /mnt/RAID/serviio, so im guessing I dont need to do the changes you suggested?

I think yes Is everything working for you?

I tested it last night, plays fine audio and pictures on my bravia,
and divx on ps3.
I only had some problems with ripped dvds the .vob file playback was a bit erratic, propably due to high bitrate ~10Mbit i think.
Have not tried yet transcoding for PS3, i need mkv files for that?
 
A

Athanasios Kakargias

Guest
Hi All.

I have just install freenas-8.0.1-rc2 and have been trying to install serviio to no avail.

/*snip*/
[root@freenas] /home/jordanius/serviio/bin# java -version
java version "1.6.0_07"
Diablo Java(TM) SE Runtime Environment (build 1.6.0_07-b02)
Diablo Java HotSpot(TM) 64-Bit Server VM (build 10.0-b23, mixed mode)

Use the original serviio.sh

and adapt it so that the JAVA_OPTS variable to include the following properties
-Dserviio.remoteHost=***.yyy.zzz.www //the ip address from which you will be serving I tried 127.0.0.1 but it will not work
-Dffmpeg.location=path_to_ffmpeg
-Dderby.system.home=path_to_derby_library_folder // this must be writable as this is the db it stores the metadata
-Dderby.stream.error.file=path_to_log // writable file I have it in /var/log/derby.log
Don't forget the to put them inside the doublequotes (")

Most propably you there is something wrong with your classpath, stefs .sh file could be from a diffrent version of serviio ...
 
D

Damon Opacak

Guest
Anyone got serviio to start automatically on boot yet?
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
A

Athanasios Kakargias

Guest
D

Damon Opacak

Guest

ltworf13

Cadet
Joined
Oct 8, 2011
Messages
2
I'm a newbie and i've been up for 24 hours trying to get this to work for me so please help before I go insane.

1.i insatlled FileZilla cause for some reason putty would not connect
2.create a user on group wheel. connect to frenas from FilesZila using wheel user account

3. now i'm stuck because I have no idea what you guys mean with:


Code:
mount -uw /
pkg_add sudo
nano /etc/sudoers (this is to make the user that you created earlier on to use sudo), search for "wheel" comment out # in front of "wheel". Save and exit nano. 


where am I typing these command into. There is a tool menu onFileZilla "Server CustomCommand" I tried entering mount -uw / but I got an error.


4. Im assuming the other command are enterin in the same way:

Code:
ssh 192.168.0.1 (you need to change the ip according to your FreeNAS ip)
sudo su
mount -uw /
pkg_add -rv xtrans
pkg_add -rv xproto
pkg_add -rv xextproto
pkg_add -rv javavmwrapper
pkg_add -rv ffmpeg 


thx for your help in advance
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
@Itworf13

Filezilla is an FTP program, great for transferring files. Putty is an SSH program, great for remote access of a device and in this case FreeNAS. To use SSH you must enable it from the FreeNAS GUI Services screen. You can also do these commands from the console.
 

ltworf13

Cadet
Joined
Oct 8, 2011
Messages
2
thx joeschmuck. i got putty to work now but i'm still lost on the command. aslo whenyou say i can do the command from the console do you mean from the web gui? I don't see a place to enter the commands. Is there a youTube or screen print totorial that can get some place. I did a search with no luck
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
The console is the screen attached to your FreeNAS computer, option 9 (Shell). I think you are going to need time to play with FreeNAS and to explore how it works. Adding Serviio is something I'd say for a more advanced user. You can read this thread and even though it's a How-To, it's really more of a discussion thread because I don't think anyone has got it installed and working 100% so if you don't know what they are doing here, you will have an even more difficult time understanding why it's not working. I've been working this project for well over a year and I still am only scraping the surface of FreeBSD, the native language of FreeNAS. And this thread is your tutorial on how to add Serviio, there isn't anything else out there specifically for FreeNAS.

Good Luck
 
A

Athanasios Kakargias

Guest
I followed the steps, but I had to change "/usr/local/serviio-0.6/bin/serviio.sh" for where my serviio is installed "/mnt/RAID/serviio/serviio-0.6/bin/serviio.sh". Doesn't start on boot for some reason, I still have to putty into NAS and run "./mnt/RAID/serviio/serviio-0.6/bin/serviio.sh &" each time start it

Any ideas?

i had a problem with the $JAVA variable in the serviio.sh and i had to hardcode the path
for me with this inside serviio.sh it worked
Code:
JAVA="/usr/local/bin/java"


what do your logs say?

and by the way did you also changed the path to serviio.sh in the rc script?
this line also ?
Code:
required_files="/usr/local/serviio-0.6/bin/serviio.sh"


keep in mind that the rc script is not run in the same environment as when you are in the console so be verbose on both rc script and serviio.sh regarding paths, and variables If you still have problems try to hardcode everything using everywhere absolute paths.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
ltworf13 -

i'm still lost on the command. aslo whenyou say i can do the command from the console do you mean from the web gui? I don't see a place to enter the commands. Is there a youTube or screen print totorial that can get some place

At the top of the Noobs Forums there are 2 sticky posts with links to the docs, FAQs, and Official YouTube videos that will answer a great deal of questions. The links are also in my signature below.

Like @joeschmuck mentioned, this is more of an advanced topic, so if you are having trouble with finding the command line, you have a lot of catching up to do ;)
 
D

Damon Opacak

Guest
i had a problem with the $JAVA variable in the serviio.sh and i had to hardcode the path
for me with this inside serviio.sh it worked
Code:
JAVA="/usr/local/bin/java"


what do your logs say?

and by the way did you also changed the path to serviio.sh in the rc script?
this line also ?
Code:
required_files="/usr/local/serviio-0.6/bin/serviio.sh"


keep in mind that the rc script is not run in the same environment as when you are in the console so be verbose on both rc script and serviio.sh regarding paths, and variables If you still have problems try to hardcode everything using everywhere absolute paths.

Yep. I changed the required files path too. Freenas just boots normally, I still need to putty in, do a "cd ..", then run "./mnt/RAID/serviio/serviio-0.6/bin/serviio.sh" to get the Serviio to run.

How do I check the logs?
 
A

Athanasios Kakargias

Guest
Yep. I changed the required files path too. Freenas just boots normally, I still need to putty in, do a "cd ..", then run "./mnt/RAID/serviio/serviio-0.6/bin/serviio.sh" to get the Serviio to run.

How do I check the logs?

check the folder pathtoserviio/log you should see 2 log files there you can "more" them to see their contents , check if there is some complain on boot up.

Do you see the line "serviio up" when you boot in the console coming up before getting the freenas menu?

btw if you are on usb check that you have made the changes for rc to /conf/base/etc/ folder too. and check also that the serviio rc script file is executable.
 

pontiacgta2002

Dabbler
Joined
Oct 14, 2011
Messages
16
I have been able to make it all the way through the steps. However when i go to start serviio i get the following error:


cah@freenas] /mnt/NAS/serviio/serviio-0.6.0.1/bin# ./serviio.sh &
[1] 55838
./serviio.sh: Exec format error. Binary file not executable.
[Micah@freenas] /mnt/NAS/serviio/serviio-0.6.0.1/bin#

I did run chmod +x serviio.sh to make it executable. Any thoughts? I copied the serviio.sh file and pasted it into a note pad file, then transferred it to the folder it resides in. Then ran mv serviio.sh.txt to serviio.sh. I also changed the ip to my NAS ipaddress.
 

pontiacgta2002

Dabbler
Joined
Oct 14, 2011
Messages
16
So i edited the original serviio.sh file to point to my NAS ip. The service starts but how do i verify it? The pid is not showing up when i run the top command or check through the GUI system process running option. Should this show up in the list of services or should my dlna device see it now?
 
A

Athanasios Kakargias

Guest
on "top" you should see java running, and the logs should be informative.
the gui is oblivious of the serviio,

try to connect with the serviio.console from another machine. check serviio site to go forward now

BTW did you also add -Dffmpeg.location=/usr/local/bin/ffmpeg ?
otherwise the service will not autostart
 

pontiacgta2002

Dabbler
Joined
Oct 14, 2011
Messages
16
So im getting the below error and ran the fix below. My javawm* file was located in /usr/local/bin. I still get this error. I also am unable to get javawrapper to run anymore. I get the second error listed below. I have also added
If you are on USB you need also before rebooting to

Code:
cp /etc/local/javavm* /conf/base/etc/local/
echo libz.so.4 libz.so.5 > /conf/base/etc/libmap.conf


[Micah@freenas] /> pkg_add -v -r javawrapper
scheme: [ftp]
user: []
password: []
host: [ftp.freebsd.org]
port: [0]
document: [/pub/FreeBSD/ports/amd64/packages-8.2-release/Latest/javawrapper.tbz]
---> ftp.freebsd.org:21
looking up ftp.freebsd.org
connecting to ftp.freebsd.org:21
<<< 220 Welcome to freebsd.isc.org.
>>> USER anonymous
<<< 331 Please specify the password.
>>> PASS Micah@freenas.local.com
<<< 230 Login successful.
>>> PWD
<<< 257 "/"
>>> CWD pub/FreeBSD/ports/amd64/packages-8.2-release/Latest
<<< 250 Directory successfully changed.
>>> MODE S
<<< 200 Mode set to S.
>>> TYPE I
<<< 200 Switching to Binary mode.
setting passive mode
>>> PASV
<<< 227 Entering Passive Mode (204,152,184,73,183,141).
opening data connection
initiating transfer
>>> RETR javawrapper.tbz
<<< 550 Failed to open file.
Error: Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.2-release/Latest/javawrapper.tbz: File unavailable (e.g., file not found, no access)
pkg_add: unable to fetch 'ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.2-release/Latest/javawrapper.tbz' by URL
pkg_add: 1 package addition(s) failed

Here is my serviio.sh file I have added -Dffmpeg.location=/user/local/bin/ffmpeg to JAVA_OPTS


[Micah@freenas] /mnt/NAS/serviio/serviio-0.6.0.1/bin> cat serviio.sh
#!/bin/sh
### ====================================================================== ###
## ##
## Serviio start Script ##
## ##
### ====================================================================== ###

DIRNAME=`dirname $0`
PROGNAME=`basename $0`

# OS specific support (must be 'true' or 'false').
cygwin=false;
darwin=false;
linux=false;
case "`uname`" in
CYGWIN*)
cygwin=true
;;

Darwin*)
darwin=true
;;

Linux)
linux=true
;;
esac

# 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=`cygpath --unix "$JAVA_HOME"`
fi

# Setup SERVIIO_HOME
if [ "x$SERVIIO_HOME" = "x" ]; then
# get the full path (without any relative bits)
SERVIIO_HOME=`cd $DIRNAME/..; pwd`
fi
export SERVIIO_HOME

# Setup the JVM
if [ "x$JAVA" = "x" ]; then
if [ "x$JAVA_HOME" != "x" ]; then
JAVA="$JAVA_HOME/bin/java"
else
JAVA="java"
fi
fi

# Setup the classpath
SERVIIO_CLASS_PATH="$SERVIIO_HOME/lib/serviio.jar:$SERVIIO_HOME/lib/derby.jar:$SERVIIO_HOME/lib/jcs.jar:$SERVIIO_HOME/lib/concurrent.jar:$SERVIIO_HOME/lib/freemarker.jar:$SERVIIO_HOME/lib/httpcore.jar:$SERVIIO_HOME/lib/jaudiotagger.jar:$SERVIIO_HOME/lib/jul-to-slf4j.jar:$SERVIIO_HOME/lib/jcl-over-slf4j.jar:$SERVIIO_HOME/lib/log4j.jar:$SERVIIO_HOME/lib/sanselan.jar:$SERVIIO_HOME/lib/slf4j-api.jar:$SERVIIO_HOME/lib/slf4j-log4j12.jar:$SERVIIO_HOME/lib/org.restlet.jar:$SERVIIO_HOME/lib/org.restlet.ext.xstream.jar:$SERVIIO_HOME/lib/xstream.jar:$SERVIIO_HOME/lib/rome.jar:$SERVIIO_HOME/lib/rome-modules.jar:$SERVIIO_HOME/lib/jdom.jar:$SERVIIO_HOME/lib/groovy-all.jar:$SERVIIO_HOME/lib/winp.jar:$SERVIIO_HOME/lib/org.restlet.ext.gson.jar:$SERVIIO_HOME/lib/gson.jar:$SERVIIO_HOME/config"

# Setup Serviio specific properties
JAVA_OPTS="-Dffmpeg.location=/user/local/bin/ffmpeg -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Dderby.system.home=$SERVIIO_HOME/library -Dserviio.home=$SERVIIO_HOME -Dserviio.remoteHost=192.168.1.20"

# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
SERVIIO_HOME=`cygpath --path --windows "$SERVIIO_HOME"`
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
SERVIIO_CLASS_PATH=`cygpath --path --windows "$SERVIIO_CLASS_PATH"`
fi

# Execute the JVM in the foreground
"$JAVA" -Xmx384M $JAVA_OPTS -classpath "$SERVIIO_CLASS_PATH" org.serviio.MediaServer "$@"


I went from working to not being able to start serviio.sh now.
 
Status
Not open for further replies.
Top