Closed molano999 closed 2 months ago
Thanks for the report! I will take a look at it and let you know.
Ok, the null pointer exception is fixed now (v1.8.2). However, the source of the error wasn't the lack of stats for D3 but rather that the app fails to match the provided series ID (2024-softball-ladies-d1
in your example) against the event category ID in the stats API (SLD1
for your example, API link). I use a simple Levenshtein distance to match between the series ID and the category ID which fails for this because the acronym used for the category is so different compared to the series ID.
For reference, it works really well for matching for example the seriesID 2023-elitserien-baseboll
against the category ID SWE-ELITSERIEN-BASEBOLL-M-BB
.
I will look into a way to be better at matching this but for now it won't crash at least. The worst that may happen now is that stats for the current series/season is missing (or picked wrongly from a different series/season).
Thanks!
I poked around and I think you can get the link between series and ID from the "history" that is loaded via https://www.wbsc.org/en/player/struyf-roxanne-646956/history
. See output below. You could use your Levenshtein method to match the provided series ID e.g. 2024-softball-ladies-d1
with the textfield e.g. Softball Ladies D1 2024
It even outputs the correct ID's for all individual games! This would give you the option to not only use "career", but also the "splits" and "gamelogs". Interesting data, although I am not sure how you would put that all in textfiles to be consumed by OBS.....
Let me know if I need to shut up ;-) or if you want to discuss further!
Some of the output is:
const dataset = ({
"elementRS": {
"events": [{
"text": "Softball Ladies D1 2024",
"value": 2202,
"fedId": 143,
"catId": "SLD1"
}, {
"text": "Softball Ladies D3 2024",
"value": 2204,
"fedId": 143,
"catId": "SLD3"
}, {
"text": "Softball Ladies D1 2023",
"value": 1613,
"fedId": 143,
"catId": "SLD1"
}, {
"text": "Softball Ladies D3 2023",
"value": 1629,
"fedId": 143,
"catId": "SLD3"
}, {
"text": "Women\u2019s Softball European Championship 2022",
"value": 1337,
"fedId": 278,
"catId": "EU-CHAMP-W-SB"
}, {
"text": "Softball Ladies D1 2022",
"value": 1392,
"fedId": 143,
"catId": "SLD1"
}],
"federations": [{
"value": 278,
"text": "WBSC Europe"
}, {
"value": 143,
"text": "Koninklijke Belgische Base en Softball Federatie - F\u00e9d\u00e9ration Royale Belge de Base et Softball"
}],
"rounds": [{
"text": "All Rounds",
"value": "all",
"eventId": "all"
}, {
"text": "Round Robin 1",
"value": 1201,
"eventId": 1337,
"catId": "EU-CHAMP-W-SB"
}, {
"text": "Regular Competition",
"value": 1260,
"eventId": 1392,
"catId": "SLD1"
}, {
"text": "Regular season",
"value": 2064,
"eventId": 1613,
"catId": "SLD1"
}, {
"text": "Regular season",
"value": 2146,
"eventId": 1629,
"catId": "SLD3"
}, {
"text": "Regular season",
"value": 3413,
"eventId": 2202,
"catId": "SLD1"
}, {
"text": "Regular season",
"value": 3416,
"eventId": 2204,
"catId": "SLD3"
}, {
"text": "Round Robin 2",
"value": 1641,
"eventId": 1337,
"catId": "EU-CHAMP-W-SB"
}, {
"text": "Final Round Robin",
"value": 1642,
"eventId": 1337,
"catId": "EU-CHAMP-W-SB"
}, {
"text": "Promotion",
"value": 2918,
"eventId": 1629,
"catId": "SLD3"
}, {
"text": "Regular season - Bottom",
"value": 2919,
"eventId": 1629,
"catId": "SLD3"
}, {
"text": "Split",
"value": 3417,
"eventId": 2204,
"catId": "SLD3"
}, {
"text": "Finals",
"value": 1643,
"eventId": 1337,
"catId": "EU-CHAMP-W-SB"
}, {
"text": "Softball Ladies Belgium Series",
"value": 1261,
"eventId": 1392,
"catId": "SLD1"
}, {
"text": "Belgian Series",
"value": 3088,
"eventId": 1613,
"catId": "SLD1"
}, {
"text": "Belgian Series",
"value": 3414,
"eventId": 2202,
"catId": "SLD1"
}],
"games": [{
"text": "All Games",
"value": "all",
"eventId": "all"
}, {
"text": "Beveren Lions@Merchtem Cats",
"value": 92009,
"roundId": 1260,
"eventId": 1392,
"catId": "SLD1"
}, {
"text": "Beveren Lions@Merchtem Cats",
"value": 92012,
"roundId": 1260,
"eventId": 1392,
"catId": "SLD1"
},
Hi, Jeroen from Dutch Federation KNBSB (Honkbal TV)
I used the new version last night and it still crashed on me right after loading all the players for the lineups
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "org.sundbybergheat.baseballstreaming.models.stats.SeriesStats.pitching()" because "thisSeriesStats" is null
[main] ERROR org.sundbybergheat.baseballstreaming.services.PlayByPlayService - Something went wrong. Cannot deserialize value of type int
from String "X": not a valid int
value
at [Source: (StringReader); line: 1, column: 14221] (through reference chain: org.sundbybergheat.baseballstreaming.models.wbsc.PlayImpl$Json["linescore"]->org.sundbybergheat.baseballstreaming.models.wbsc.LineScoreImpl$Json["homeruns"]->java.util.ArrayList[9])
[main] ERROR org.sundbybergheat.baseballstreaming.services.PlayByPlayService - Something went wrong. Cannot deserialize value of type int
from String "X": not a valid int
value
at [Source: (StringReader); line: 1, column: 14359] (through reference chain: org.sundbybergheat.baseballstreaming.models.wbsc.PlayImpl$Json["linescore"]->org.sundbybergheat.baseballstreaming.models.wbsc.LineScoreImpl$Json["homeruns"]->java.util.ArrayList[9])
It seems that the pitching stats contain the value "X", while the code expects only integers. (0,1,....9). And it crashes on that.
Can you give some more lines of the output? The output just before it crashes like I did in the first post here? It would give some more context.
[main] INFO org.sundbybergheat.baseballstreaming.clients.StatsClient - Selecting 'Hoofdklasse Honkbal' career stats for PRINS Scott [main] INFO org.sundbybergheat.baseballstreaming.clients.StatsClient - Fetching stats for PRINS Scott (id=416311) in 'U-18 Baseball World Cup'. [main] INFO org.sundbybergheat.baseballstreaming.clients.StatsClient - Fetching stats for PRINS Scott (id=416311) in 'U-23 Baseball World Cup'. [main] INFO org.sundbybergheat.baseballstreaming.clients.StatsClient - Fetching stats for VAN DER SCHOUW Lucca (id=376477) in 'Hoofdklasse Honkbal'. [main] INFO org.sundbybergheat.baseballstreaming.clients.StatsClient - Selecting 'Hoofdklasse Honkbal' career stats for VAN DER SCHOUW Lucca Exception in thread "main" java.lang.NullPointerException: Cannot invoke "org.sundbybergheat.baseballstreaming.models.stats.SeriesStats.pitching()" because "thisSeriesStats" is null at org.sundbybergheat.baseballstreaming.services.PitcherTools.summaryOfSeries(PitcherTools.java:76) at org.sundbybergheat.baseballstreaming.services.PitcherTools.pitcherNarrative(PitcherTools.java:26) at org.sundbybergheat.baseballstreaming.services.FilesService.updatePitcher(FilesService.java:232) at org.sundbybergheat.baseballstreaming.services.FilesService.updateLineups(FilesService.java:765) at org.sundbybergheat.baseballstreaming.services.FilesService.updateState(FilesService.java:104) at org.sundbybergheat.baseballstreaming.services.FilesService.updatePlay(FilesService.java:98) at org.sundbybergheat.baseballstreaming.services.PlayByPlayService.run(PlayByPlayService.java:85) at org.sundbybergheat.baseballstreaming.App.main(App.java:144)
Sorry above is the correct log from the game last night
java -jar /Users/mpls/Downloads/game2/baseball-streaming-v1.8.2.jar -t /Users/mpls/Downloads/game2 -S https://stats.knbsbstats.nl -s 2024-lucky-day-hoofdklasse-honkbal -g 129205
Thanks for reporting! I made a mistake in the earlier fix and forgot to include that use of thisSeriesStats inside the null-checked block. It is fixed now in v1.8.3.
Oh great! We have 4 games tonight. I will report back!
Thanks keero for all you do with this amazing program! It really helps a lot. I wish I could code java, but my programming knowledge stops at some basic Powershell.
Did you take a look at my proposal above to get the correct series (and maybe include even some more stats)?
No, I haven't looked at it yet but the idea you have is good I think! I will look into it when I get the time.
Hi, I still get error and can't resume the live stats on v1.83
[main] INFO org.sundbybergheat.baseballstreaming.services.PlayByPlayService - Play # 149 (2024-04-25T19:40:34.739Z): Swinging Strike 2.
[main] WARN org.sundbybergheat.baseballstreaming.services.FilesService - No stats for batter DOMETILIA Jerson (id=407673)
[main] WARN org.sundbybergheat.baseballstreaming.services.FilesService - No stats for batter DOMETILIA Jerson (id=407673)
[main] INFO org.sundbybergheat.baseballstreaming.clients.StatsClient - Fetching stats for WEBB Emon (id=407665) in 'Hoofdklasse Honkbal'.
https://stats.knbsbstats.nl/api/v1/player/stats?tab=career&fedId=1&eventCategory=HOOFDKLASSE-HONKBAL&pId=789100
[main] INFO org.sundbybergheat.baseballstreaming.clients.StatsClient - Selecting 'Hoofdklasse Honkbal' career stats for WEBB Emon
[main] INFO org.sundbybergheat.baseballstreaming.services.PlayByPlayService - Play # 151 (2024-04-25T19:40:46.444Z): Middle of the 5th
0 runs, 0 lob
[main] WARN org.sundbybergheat.baseballstreaming.services.FilesService - No stats for batter DOMETILIA Jerson (id=407673)
[main] WARN org.sundbybergheat.baseballstreaming.services.FilesService - No stats for batter DOMETILIA Jerson (id=407673)
[main] INFO org.sundbybergheat.baseballstreaming.clients.StatsClient - Fetching stats for SAMBOE Jiairo (id=407660) in 'Hoofdklasse Honkbal'.
https://stats.knbsbstats.nl/api/v1/player/stats?tab=career&fedId=1&eventCategory=HOOFDKLASSE-HONKBAL&pId=99428
[main] INFO org.sundbybergheat.baseballstreaming.clients.StatsClient - Selecting 'Hoofdklasse Honkbal' career stats for SAMBOE Jiairo
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "org.sundbybergheat.baseballstreaming.models.stats.SeriesStats.pitching()" because "thisSeriesStats" is null
at org.sundbybergheat.baseballstreaming.services.PitcherTools.pitcherNarrativeTitle(PitcherTools.java:39)
at org.sundbybergheat.baseballstreaming.services.FilesService.updatePitcher(FilesService.java:235)
at org.sundbybergheat.baseballstreaming.services.FilesService.updateLineups(FilesService.java:765)
at org.sundbybergheat.baseballstreaming.services.FilesService.updateState(FilesService.java:104)
at org.sundbybergheat.baseballstreaming.services.FilesService.updatePlay(FilesService.java:98)
at org.sundbybergheat.baseballstreaming.services.PlayByPlayService.run(PlayByPlayService.java:85)
at org.sundbybergheat.baseballstreaming.App.main(App.java:144)
Hello, sorry about that. There was yet another place a null pointer check was missing. Now it is fixed. Let me know how it works out. https://github.com/keero/baseball-streaming/releases/tag/v1.8.4
Thank you man. I appreciate it. We have 6 games on Sunday. Will let you know how I get on
Hi, Last couple of days we had 10 games. I had no more "break out" errors anymore which was great! The only thing I'm experiencing is that some games don't end the way they should:
[main] INFO org.sundbybergheat.baseballstreaming.clients.StatsClient - Selecting 'Hoofdklasse Honkbal' career stats for TOLENAARS Marcel
[main] INFO org.sundbybergheat.baseballstreaming.services.PlayByPlayService - Play # 307 (2024-04-30T20:21:08.179Z): Foul.
[main] INFO org.sundbybergheat.baseballstreaming.services.PlayByPlayService - Play # 308 (2024-04-30T20:21:32.946Z): Called Strike 2.
[main] INFO org.sundbybergheat.baseballstreaming.services.PlayByPlayService - Play # 309 (2024-04-30T20:21:52.205Z): Ball 1.
[main] ERROR org.sundbybergheat.baseballstreaming.services.PlayByPlayService - Something went wrong. Cannot deserialize value of type int
from String "X": not a valid int
value
at [Source: (StringReader); line: 1, column: 15696] (through reference chain: org.sundbybergheat.baseballstreaming.models.wbsc.PlayImpl$Json["linescore"]->org.sundbybergheat.baseballstreaming.models.wbsc.LineScoreImpl$Json["homeruns"]->java.util.ArrayList[9])
[main] ERROR org.sundbybergheat.baseballstreaming.services.PlayByPlayService - Something went wrong. Cannot deserialize value of type int
from String "X": not a valid int
value
at [Source: (StringReader); line: 1, column: 15696] (through reference chain: org.sundbybergheat.baseballstreaming.models.wbsc.PlayImpl$Json["linescore"]->org.sundbybergheat.baseballstreaming.models.wbsc.LineScoreImpl$Json["homeruns"]->java.util.ArrayList[9])
Where Play #309 is the last play of the game it keeps repeating:
[main] ERROR org.sundbybergheat.baseballstreaming.services.PlayByPlayService - Something went wrong. Cannot deserialize value of type int
from String "X": not a valid int
value
at [Source: (StringReader); line: 1, column: 15696] (through reference chain: org.sundbybergheat.baseballstreaming.models.wbsc.PlayImpl$Json["linescore"]->org.sundbybergheat.baseballstreaming.models.wbsc.LineScoreImpl$Json["homeruns"]->java.util.ArrayList[9])
Lately I have a lot of games break down on:
at [Source: (StringReader); line: 1, column: 769] (through reference chain: org.sundbybergheat.baseballstreaming.models.wbsc.PlayImpl$Json["situation"])
[main] ERROR org.sundbybergheat.baseballstreaming.services.PlayByPlayService - Something went wrong. Cannot construct instance of org.sundbybergheat.baseballstreaming.models.wbsc.SituationImpl
, problem: Cannot build Situation, some of required attributes are not set [pitcherThrows]
No stats come trough until the pitcher is changed after that. It keeps repeating the error
Lately I have a lot of games break down on:
at [Source: (StringReader); line: 1, column: 769] (through reference chain: org.sundbybergheat.baseballstreaming.models.wbsc.PlayImpl$Json["situation"]) [main] ERROR org.sundbybergheat.baseballstreaming.services.PlayByPlayService - Something went wrong. Cannot construct instance of
org.sundbybergheat.baseballstreaming.models.wbsc.SituationImpl
, problem: Cannot build Situation, some of required attributes are not set [pitcherThrows]No stats come trough until the pitcher is changed after that. It keeps repeating the error
Are you using the latest version? This problem was supposed to be fixed in version 1.9.3 https://github.com/keero/baseball-streaming/releases/tag/v1.9.3
I am NOT using the latest version! :-( Sorry my bad. I missed the latest version. Thank you for pointing this out to me.
No worries, let me know if the problem remains after upgrading.
1 off our live games now. I get this error:
[main] INFO org.sundbybergheat.baseballstreaming.services.PlayByPlayService - Play # 7 (2024-05-16T17:34:52.979Z): BENTURA Railison flies out to right field. F9. 2 out.
[main] ERROR org.sundbybergheat.baseballstreaming.services.PlayByPlayService - Something went wrong. Cannot deserialize value of type java.util.ArrayList<java.lang.Integer>
from Object value (token JsonToken.START_OBJECT
)
at [Source: (String)"{"debug_lastplay":8,"lastplayloaded":8,"gameid":"129241","debugcode":"412114","eventlocation":"Haarlem","eventhome":"DKI","eventaway":"TWI","eventhomeid":"28594","eventawayid":"28600","eventurl":"","gameover":0,"innings":"9","platecount":[{"id":2,"type":0,"label":"Middle of the 1st
0 runs, 0 lob","pitch":"Unknown","coords":[0,0]},{"id":1,"type":3,"label":"VISSER Luuk grounds out 4-3. 3 out. ","pitch":"Unknown","coords":[0,0]}],"situation":{"inning":"1.1","uniform":"standard-home","gender":"","[truncated 12295 chars]; line: 1, column: 11125] (through reference chain: org.sundbybergheat.baseballstreaming.models.wbsc.PlayImpl$Json["linescore"]->org.sundbybergheat.baseballstreaming.models.wbsc.LineScoreImpl$Json["awayruns"])
After an 1nn everything seems to be running ok again
Today I got another "null" error
[main] ERROR org.sundbybergheat.baseballstreaming.services.PlayByPlayService - Something went wrong. Cannot construct instance of org.sundbybergheat.baseballstreaming.models.wbsc.PlayImpl
, problem: Cannot invoke "java.lang.Iterable.iterator()" because "elements" is null
at [Source: (String)"{"debug_lastplay":-1,"lastplayloaded":-1,"gameid":"129280","debugcode":"417622","eventlocation":"Amsterdam","eventhome":"AMS","eventaway":"NEP","eventhomeid":"28593","eventawayid":"28597","eventurl":"","gameover":0,"innings":"9","platecount":null,"situation":{"inning":"1.0","uniform":"standard-home","gender":"","batter":"VAN DER MEER Stijn","batterid":"417622","bats":"L","batting":"0 for 0","avg":".000","pitcher":"VAN DE SANDEN Sven","pitcherid":"416315","pitcherthrows":"R","pitcherera":"99.99","[truncated 10699 chars]; line: 1, column: 11199]
[main] ERROR org.sundbybergheat.baseballstreaming.services.PlayByPlayService - Something went wrong. Cannot construct instance of org.sundbybergheat.baseballstreaming.models.wbsc.PlayImpl
, problem: Cannot invoke "java.lang.Iterable.iterator()" because "elements" is null
Hello,
I am not sure if this is related to the new stats implementation, but I have some troubles using your program (and I heard the same from the NL-league....).
In my case, I had several crashes during receiving of stats from certain players. Let's take player "Roxanne Struyf" as an example. Her stats are on https://www.baseballsoftball.be/en/events/2024-softball-ladies-d1/teams/29392/players/385868
She is an SD1 player, but is also eligible for SD3. However, since she never plays there, no stats are available. And it seems your program crashes on that void.
Here is the output of the game replay I just did, and it still crashes.
Sometimes, it would just pass Roxanne and continue, but then it would fail on another player in the same situation. When restarting, it would fail again on Roxanne or on another player. I find it strange that it would sometimes pass Roxanne and just continues going. Also, more to the end of the game (after they had an AB already??) it kept working.
E.g.:
or
I think you just need to catch that exception and assume no stats are available in that series (D3 in this case).
Some people in NL contacted me about a similar problem. I think it is exactly the same error.:
I hope you can explain what's happeing and I hope you can resolve it!
Thank you in advance!