[OTDev] loading an ARFF file with DataSource class does not work in Tomcat 6

Tobias Girschick girschic at in.tum.de
Wed May 13 15:35:36 CEST 2009


Hello everybody,

while playing around with Tomcat, Weka and Restlets I tracked down a bug 
in either a Weka class or Tomcat. I'm not sure yet. Just in case anybody 
is using Tomcat6 and Weka >3.5.5 be aware of it. Here my posting to the 
WekaList:

    I am building a Restlet WebService which uses some Weka classes. I
    developed the service with a small standalone server that's coming
    with Restlet and everything worked fine. I packed everything in a
    .war web archive and deployed it with Tomcat (version 6). I received
    an error that the class weka.core.Environment could not be
    initialized. After some messing around I found out that the problem
    was the DataSource class. As I am using Weka version 3.6.0, I used
    the proposed procedure to load my ARFF input file:

    DataSource source = new DataSource("/some/where/data.arff");
    Instances data = source.getDataSet();

    The old way is working fine:

    Instances data = new Instances(new BufferedReader(new
    FileReader("/some/where/data.arff")));

    Just to make sure Tomcat6 is not using any old Weka version I
    printed out the Weka Version from the code:

    logger.info(Version.VERSION);

    and got 3.6.0. So this is fine.

    I just wanted to report this bug in case anybody comes across the
    same weird bahavior, which took me quite some time to track down.

Regards,

-- 
Dipl.-Bioinf. Tobias Girschick

Technische Universität München
Institut für Informatik 
Lehrstuhl I12 - Bioinformatik
Bolzmannstr. 3
85748 Garching b. München, Germany

Room: MI 01.08.059 
Phone: +49 (89) 289-18002 
Email: tobias.girschick at in.tum.de
Web: http://wwwkramer.in.tum.de/people/girschic



More information about the Development mailing list