jpretori / SoaringCoach

Soaring Coach aims to help pilots improve their soaring performance by intelligently analysing IGC files.
GNU Affero General Public License v3.0
4 stars 3 forks source link

igc_mapping.xml error on v1.1.0 #59

Closed iamambrus closed 6 years ago

iamambrus commented 6 years ago

Hi, experimenting with the backend but it fails, could you please help?

starting backend server

java -Dserver.port=9876 -jar SoaringCoach-1.1.0.jar

sending test file

curl -X POST -F file=@768V19A2.igc http://localhost:9876/upload

result

{"timestamp":1509834636286,"status":500,"error":"Internal Server Error","exception":"org.beanio.BeanIOException","message":"Failed to load 'src/main/resources/igc_mapping.xml' from the file system","path":"/upload"}

IGC file used: https://skylines.aero/files/768v19a2.igc Flight: https://skylines.aero/flights/77585

FYI this is on OS X, java version: java version "1.8.0_66" Java(TM) SE Runtime Environment (build 1.8.0_66-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)

jpretori commented 6 years ago

Hi Ambrus,

I may have to take some time to reproduce it before being much help. But let me try.

From the error message you sent it seems it isn't finding the mapping file that tells beanIO how to convert the igc file entries into Java objects.

For some reason your version of the JAR file either doesn't have igc_mapping.xml, or it isn't in the right folder.

Tell me, what steps do you take to build the jar file?

-Johan Sent from mobile

On 5 Nov 2017 00:36, "Ambrus Vancso" notifications@github.com wrote:

Hi, experimenting with the backend but it fails, could you please help? starting backend server

java -Dserver.port=9876 -jar SoaringCoach-1.1.0.jar sending test file

curl -X POST -F file=@768V19A2.igc http://localhost:9876/upload result

{"timestamp":1509834636286,"status":500,"error":"Internal Server Error","exception":"org.beanio.BeanIOException","message":"Failed to load 'src/main/resources/igc_mapping.xml' from the file system","path":"/upload"}

IGC file used: https://skylines.aero/files/768v19a2.igc Flight: https://skylines.aero/flights/77585

FYI this is on OS X, java version: java version "1.8.0_66" Java(TM) SE Runtime Environment (build 1.8.0_66-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jpretori/SoaringCoach/issues/59, or mute the thread https://github.com/notifications/unsubscribe-auth/APcTVzVMIOpbiGRhc38YsJfSPvYTBqvuks5szOcAgaJpZM4QSL27 .

iamambrus commented 6 years ago

Hey Johan, thanks for the quick reply. I've just used the jar from the releases section. Would you rather recommend to try to build it from scratch?

jpretori commented 6 years ago

Hi Ambrus,

I managed to reproduce the problem. It has to do with how I coded up the integration with BeanIO (I think). Due to normal everyday life being what it is, it will take me some days to get around to fixing it and making a new build.

Meanwhile, of you're that way inclined you're welcome to attempt a fix & send me a PR?

If you'd like to do this, look at soaringcoach.FlightAnalyser:148. I'm pretty sure that, instead of doing what it's doing right now - it needs to work according to the answer to this StackOverflow question: https://stackoverflow.com/questions/20389255/reading-a-resource-file-from-within-jar. I think this because, if you unzip the jar file you'll see igc_mapping.xml sitting right there in the root. So it's there - just not in the folder it's expected.

If you'd rather not fiddle with the source code, you can try running it from sources, using gradle: ./gradlew bootRun ( https://github.com/jpretori/SoaringCoach/blob/master/CONTRIBUTING.md).

Looking forward to hearing more from you!

Regards, Johan

On 6 Nov 2017 00:37, "Ambrus Vancso" notifications@github.com wrote:

Hey Johan, thanks for the quick reply. I've just used the jar from the releases section. Would you rather recommend to try to build it from scratch?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jpretori/SoaringCoach/issues/59#issuecomment-342011802, or mute the thread https://github.com/notifications/unsubscribe-auth/APcTV8rUufNlvbl5UetHqSJqERqsiNxDks5szji3gaJpZM4QSL27 .

jpretori commented 6 years ago

Hello @iamambrus,

I had some unexpected time available and used it to fix the problem, it now works when you run it using java from the commandline (I've only updated "develop" branch so far).

Interestingly, your flight recorder (an LXNav Nano if I read the file correctly?) - created the first few "B" records in the IGC file with lat/long of all zero's (i.e. someplace on the equator). Skylines seems to just ignore this, while Soaring Coach is not (yet) as clever. It reports that your first bit of flying straight started at 9:50:32, distance ~5500km and ground speed over 251000 meters per second!

Do you perhaps know if this is something that the Nano does frequently, or if there's some special circumstance going on to cause this?

jpretori commented 6 years ago

I have sent LXNav an inquiry to ask for a reliable method to distinguish between the first few (inaccurate) fixes, and the others.

iamambrus commented 6 years ago

That was quick @jpretori thank you! Built the dev branch and works fine indeed. Yep, it's a Nano and while I've seen this behaviour elsewhere wasn't aware it's there. Get's ignored by SeeYou as well I reckon. Cheers, Ambrus

jpretori commented 6 years ago

Good news - thanks for contributing!