Hello,

I am trying to access MySQL in my code for a recommender class. Here is the
code snippet. It is failing in the statement highlighted with ==> below. I
have tried the default constructor as well as the one with database name,
user and item column names etc.

MysqlDataSource dataSource = new MysqlDataSource();
dataSource.setServerName("localhost");
dataSource.setPort(3306);
dataSource.setUser("validuser");
dataSource.setPassword("validpassword");
dataSource.setDatabaseName("correctdatabasename");
==> //JDBCDataModel model = new MySQLJDBCDataModel(dataSource);
==> JDBCDataModel model = new MySQLJDBCDataModel
    (dataSource, "taste_preferences", "user_id", "item_id",
"preferences",null);

My import list is as below

import org.apache.mahout.cf.taste.common.TasteException;
import org.apache.mahout.cf.taste.impl.model.file.*;
import org.apache.mahout.cf.taste.impl.neighborhood.*;
import org.apache.mahout.cf.taste.impl.recommender.*;
import org.apache.mahout.cf.taste.impl.similarity.*;
import org.apache.mahout.cf.taste.model.*;
import org.apache.mahout.cf.taste.neighborhood.*;
import org.apache.mahout.cf.taste.recommender.*;
import org.apache.mahout.cf.taste.similarity.*;
import org.apache.mahout.cf.taste.impl.recommender.slopeone.*;
import org.apache.mahout.cf.taste.impl.model.jdbc.*;

import java.io.*;
import java.util.*;

import com.mysql.jdbc.jdbc2.optional.MysqlDataSource;

I do have the MySQL and Mahout (mahout-core, mahout-math, mahout-util) jar
files included in the project's build path. I am using version 0.5. 

The code is included in try-catch block with TasteException.

When I run it in Eclipse Indigo debugger the statements (highlighted with
==>) take me to class not found exception. 

Please let me know what could be going wrong.

Thanks.

Rahul

--
View this message in context: 
http://lucene.472066.n3.nabble.com/Classnotfound-exception-while-using-MySQLJDBCDataModel-tp3960093.html
Sent from the Mahout Developer List mailing list archive at Nabble.com.

Reply via email to