Closed shaunidiot closed 7 years ago
Looks like the XML data is broken for those profiles. Do you have examples or does it fail for all profiles?
Dates have always been problematic in the XML data because of various format changes and inconsistencies.
I did a quick test on an Android app.
new AsyncTask<Void, Void, Void>() {
@Override
protected Void doInBackground(Void... voids) {
ArrayList<String> names = new ArrayList<String>();
// add 6 usernames here. 5 were public profiles. 1 was private.
for (String name : names) {
try {
SteamId id = SteamId.create(name);
Log.e("Id64", Long.toString(id.getSteamId64()));
} catch (Exception e) {
e.printStackTrace();
}
}
return null;
}
}.execute();
Results : Only the first and the last returned the SteamId64. The rest returned the same error.
com.github.koraktor.steamcondenser.exceptions.SteamCondenserException: XML data could not be parsed.
Caused by: java.text.ParseException: Unparseable date: "November 18null, 2012, 2015" (at offset 11)
Took a look in the profile xml files for memberSince tag. First: December 21st, 2010 Second: May 14th, 2006 Third: June 4th, 2011 Fourth: November 18th, 2012 FIfth: September 10th, 2011 Sixth: Private profile. So the Steam64Id was returned.
The date for all of them is similar, so the one causing the crash on the second to fifth profile was pretty weird. The code seems to be unable to parse the date and causing it to run
this.memberSince = DATE_FORMAT.parse(memberSince + ", " + Calendar.getInstance().get(Calendar.YEAR));
Thanks a lot, and sorry for any English sentence error.
Do you have any profile IDs or custom URLs that I can check?
Will remove when you've replied me. The above result is used in this order.
removed
Ok, I'll have a look.
Sorry, I'm unable to reproduce this problem. All of the provided example profiles work for me.
Can you give some information about your environment? Java version and locale in particular.
I got a feeling it's due to the Java environment I'm working on/targeted for the Android project. I'm using JDK v 1.8.0_31.
I am having the same problem.
com.github.koraktor.steamcondenser.exceptions.SteamCondenserException: XML data could not be parsed: null at com.github.koraktor.steamcondenser.steam.community.XMLData.<init>(XMLData.java:70) com.github.koraktor.steamcondenser.steam.community.SteamId.fetchData(SteamId.java:330) com.github.koraktor.steamcondenser.steam.community.SteamId.<init>(SteamId.java:299) com.github.koraktor.steamcondenser.steam.community.SteamId.create(SteamId.java:237) com.github.koraktor.steamcondenser.steam.community.SteamId.create(SteamId.java:175)
It happens when you allow the library to fetch the id's data on creation, and seems to be happening regardless of what I put in.
I am also using this with an android application
Can you provide example profiles?
I haven't been able to get it to work, so I have been using the profile "demomenz" which I found on the usage section of the website
@liammcnabb What Java and Steam Condenser version are you using?
This code works flawlessly for me:
SteamId id = SteamId.create("demomenz", true);
The exception you posted hints at some JRE internal problem when parsing the XML. Can you also post the root exception that caused the SteamCondenserException
(see #getCause
).
I guess there’s no way to reproduce this now.
I have 2 Android applications using Steam Condenser for Java. Recently, both of them have failed to work due to the same problem. Unparsable date.
An example of the error log.
The code I'm using:
Any idea on how to solve it? Thank you!