Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

Ant SDK and NoClassDefFoundError when running FitToCSV.bat file

Rank

Total Posts: 9

Joined 2014-03-19

PM

Hi,

I tryed to execute FitToCSV.bat in order to generate csv file from Fit file and I keep getting following error:

Exception in thread "main" java.lang.NoClassDefFoundError: com/garmin/fit/MesgNum
at com.garmin.fit.MesgDefinition.<init>(MesgDefinition.java:30)
at com.garmin.fit.Decode.read(Decode.java:504)
at com.garmin.fit.Decode.resume(Decode.java:256)
at com.garmin.fit.Decode.read(Decode.java:233)
at com.garmin.fit.csv.CSVTool.main(CSVTool.java:164)
Caused by: java.lang.ClassNotFoundException: com.garmin.fit.MesgNum
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 5 more

And indeed there is no such class file in the jar file (com.garmin.fit.MesgNum). I executed the fitgen.exe to generate all the required files prior executing the bat file above. I didn't get any errors when I executed the exe file.

Any ideas?

Operating system: Windows 7 Pro (64bit)
java -version:
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)

Sincerely,
Arsi      
RankRankRank

Total Posts: 91

Joined 2012-10-12

PM

Hi Arsi, What happens if you use the original FitCSVTool.jar found in the latest FIT SDK archive? You can invoke it with something like java -jar fitcsvtool.jar -b myfile.fit decoded.csv      
Rank

Total Posts: 9

Joined 2014-03-19

PM

ShaneP - 19 March 2014 09:40 AM
Hi Arsi, What happens if you use the original FitCSVTool.jar found in the latest FIT SDK archive? You can invoke it with something like java -jar fitcsvtool.jar -b myfile.fit decoded.csv


Hiya,

Here's what happens:
[C:\Users\xxx\Downloads\FitSDKRelease_10.10\java] java -jar FitCSVTool.jar -b ..\examples\Activity.fit .\decoded.csv
FIT CSV Tool 1.0.10.10
Exception in thread "main" java.lang.NoClassDefFoundError: com/garmin/fit/MesgNum
at com.garmin.fit.MesgDefinition.<init>(MesgDefinition.java:30)
at com.garmin.fit.Decode.read(Decode.java:504)
at com.garmin.fit.Decode.resume(Decode.java:256)
at com.garmin.fit.Decode.read(Decode.java:233)
at com.garmin.fit.csv.CSVTool.main(CSVTool.java:164)
Caused by: java.lang.ClassNotFoundException: com.garmin.fit.MesgNum
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 5 more
     
RankRankRank

Total Posts: 91

Joined 2012-10-12

PM

Hi Arsi,
-I tried updating to the same java version but I still can't reproduce your issue. Can you try the other sample .jar files (maybe java -jar fitencodeexample.jar)? Do you have access to another java station you could try running for comparison?      
Rank

Total Posts: 9

Joined 2014-03-19

PM

ShaneP - 20 March 2014 04:14 PM
Hi Arsi,
-I tried updating to the same java version but I still can't reproduce your issue. Can you try the other sample .jar files (maybe java -jar fitencodeexample.jar)? Do you have access to another java station you could try running for comparison?


Hi,

This what happends when I executed that example jar:
C:\Users\xxx\Downloads\FitSDKRelease_10.10\java> java -jar FitEncodeExample.jar
FIT Encode Example Application
Exception in thread "main" java.lang.NoClassDefFoundError: com/garmin/fit/Factory
at com.garmin.fit.FileIdMesg.<init>(FileIdMesg.java:50)
at com.garmin.fit.examples.EncodeExample.main(EncodeExample.java:35)
Caused by: java.lang.ClassNotFoundException: com.garmin.fit.Factory
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 2 more

I don't have other environment to run these tests sorry.

Arsi      
Rank

Total Posts: 9

Joined 2014-03-19

PM

Today I updated to the Fit SDK release 10.20 and the command: java -jar FitEncodeExample.jar did gave the same exact error:
C:\Users\xxxDownloads\FitSDKRelease_10.20\java>java -jar FitEncodeExample.jar
FIT Encode Example Application
Exception in thread "main" java.lang.NoClassDefFoundError: com/garmin/fit/Factory
at com.garmin.fit.FileIdMesg.<init>(FileIdMesg.java:50)
at com.garmin.fit.examples.EncodeExample.main(EncodeExample.java:35)
Caused by: java.lang.ClassNotFoundException: com.garmin.fit.Factory
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 2 more

Any ideas how to try to fix this? is there some log files, etc you'd like to have to try to get this issue sorted?      
RankRankRank

Total Posts: 91

Joined 2012-10-12

PM

Hi Arsi,

I haven't been able to reproduce this issue on any of the machines I have available here. It is possible there is some issue with your Java install. Are you able to use your environment for other Java development?      
Rank

Total Posts: 9

Joined 2014-03-19

PM

ShaneP - 10 April 2014 01:38 PM
Hi Arsi,

I haven't been able to reproduce this issue on any of the machines I have available here. It is possible there is some issue with your Java install. Are you able to use your environment for other Java development?


Hi,

Well I downloaded the 10.20 SDK in my Macbook pro with Mavericks, and the command of java -jar FitEncodeExample.jar worked just fine:

java -jar FitEncodeExample.jar
FIT Encode Example Application
Encoded FIT file test
.fit