Closed MaEngelhard closed 11 years ago
Can you check and see if the locale set on your phone or tablet matches that of your backend? On Oct 13, 2013 7:20 AM, "MaEngelhard" notifications@github.com wrote:
I'm running the current beta on a 0.27 backend. The frontent can't connect to the bakend. The reason is a NumberFormatException as followed:
10-13 13:12:21.063: E/BackendStatusHelperV27(12840): org.mythtv.services.api.MythServiceApiRuntimeException: org.springframework.http.converter.HttpMessageNotReadableException: Could not read [class org.mythtv.services.api.v027.status.beans.BackendStatus]; nested exception is java.lang.NumberFormatException: Invalid float: "0,15"; nested exception is org.springframework.http.converter.HttpMessageNotReadableException: Could not read [class org.mythtv.services.api.v027.status.beans.BackendStatus]; nested exception is java.lang.NumberFormatException: Invalid float: "0,15" 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.mythtv.services.api.v027.impl.StatusTemplate.getStatus(StatusTemplate.java:56) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.mythtv.service.status.v27.BackendStatusHelperV27.downloadBackendStatus(BackendStatusHelperV27.java:149) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.mythtv.service.status.v27.BackendStatusHelperV27.process(BackendStatusHelperV27.java:135) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.mythtv.service.status.BackendStatusService.onHandleIntent(BackendStatusService.java:94) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at android.os.Handler.dispatchMessage(Handler.java:99) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at android.os.Looper.loop(Looper.java:137) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at android.os.HandlerThread.run(HandlerThread.java:61) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): Caused by: org.springframework.http.converter.HttpMessageNotReadableException: Could not read [class org.mythtv.services.api.v027.status.beans.BackendStatus]; nested exception is java.lang.NumberFormatException: Invalid float: "0,15" 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.springframework.http.converter.xml.SimpleXmlHttpMessageConverter.readInternal(SimpleXmlHttpMessageConverter.java:115) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.springframework.http.converter.AbstractHttpMessageConverter.read(AbstractHttpMessageConverter.java:147) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.springframework.web.client.HttpMessageConverterExtractor.extractData(HttpMessageConverterExtractor.java:76) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.springframework.web.client.RestTemplate$ResponseEntityResponseExtractor.extractData(RestTemplate.java:655) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.springframework.web.client.RestTemplate$ResponseEntityResponseExtractor.extractData(RestTemplate.java:641) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:484) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:453) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:429) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.mythtv.services.api.v027.impl.StatusTemplate.getStatus(StatusTemplate.java:52) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): ... 7 more 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): Caused by: java.lang.NumberFormatException: Invalid float: "0,15" 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at java.lang.StringToReal.invalidReal(StringToReal.java:63) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at java.lang.StringToReal.parseFloat(StringToReal.java:310) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at java.lang.Float.parseFloat(Float.java:300) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at java.lang.Float.valueOf(Float.java:337) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.transform.FloatTransform.read(FloatTransform.java:55) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.transform.FloatTransform.read(FloatTransform.java:42) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.transform.Transformer.read(Transformer.java:106) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.core.Support.read(Support.java:372) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.core.PrimitiveFactory.getInstance(PrimitiveFactory.java:105) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.core.Primitive.readTemplate(Primitive.java:231) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.core.Primitive.read(Primitive.java:171) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.core.Primitive.read(Primitive.java:126) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.core.Composite.readVariable(Composite.java:623) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.core.Composite.readInstance(Composite.java:573) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.core.Composite.readAttribute(Composite.java:497) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.core.Composite.readAttributes(Composite.java:413) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.core.Composite.access$300(Composite.java:59) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.core.Composite$Builder.read(Composite.java:1382) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.core.Composite.read(Composite.java:201) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.core.Composite.read(Composite.java:148) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.core.Composite.readVariable(Composite.java:623) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.core.Composite.readInstance(Composite.java:573) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.core.Composite.readUnion(Composite.java:549) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframewo 10-13 13:12:21.063: D/BackendStatusHelperV27(12840): process : exit
— Reply to this email directly or view it on GitHubhttps://github.com/MythTV-Clients/MythTV-Android-Frontend/issues/227 .
Here is the locale setting on the backend:
LANG=de_DE.UTF-8 LC_CTYPE=de_DE.UTF-8 LC_NUMERIC="de_DE.UTF-8" LC_TIME="de_DE.UTF-8" LC_COLLATE=C LC_MONETARY="de_DE.UTF-8" LC_MESSAGES="de_DE.UTF-8" LC_PAPER="de_DE.UTF-8" LC_NAME="de_DE.UTF-8" LC_ADDRESS="de_DE.UTF-8" LC_TELEPHONE="de_DE.UTF-8" LC_MEASUREMENT="de_DE.UTF-8" LC_IDENTIFICATION="de_DE.UTF-8" LC_ALL=
I don't know where i'm getting this information on android but i guess it's some kind of "de" because all is written in german ;)
The problem seems to be the load information in the received xml:
Load avg1="0,33" avg2="0,24" avg3="0,26"
@MaEngelhard
This is a duplicate of #163
The original problem was that @espenaf phone was not set to the same locale as the his Master Backend.
Our mythtv-services-api implementation reads your default locale and sends that along with the request to the backend. When it receives responses from the backend, it uses this information to parse out specific details (i.e. use comma as decimal separator instead of period, etc.)
When I switch to either of the German languages on my tablet, the app works fine. But, I'd expect it to fail because my English backend is sending periods rather than commas for host:6544/Status/GetStatus
I never retested #163 with Norwegian locale, as I just changed LC_NUMERIC to English for my backends. While using either Norwegian or English settings on phone/tablet.
The frontend can't connect even if the language of the android is English. Changing LC_NUMERIC as suggested by @espenaf works for me too but shouldn't be the solution.
Agreed. Setting the critical label, as you can't even connect.
@dmfrey @tafypz, I don't see the load status used anywhere. Could this be read in as a string rather than a float? Or, is this auto generated code.
@billmeek The status endpoint is not backed by a wsdl, this is the only endpoint that is not part of the services api umbrella. This is only an xml document. In terms of the java code, this is the only "endpoint" that is not autogenerated. This obviously could be changed to be read as a string.
@tafypz, thanks, as long as those would parse OK with the commas, that says the
sets/gets for 0.2[567] could be changed to strings in the API (I can do that.) Then
similar changes would go into MAF. I found those too. I looks like the data doesn't
go into the DB, or for that matter get displayed at this time
.
@dmfrey are you OK with this?
I am OK with that for now. I don't have any plans to use that data off hand. On Oct 13, 2013 5:00 PM, "billmeek" notifications@github.com wrote:
@tafypz https://github.com/tafypz, thanks, as long as those would parse OK with the commas, that says the sets/gets for 0.2[567] could be changed to strings in the API (I can do that.) Then similar changes would go into MAF. I found those too. I looks like the data doesn't go into the DB, or for that matter get displayed at this time.
@dmfrey https://github.com/dmfrey are you OK with this?
— Reply to this email directly or view it on GitHubhttps://github.com/MythTV-Clients/MythTV-Android-Frontend/issues/227#issuecomment-26226996 .
Just pushed 1.0.9. Changes complete in MAF, but I won't push them until Maven Central gets updated. Everything build OK and the Status screen loads normally. I assume there's no other testing required.
I did try setting LC_NUMERIC="de_DE.UTF-8", but it didn't take (after a restart too.) @MaEngelhard, if you have any tips on where you made that change, I'd love to test it before 1.20.2 goes out.
Looks like stars, userRating and progress are floats too. The above may get past the GetStatus issue, but looks like it will fail afterwards.
These are from the generator. Is there any reason we should need these to be in there native form? Definitely not right now, but anything in the future? On Oct 13, 2013 10:16 PM, "billmeek" notifications@github.com wrote:
Looks like stars, userRating and progress are floats too. The above may get past the GetStatus issue, but looks like it will fail afterwards.
— Reply to this email directly or view it on GitHubhttps://github.com/MythTV-Clients/MythTV-Android-Frontend/issues/227#issuecomment-26232673 .
Perhaps it would be useful to print the stars for movies in the future.
There's a userrating in mythconverg's videometadata table looks like the above.
Progress is from the new SendNotification that jya added in 0.27. Not sure MAF would ever want to send messages to the TV screen (caller ID?)
Can't see the GetNumberFormat in the API, maybe it's intended to be automatic. springworks shows it using Locale and that looks at xx, e.g. de.
The following in prints . and , for US or , and . for DE. So we know changing the language really does choose the proper separators. Why the error is thrown... no clue.
DecimalFormatSymbols otherSymbols = new DecimalFormatSymbols( Locale.getDefault() );
Log.e( TAG, "***** decimal seperator = " + otherSymbols.getDecimalSeparator() );
Log.e( TAG, "***** grouping seperator = " + otherSymbols.getGroupingSeparator() );
@billmeek I set 'LC_NUMERIC="en_US.UTF-8"' in /etc/env.d/02locale as well in '~/.bashrc' of the myth user in my gentoo system. Afterwards i restarted the backend for the new settings.
If this isn't working for you i can test it as well.
@MaEngelhard, Oops. It helps to have the German language pack installed!
Without the changes and with LC_NUMERIC="de_DE.UTF-8"
, the failure occurs
as expected.
With the changes and LC_NUMERIC="de_DE.UTF-8"
, the Status screen loads OK.
The Recordings and Guide screens also load, and I verified that there were some
stars
values that had decimal values. I'll be very interested to see if this works for you.
@billmeek
Both screens load here too. Are stars-values displayed anywhere?
No, they aren't used at this time.
However, they are returned in the XML from the Master Backend. I think I see why it's not failing. If you try:
<yourMasterBackend>:6544/Dvr/GetRecordedList
The fractional value in the Stars
field doesn't respect the value of LC_NUMERIC
on my host. Which could mean there's a problem waiting to bite us.
...
<Program>
<StartTime>2013-10-14T15:50:00Z</StartTime>
<EndTime>2013-10-14T18:00:00Z</EndTime>
<Title>The Matrix Revolutions</Title>
...
<Stars>0.625</Stars>
...
I don't know what your listings provider gives you. If you have a chance, could you look in your MythTV database and see if there are any fractional values for these tables?
SELECT title,starttime,stars FROM recorded WHERE stars != 0;
SELECT title,starttime,stars FROM program WHERE stars != 0;
Found a discussion that says mysql ALWAYS inserts decimals with a period. It has to because it also accepts comma separated lists in input and couldn't tell the difference between decimal values and list entries e.g.:
VALUES( 2,2, 4,567, 345,88)
looks like 3 decimal numbers (with , as a decimal point) or 6 integers. How the values
appear when output to the user should honor LC_NUMERIC, but that's not the problem
here. stars
, if used, would likely appear as graphics.
@MaEngelhard, please retest. It doesn't fail on my system, but you should probably be the final judge. 1.20.2 was released 10/15/2013.
Thanks!
@billmeek retested with the released 1.20.2 in the play store but didn't work. BUT with the current git version it works?! I'm a little bit confused right now. ?!?!
I looked in my database and found only decimals as period.
@MaEngelhard,Confusing and scary. I just tried 1.20.2 from the Play Store and it works. And, I verified that http://mc1:6544/Status/GetStatus returned the load averages with commas. Thanks for checking your MythTV DB.
To be clear, did the top of the Navigation Drawer display "MAF 1.20.2" with your most recent Play Store test? (Apologies for asking that question, but there should be exactly one 1.20.2.)
@MaEngelhard, I'm not sure why this worked for you from git and not 1.20.2, but if it's OK in 1.20.3 I'd like to close this.
Is that OK with you?
I'm ok with that. My retest with the 1.20.3 was successful. I believe in my previous test i used an older git version instead of the released 1.20.2. At leased this would explain my results...but for now everything is working.
Thanks for the response and testing! Closing.
I'm running the current beta on a 0.27 backend. The frontent can't connect to the bakend. The reason is a NumberFormatException as followed:
10-13 13:12:21.063: E/BackendStatusHelperV27(12840): org.mythtv.services.api.MythServiceApiRuntimeException: org.springframework.http.converter.HttpMessageNotReadableException: Could not read [class org.mythtv.services.api.v027.status.beans.BackendStatus]; nested exception is java.lang.NumberFormatException: Invalid float: "0,15"; nested exception is org.springframework.http.converter.HttpMessageNotReadableException: Could not read [class org.mythtv.services.api.v027.status.beans.BackendStatus]; nested exception is java.lang.NumberFormatException: Invalid float: "0,15" 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.mythtv.services.api.v027.impl.StatusTemplate.getStatus(StatusTemplate.java:56) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.mythtv.service.status.v27.BackendStatusHelperV27.downloadBackendStatus(BackendStatusHelperV27.java:149) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.mythtv.service.status.v27.BackendStatusHelperV27.process(BackendStatusHelperV27.java:135) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.mythtv.service.status.BackendStatusService.onHandleIntent(BackendStatusService.java:94) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at android.os.Handler.dispatchMessage(Handler.java:99) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at android.os.Looper.loop(Looper.java:137) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at android.os.HandlerThread.run(HandlerThread.java:61) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): Caused by: org.springframework.http.converter.HttpMessageNotReadableException: Could not read [class org.mythtv.services.api.v027.status.beans.BackendStatus]; nested exception is java.lang.NumberFormatException: Invalid float: "0,15" 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.springframework.http.converter.xml.SimpleXmlHttpMessageConverter.readInternal(SimpleXmlHttpMessageConverter.java:115) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.springframework.http.converter.AbstractHttpMessageConverter.read(AbstractHttpMessageConverter.java:147) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.springframework.web.client.HttpMessageConverterExtractor.extractData(HttpMessageConverterExtractor.java:76) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.springframework.web.client.RestTemplate$ResponseEntityResponseExtractor.extractData(RestTemplate.java:655) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.springframework.web.client.RestTemplate$ResponseEntityResponseExtractor.extractData(RestTemplate.java:641) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:484) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:453) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:429) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.mythtv.services.api.v027.impl.StatusTemplate.getStatus(StatusTemplate.java:52) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): ... 7 more 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): Caused by: java.lang.NumberFormatException: Invalid float: "0,15" 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at java.lang.StringToReal.invalidReal(StringToReal.java:63) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at java.lang.StringToReal.parseFloat(StringToReal.java:310) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at java.lang.Float.parseFloat(Float.java:300) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at java.lang.Float.valueOf(Float.java:337) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.transform.FloatTransform.read(FloatTransform.java:55) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.transform.FloatTransform.read(FloatTransform.java:42) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.transform.Transformer.read(Transformer.java:106) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.core.Support.read(Support.java:372) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.core.PrimitiveFactory.getInstance(PrimitiveFactory.java:105) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.core.Primitive.readTemplate(Primitive.java:231) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.core.Primitive.read(Primitive.java:171) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.core.Primitive.read(Primitive.java:126) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.core.Composite.readVariable(Composite.java:623) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.core.Composite.readInstance(Composite.java:573) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.core.Composite.readAttribute(Composite.java:497) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.core.Composite.readAttributes(Composite.java:413) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.core.Composite.access$300(Composite.java:59) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.core.Composite$Builder.read(Composite.java:1382) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.core.Composite.read(Composite.java:201) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.core.Composite.read(Composite.java:148) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.core.Composite.readVariable(Composite.java:623) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.core.Composite.readInstance(Composite.java:573) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframework.xml.core.Composite.readUnion(Composite.java:549) 10-13 13:12:21.063: E/BackendStatusHelperV27(12840): at org.simpleframewo 10-13 13:12:21.063: D/BackendStatusHelperV27(12840): process : exit