Hi Lewis,

In the exception log, I see MockDataStore, rather than HBaseStore, and this
might indicate that the configuration cannot be found, or is not showing
the correct data store. Could you please check whether gora.properties is
setup to show the actual HBaseStore, and this is included in the classpath.
Did you check out the source code from scratch?

Thanks,
Enis

On Wed, Nov 23, 2011 at 7:32 AM, Lewis John Mcgibbney <
[email protected]> wrote:

> Hi Guys,
>
> Was going through the main tutorial with a student today and ran into a
> ClassCastException, which I have appended to this thread. This is
> encountered in most recent trunk when attempting to run a parse with the
> logmanager, having already compiled the Avro schema and defined the
> mapping.
>
> Please correct me if I'm not seeing this clearly, but does the parse method
> not try to read the String line, which is specified in both
> gora-hbase-mapping and gora-sql-mapping.xml as keyClass="java.lang.Long".
> Is it here, or somewhere else that there is a mismatch in data types?
>
> Thanks
>
>  /**
>   * Parses a log file and store the contents at the data store.
>   * @param input the input file location
>   */
>  private void parse(String input) throws IOException, ParseException {
>    log.info("Parsing file:" + input);
>    BufferedReader reader = new BufferedReader(new FileReader(input));
>    long lineCount = 0;
>    try {
>      String line = reader.readLine();
>      do {
>        Pageview pageview = parseLine(line);
>
>        if(pageview != null) {
>          //store the pageview
>          storePageview(lineCount++, pageview);
>        }
>
>        line = reader.readLine();
>      } while(line != null);
>
>    } finally {
>      reader.close();
>    }
>    log.info("finished parsing file. Total number of log lines:" +
> lineCount);
>  }
>
>
>
> lewis@lewis-desktop:~/ASF/gora_trunk$ bin/gora logmanager -parse
> gora-tutorial/src/main/resources/access.log
> Exception in thread "main" java.lang.ClassCastException: java.lang.Long
> cannot be cast to java.lang.String
>    at org.apache.gora.mock.store.MockDataStore.put(MockDataStore.java:36)
>    at
> org.apache.gora.tutorial.log.LogManager.storePageview(LogManager.java:140)
>    at org.apache.gora.tutorial.log.LogManager.parse(LogManager.java:91)
>    at org.apache.gora.tutorial.log.LogManager.main(LogManager.java:240)
>
>
> --
> *Lewis*
>

Reply via email to