FAQ  •  Register  •  Login

NumberFormatException occurred

<<

jdla

Serviio newbie

Posts: 9

Joined: Sat Jan 07, 2017 5:51 pm

Post Sun Jan 08, 2017 10:59 am

NumberFormatException occurred

Dear all,

While trying to use the CDS API I do not manage to get something playing. It looks like I am not getting past the REST layer ...

Using Python code as in the documentation :


  Code:
            Values = \
                {
                'action'   : 'play' ,
                'objectId' : UrlComponents[5] ,
                'parentId' : UrlComponents[6] ,
                }
            Values = json.dumps( Values )

            Headers = \
                {
                'Content-Type' : 'application/json' ,
                'Accept'       : 'application/json' ,
                }

            Url = 'http://{}:{}/{}'.format( ServiioServer , ServiioPort , ServiioUrl )

            Logger.info( "Url     : {}".format( Url     ) )
            Logger.info( "Headers : {}".format( Headers ) )
            Logger.info( "Values  : {}".format( Values  ) )

            request = Request( Url , data=Values , headers = Headers )
            response_body = urlopen(request).read()
            print response_body


With following debug Logger.info output :
  Code:
2017-01-08 11:40:42,546 - __main__ - INFO - Components : ['', 'serviioproxy', 'cds', 'control', '67b0de4a-e7de-4ab9-7ad7-4a09e7b9ee57', 'A_F^FOL*R5$F2547$F2558$F2559$F2563$MI159818', 'A_F^FOL*R5$F2547$F2558$F2559$F2563']
2017-01-08 11:40:42,546 - __main__ - INFO - ServiioUrl : cds/control/67b0de4a-e7de-4ab9-7ad7-4a09e7b9ee57
2017-01-08 11:40:42,548 - __main__ - INFO - Url     : http://192.168.1.100:23424/cds/control/67b0de4a-e7de-4ab9-7ad7-4a09e7b9ee57
2017-01-08 11:40:42,549 - __main__ - INFO - Headers : {'Content-Type': 'application/json', 'Accept': 'application/json'}
2017-01-08 11:40:42,549 - __main__ - INFO - Values  : {"action": "play", "objectId": "A_F^FOL*R5$F2547$F2558$F2559$F2563$MI159818", "parentId": "A_F^FOL*R5$F2547$F2558$F2559$F2563"}


The serviio returns me a HTTP 500 mentioning in its log :

  Code:
2017-01-08 11:40:42,557 WARN  [ServiioStatusService] NumberFormatException occurred. Returning error code 500 to the REST layer. Message: For input string: "R5$F2547$F2558$F2559$F2563$MI159818"


I am out of ideas as what could go wrong or how to correct.

Any helping hand ?

Thanks,

Jos
<<

jdla

Serviio newbie

Posts: 9

Joined: Sat Jan 07, 2017 5:51 pm

Post Sun Jan 08, 2017 11:37 am

Re: NumberFormatException occurred

For what it is worth, some additional info :

I did try exactly the same but posting xml. The error is exactly the same.

  Code:
2017-01-08 12:34:42,151 - __main__ - INFO - Components : ['', 'serviioproxy', 'cds', 'control', '67b0de4a-e7de-4ab9-7ad7-4a09e7b9ee57', 'A_F^FOL*R5$F2547$F2558$F2559$F2563$MI159818', 'A_F^FOL*R5$F2547$F2558$F2559$F2563']
2017-01-08 12:34:42,151 - __main__ - INFO - ServiioUrl : cds/control/67b0de4a-e7de-4ab9-7ad7-4a09e7b9ee57
2017-01-08 12:34:42,151 - __main__ - INFO - Url     : http://192.168.1.100:23424/cds/control/67b0de4a-e7de-4ab9-7ad7-4a09e7b9ee57
2017-01-08 12:34:42,151 - __main__ - INFO - Headers : {'Content-Type': 'application/xml', 'Accept': 'application/xml'}
2017-01-08 12:34:42,151 - __main__ - INFO - Values  :
<controllerAction>
    <action>play</action>
    <objectId>A_F^FOL*R5$F2547$F2558$F2559$F2563$MI159818</objectId>
    <parentId>A_F^FOL*R5$F2547$F2558$F2559$F2563</parentId>
</controllerAction>


Stuck ...

Jos
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17216

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Mon Jan 09, 2017 1:46 pm

Re: NumberFormatException occurred

oh, ok - this is still in Beta and not even been advertised ;-)

Can you try to use a different ID's than from the Folders category? Try something from the Movies category for example.
<<

jdla

Serviio newbie

Posts: 9

Joined: Sat Jan 07, 2017 5:51 pm

Post Tue Jan 10, 2017 9:57 pm

Re: NumberFormatException occurred

Hmz. Not being advertised. The API was the one that made me decide I absolutely needed the PRO version :)

Now, having said that, I don't know what went wrong or where, but in the end it works now. I *guess* that after all there must have been something wrong with the id/parentId combination.

Jos

Return to Serviio Support & Help

Who is online

Users browsing this forum: No registered users and 9 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.