Page 2 of 13

Re: Web UI in Restful Ajax

PostPosted: Wed Jul 27, 2011 11:00 pm
by PhoenixNZ
Please forgive me now :mrgreen: , I'm a complete moron and linux n00b :?: , and want to make sure I do this right. So this is going on a Slackware, UnRaid system.

So I extract all the files from the two zip's and get the following files:
    serviio-webclient-0.1.jar

    gson-1.7.1.jar
    org.restlet.ext.gson-2.1-M2.jar
    serviio-addons.gson.jar

and place them into
serviio/lib folder.

I add the serviio-webui.sh into serviio/bin as well as patch the serviio.sh file with your sample from your wiki.

Now do I just just start serviio.sh, or do I also need to start serviio-webui.sh

My path to the serviio files is: /boot/custom/serviio and i would start by ./bin/serviio.sh & or should i cd into /boot/custom/serviio/bin and start by serviio.sh &

Have I covered all my bases??? Am I stupid or what??? no need to answer that last one.

Anyway, thanks for wasting your time on me.

Re: Web UI in Restful Ajax

PostPosted: Thu Jul 28, 2011 9:40 am
by kairoh
PhoenixNZ wrote:Now do I just just start serviio.sh, or do I also need to start serviio-webui.sh

You need to start them both in this order : serviio.sh then serviio-webui.sh.
PhoenixNZ wrote:My path to the serviio files is: /boot/custom/serviio and i would start by ./bin/serviio.sh & or should i cd into /boot/custom/serviio/bin and start by serviio.sh &

Because there are some relative path in the script, I think it is better to cd into your bin dir (/boot/custom/serviio/bin), then run the scripts (./serviio.sh& then ./serviio-webui.sh&) from here.
Be sure that you use "sh" shell and that scripts are executable.

No worries for your head : everybody was a n00b before! ;)

Re: Web UI in Restful Ajax

PostPosted: Thu Jul 28, 2011 11:55 pm
by PhoenixNZ
OK, something going wrong. Serviio.sh is good but i get an error when I start serviio-webui.sh. See below:

  Code:
TowerTest login: root
Linux 2.6.37.6-unRAID.
root@TowerTest:~# cd /boot/custom/serviio/bin
.root@TowerTest:/boot/custom/serviio/bin# ls
Copy\ of\ serviio.sh.old*  serviio-webui.sh*   serviio.sh*
serviio-console.sh*        serviio-webui1.sh*  serviio.sh.old*
root@TowerTest:/boot/custom/serviio/bin# ./serviio.sh &
[1] 1708
root@TowerTest:/boot/custom/serviio/bin# ./serviio-webui.sh &
[2] 1760
root@TowerTest:/boot/custom/serviio/bin# Exception in thread "main" java.lang.NoClassDefFoundError: org/serviio/console/ServiioConsole
Caused by: java.lang.ClassNotFoundException: org.serviio.console.ServiioConsole
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Could not find the main class: org.serviio.console.ServiioConsole.  Program will exit.

[2]+  Exit 1                  ./serviio-webui.sh
root@TowerTest:/boot/custom/serviio/bin# ^C
root@TowerTest:/boot/custom/serviio/bin# ls -l
total 96
-rwxrwxrwx 1 root root 2430 2011-03-28 07:42 Copy\ of\ serviio.sh.old*
-rwxrwxrwx 1 root root 2365 2011-03-28 07:42 serviio-console.sh*
-rwxrwxrwx 1 root root 2223 2011-07-29 11:39 serviio-webui.sh*
-rwxrwxrwx 1 root root 2279 2011-07-29 11:34 serviio-webui1.sh*
-rwxrwxrwx 1 root root 2547 2011-07-28 10:42 serviio.sh*
-rwxrwxrwx 1 root root 2430 2011-03-28 07:42 serviio.sh.old*
root@TowerTest:/boot/custom/serviio/bin#


Any thoughts? Or am i missing AJAX?? This is a custom build for UnRaid. I'll look into that first.

Re: Web UI in Restful Ajax

PostPosted: Fri Jul 29, 2011 7:41 am
by kairoh
PhoenixNZ wrote:OK, something going wrong. Serviio.sh is good but i get an error when I start serviio-webui.sh.

My mistake! I haven't tested the linux shell after copying the serviio console shell...
You just have to change the last line
  Code:
"$JAVA" $JAVA_OPTS -classpath "$SERVIIO_CONSOLE_CLASS_PATH" org.serviio.console.ServiioConsole "$@"

to
  Code:
"$JAVA" $JAVA_OPTS -classpath "$SERVIIO_CONSOLE_CLASS_PATH" org.serviio.restui.RestletProxy "$@"

Re: Web UI in Restful Ajax

PostPosted: Fri Jul 29, 2011 8:17 am
by PhoenixNZ
er, nope. still something I'm doin wrong.

Edited serviio-webui.sh and complete sh is as follows:
  Code:
#!/bin/sh
### ====================================================================== ###
##                                                                          ##
##  Serviio WebUI Console ript                                              ##
##                                                                          ##
### ====================================================================== ###
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_CONSOLE_HOME" ] &&
        SERVIIO_CONSOLE_HOME=`cygpath --unix "$SERVIIO_CONSOLE_HOME"`
    [ -n "$JAVA_HOME" ] &&
        JAVA_HOME=`cygpath --unix "$JAVA_HOME"`   
fi

# Setup SERVIIO_CONSOLE_HOME
if [ "x$SERVIIO_CONSOLE_HOME" = "x" ]; then
    # get the full path (without any relative bits)
    SERVIIO_CONSOLE_HOME=`cd $DIRNAME/..; pwd`
fi
export SERVIIO_CONSOLE_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_CONSOLE_CLASS_PATH="$SERVIIO_CONSOLE_HOME/lib/serviio-webclient-0.1.jar:$SERVIIO_CONSOLE_HOME/lib/log4j.jar:$SERVIIO_CONSOLE_HOME/lib/slf4j-api.jar:$SERVIIO_CONSOLE_HOME/lib/slf4j-log4j12.jar:$SERVIIO_CONSOLE_HOME/lib/jul-to-slf4j.jar:$SERVIIO_CONSOLE_HOME/lib/org.restlet.jar:$SERVIIO_CONSOLE_HOME/lib/freemarker.jar:$SERVIIO_CONSOLE_HOME/config"

# Setup Serviio specific properties
JAVA_OPTS="-Dserviio.home=$SERVIIO_CONSOLE_HOME -Djava.net.preferIPv4Stack=true"

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

# Execute the JVM in the foreground
"$JAVA" $JAVA_OPTS -classpath "$SERVIIO_CONSOLE_CLASS_PATH" org.serviio.restui.RestletProxy "$@"


Getting this error message now. Not sure if same as my previous post
  Code:
root@TowerTest:/boot/custom/serviio# ./bin/serviio-webui.sh &
[3] 1966
[2]   Exit 1                  ./bin/serviio-webui.sh
root@TowerTest:/boot/custom/serviio# Exception in thread "main" java.lang.NoClassDefFoundError: org/serviio/restui/RestletProxy
Caused by: java.lang.ClassNotFoundException: org.serviio.restui.RestletProxy
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Could not find the main class: org.serviio.restui.RestletProxy.  Program will exit.

[3]+  Exit 1                  ./bin/serviio-webui.sh
root@TowerTest:/boot/custom/serviio#


Your thoughts may lighten my day. lol :)

Re: Web UI in Restful Ajax

PostPosted: Fri Jul 29, 2011 8:34 am
by kairoh
PhoenixNZ wrote:root@TowerTest:/boot/custom/serviio# ./bin/serviio-webui.sh &

Try to cd to your $SERVIIO_CONSOLE_HOME/bin/ before running ./serviio-webui.sh&

Re: Web UI in Restful Ajax

PostPosted: Sun Jul 31, 2011 11:13 pm
by PhoenixNZ
Haven't had a chance to check into this further, as too busy fixing friends computers. (Why do they break them just before the weekend!!!).

Will look into getting this going later this week.

Re: Web UI in Restful Ajax

PostPosted: Mon Aug 01, 2011 9:39 am
by williMeier
great tool, tankyou!
it seems to be running but the webUI contains no data, see attached screen shot.
what i'm missing?

Re: Web UI in Restful Ajax

PostPosted: Mon Aug 01, 2011 12:00 pm
by Illico
williMeier wrote:great tool, tankyou!
it seems to be running but the webUI contains no data, see attached screen shot.
what i'm missing?

+1 Same problem for me on Firefox or IE

Re: Web UI in Restful Ajax

PostPosted: Tue Aug 02, 2011 7:22 pm
by Elfish
i get that when i tried to browse with lynx to http://127.0.0.1:8123/serviio/console

  Code:
HTTP request sent; waiting for response.02-Aug-2011 21:21:02 org.restlet.engine.log.LogFilter afterHandle
                                                                                                         INFO: 2011-08-02       21:21:02        127.0.0.1   -localhost       8123    GET     /serviio/console        -       200     -       0       187     http://127.0.0.1:8123   Lynx/2.8.8dev.9 libwww-FM/2.14 SSL-MM/1.4.1 GNUTLS/2.10.5    -
HTTP/1.0 200 OK


anyone knows what i'm doing wrong?
i put all the files in /lib and changed the launchers aswell

i'm running debian headless

Re: Web UI in Restful Ajax

PostPosted: Tue Aug 02, 2011 10:18 pm
by patters
Hi, running on Synology NAS I couldn't get the shell script launch to work (just kept saying 'not found' even though it looks like it's based off the serviio.sh one.

Anyhow, I used a few find&replace and arrived at:

  Code:
/opt/serviio/bin$ java -Dserviio.home=/opt/serviio -Djava.net.preferIPv4Stack=tr
ue -classpath "/opt/serviio/lib/serviio-webclient-0.1.jar:/opt/serviio/lib/log4j
.jar:/opt/serviio/lib/slf4j-api.jar:/opt/serviio/lib/slf4j-log4j12.jar:/opt/serv
iio/lib/jul-to-slf4j.jar:/opt/serviio/lib/org.restlet.jar:/opt/serviio/lib/freem
arker.jar:/opt/serviio/config" org.serviio.restui.RestletProxy "$@"
Aug 2, 2011 10:12:38 PM org.restlet.engine.http.connector.HttpClientHelper start
INFO: Starting the default HTTP client
Aug 2, 2011 10:12:39 PM org.restlet.engine.http.connector.HttpServerHelper start
INFO: Starting the internal HTTP server on port 8123


Still can't connect on http://192.168.1.202:8123/serviio/console though.

Re: Web UI in Restful Ajax

PostPosted: Tue Aug 02, 2011 10:25 pm
by patters
Elfish wrote:i get that when i tried to browse with lynx to http://127.0.0.1:8123/serviio/console

  Code:
HTTP request sent; waiting for response.02-Aug-2011 21:21:02 org.restlet.engine.log.LogFilter afterHandle
                                                                                                         INFO: 2011-08-02       21:21:02        127.0.0.1   -localhost       8123    GET     /serviio/console        -       200     -       0       187     http://127.0.0.1:8123   Lynx/2.8.8dev.9 libwww-FM/2.14 SSL-MM/1.4.1 GNUTLS/2.10.5    -
HTTP/1.0 200 OK


anyone knows what i'm doing wrong?
i put all the files in /lib and changed the launchers aswell

i'm running debian headless


Exact same behaviour here running Linux on Synology NAS.

Re: Web UI in Restful Ajax

PostPosted: Wed Aug 03, 2011 5:35 am
by Elfish
at least i'm not the only one :).

at least my sony tv was able to find the serviio itself.

Re: Web UI in Restful Ajax

PostPosted: Thu Aug 04, 2011 4:30 pm
by kairoh
Elfish wrote:i get that when i tried to browse with lynx to http://127.0.0.1:8123/serviio/console
anyone knows what i'm doing wrong?

Lynx is not supported : Ajax needs an advanced Javascript-compliant browser.
You should try to connect from another device on your network.

Web UI in Restful Ajax

PostPosted: Thu Aug 04, 2011 5:25 pm
by Elfish
Hi thanks for your reply

I also tried to access the webinterface from my Notebook without any success. The page timed out. how to set the network device serviio is bound to/uses? Serviio itself starts up fine. There are no errors in the log.

Re: Web UI in Restful Ajax

PostPosted: Thu Aug 04, 2011 5:28 pm
by zip
can you access this url from the remote machine?

  Code:
http://<IP of serviio box>:23423/rest/application

Re: Web UI in Restful Ajax

PostPosted: Thu Aug 04, 2011 7:44 pm
by Elfish
doesn't work on my server

http://127.0.0.1:23423/rest/application
seems to work.
w3m is asking if i wanted to download "application"

however trying to access
http://192.168.1.105:23423/rest/application

doesn't work on my local machine and my remote machine
the ip is 100% correct since i'm sshing to it.

Re: Web UI in Restful Ajax

PostPosted: Thu Aug 04, 2011 8:23 pm
by kairoh
williMeier wrote:great tool, tankyou!
it seems to be running but the webUI contains no data, see attached screen shot.
what i'm missing?

Is javascript enabled?

Re: Web UI in Restful Ajax

PostPosted: Thu Aug 04, 2011 11:56 pm
by williMeier
yes. tried with chrome, ie 8, firefox portable, opera.
are there any logfiles?

Re: Web UI in Restful Ajax

PostPosted: Fri Aug 05, 2011 6:10 am
by zip
Elfish wrote:doesn't work on my server

http://127.0.0.1:23423/rest/application
seems to work.
w3m is asking if i wanted to download "application"

however trying to access
http://192.168.1.105:23423/rest/application

doesn't work on my local machine and my remote machine
the ip is 100% correct since i'm sshing to it.

Are you using beta 2 or something before that? If 0.5.2, then make sure to bind the rest API to the external Ip address by passing this on the server side:

  Code:
-Dserviio.remoteHost=192.168.1.105