1

I have read this thread and as it says I must have public static void main(java.lang.String[] args) my main function is like this:

public static void main(String[] args) throws FileNotFoundException, IOException, TrieException, TSException  {
        CSVReader reader=new CSVReader(new FileReader(".//Data//test1.csv"));
        String[] nextline;
        int linenumber=0;
        double[] numbers=new double[10]; 
        double[] times=new double[10];
        for(int i=0;i<=7;i++)
        {
            nextline = reader.readNext();
            numbers[i]= Double.parseDouble(nextline[0]); 
            times[i]=i;      
        }
        DiscordsAndMotifs dr= edu.hawaii.jmotif.sax.SAXFactory.series2DiscordsAndMotifs(numbers, 4, 2, 2, 2,null);// If I comment this line of code, my programm works without any error

    }

If I run my program, I get this error:

Exception in thread "main" java.lang.NoSuchMethodError: org.hackystat.utilities.logger.HackystatLogger.getLogger(Ljava/lang/String;Ljava/lang/String;) Ljava/util/logging/Logger;
  at edu.hawaii.jmotif.sax.SAXFactory.<clinit>(SAXFactory.java:51)
  at motif.discovery.MotifDiscovery.main(MotifDiscovery.java:35)`

I have required library in my project. What is the cause of this error? could you please help me to solve this problem?

Community
  • 1
  • 1
Kaja
  • 2,591
  • 15
  • 46
  • 86
  • You may have HackystatLogger in a jar somewhere but are you sure you have the right version and that a method getLogger(Ljava/lang/String;Ljava/lang/String;) exists in your jar ? – Julien Oct 14 '13 at 15:40
  • I have the jar in my library but what I see in the jar is a function like this:` public static Logger getLogger(String loggerName) {` – Kaja Oct 14 '13 at 15:42

2 Answers2

5

It sounds like the version of hackystat-utilities that you're using is different to the version that jmotif was built against - so the jmotif jar file contains a reference to a method which isn't present at execution time.

I suggest you find out which version of hackystat-utilities the jmotif library requires, and use that.

Jon Skeet
  • 1,261,211
  • 792
  • 8,724
  • 8,929
  • Do you know how can I finde it? Is it somewher in source code of jmotif? – Kaja Oct 14 '13 at 15:39
  • 2
    @Kaja: I haven't used either library myself, so I can't really help you without doing more research - which is basically the kind of research you can do yourself, I'm afraid. – Jon Skeet Oct 14 '13 at 15:45
0

the logging jar required by edu.hawaii.jmotif.sax.SAXFactory.series2DiscordsAndMotifs(numbers, 4, 2, 2, 2,null) is missing, try import apache common logging jar or log4j jar to your project.

Wen
  • 1
  • Thank you for your answer. I have added these libraries, but I have still the above exception :/ – Kaja Oct 15 '13 at 12:39