I've tried installing Recommender API twice to a clean Drupal install but cant. I have downloaded both the release sources and svn sources form Mahoute but there seems to be a problem with my installation.
If I don't have anything in my async_command module queue run.sh runs fine:

macoute@asturia:/var/www/vhosts/ottomatias.com/html/tiedotteet/open/drupal-7.12/sites/all/modules/recommender$ ./run.sh
../../../../sites/all/modules/recommender/recommender.jar:../../../../sites/all/modules/async_command/drupal-app.jar:../../../../sites/all/modules/async_command/lib/*:../../../../sites/all/libraries/trunk/*
Mar 1, 2012 4:05:29 PM org.drupal.project.async_command.CommandLineLauncher launch
INFO: DrupalApp VERSION: 7_2_9
Mar 1, 2012 4:05:29 PM org.drupal.project.async_command.CommandLineLauncher handleSettings
INFO: Set configuration file as: config.properties
Mar 1, 2012 4:05:29 PM org.drupal.project.async_command.DrupalConnection testConnection
INFO: Database connection successful: MySQL5.1.49-3
Mar 1, 2012 4:05:29 PM org.drupal.project.async_command.GenericDrupalApp runSerial
INFO: Total number of commands to run: 0
Mar 1, 2012 4:05:29 PM org.drupal.project.async_command.GenericDrupalApp run
INFO: Shutdown parallel executor.
Mar 1, 2012 4:05:29 PM org.drupal.project.async_command.GenericDrupalApp run
INFO: Running the DrupalApp is accomplished.
Mar 1, 2012 4:05:29 PM org.drupal.project.async_command.CommandLineLauncher launch
INFO: Mission accomplished.

The first line is my $CLASSPATH

However, when I add anything to async_command (eg. Browsing History Recommender) it fails:

../../../../sites/all/modules/recommender/recommender.jar:../../../../sites/all/modules/async_command/drupal-app.jar:../../../../sites/all/modules/async_command/lib/*:../../../../sites/all/libraries/trunk/*
Mar 1, 2012 4:06:40 PM org.drupal.project.async_command.CommandLineLauncher launch
INFO: DrupalApp VERSION: 7_2_9
Mar 1, 2012 4:06:40 PM org.drupal.project.async_command.CommandLineLauncher handleSettings
INFO: Set configuration file as: config.properties
Mar 1, 2012 4:06:40 PM org.drupal.project.async_command.DrupalConnection testConnection
INFO: Database connection successful: MySQL5.1.49-3
Mar 1, 2012 4:06:40 PM org.drupal.project.async_command.GenericDrupalApp runSerial
INFO: Total number of commands to run: 1
Mar 1, 2012 4:06:40 PM org.drupal.project.async_command.GenericDrupalApp handleException
SEVERE: System error or programming bug.
java.lang.NoClassDefFoundError: org/apache/mahout/cf/taste/common/TasteException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2406)
at java.lang.Class.getConstructor0(Class.java:2716)
at java.lang.Class.getConstructor(Class.java:1674)
at org.drupal.project.async_command.GenericDrupalApp.parseCommand(GenericDrupalApp.java:128)
at org.drupal.project.async_command.GenericDrupalApp.runSerial(GenericDrupalApp.java:243)
at org.drupal.project.async_command.GenericDrupalApp.run(GenericDrupalApp.java:179)
at org.drupal.project.async_command.CommandLineLauncher.handleExecutables(CommandLineLauncher.java:102)
at org.drupal.project.async_command.CommandLineLauncher.launch(CommandLineLauncher.java:63)
at org.drupal.project.recommender.RecommenderApp.main(RecommenderApp.java:26)
Caused by: java.lang.ClassNotFoundException: org.apache.mahout.cf.taste.common.TasteException
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:334)
... 10 more
Mar 1, 2012 4:06:40 PM org.drupal.project.async_command.GenericDrupalApp runSerial
INFO: Command finished running with status: INTR
Mar 1, 2012 4:06:40 PM org.drupal.project.async_command.GenericDrupalApp run
INFO: Shutdown parallel executor.
Mar 1, 2012 4:06:40 PM org.drupal.project.async_command.GenericDrupalApp run
INFO: Running the DrupalApp is accomplished.
Mar 1, 2012 4:06:40 PM org.drupal.project.async_command.CommandLineLauncher launch
INFO: Mission accomplished.

It seems it can't find something for Mahoute? I used svn and mvn install and have my installation just there on my CLASSPATH. I really need this module so what should I do?

Comments

danithaca’s picture

Status: Active » Fixed

SVN from Mahout doesn't have the compiled jar file (from what I recall). Either you need to compile the Mahout source code from SVN, or simply install the distribution version. The problem is quite clear that the code can't find Mahout library.

I'll make the code work better on detecting Mahout library immediately after installation. Currently it only tries to detect Mahout during run time.

If you can't fix the problem, reopen the issue again.

ottomatias’s picture

I really can't, I'm sorry. I know this is a newbie problem but I find the documentation a bit lacking.

Anyway, what I've tried so far is

1: a) downloading release version sources b) done mvn install (which takes about an hour) -> NO GO
2: a) got svn version sources b) done mvn install (takes about an hour) -> NO GO
3: tried searching for already compiled .deb -packages but can't find -> NO GO
4: tried setting CLASSPATH to different subdirectories of my mahout-installation -> NO GO

So my questions (I know nothing about Java):
1) Which files I need to have on my Classpath so that mahout can run?
2) Is there a Debian package for Mahout somewhere?
3) What do you mean in your README.txt with **Step 2**. Download Apache Mahout v.0.5+ from http://mahout.apache.org/, and extract it to "sites/all/libraries/mahout". Does this mean that I do not need to do mvn install? You only say download while you use "install" in other steps.

If I try to run mahout from /bin this is the output:

./mahout
MAHOUT_LOCAL is not set; adding HADOOP_CONF_DIR to classpath.
no HADOOP_HOME set, running locally
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/mahout/driver/MahoutDriver
Caused by: java.lang.ClassNotFoundException: org.apache.mahout.driver.MahoutDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:334)
Could not find the main class: org.apache.mahout.driver.MahoutDriver. Program will exit.

ottomatias’s picture

Sorry, if I run mahout from bin/ I get this:

macoute@asturia:/var/www/vhosts/ottomatias.com/html/tiedotteet/open/drupal-7.12/sites/all/libraries/mahout-distribution-0.6/bin$ ./mahout
MAHOUT_LOCAL is not set; adding HADOOP_CONF_DIR to classpath.
no HADOOP_HOME set, running locally
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/var/www/vhosts/ottomatias.com/html/tiedotteet/open/drupal-7.12/sites/all/libraries/mahout-distribution-0.6/examples/target/mahout-examples-0.6-job.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/var/www/vhosts/ottomatias.com/html/tiedotteet/open/drupal-7.12/sites/all/libraries/mahout-distribution-0.6/examples/target/dependency/slf4j-jcl-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/var/www/vhosts/ottomatias.com/html/tiedotteet/open/drupal-7.12/sites/all/libraries/mahout-distribution-0.6/examples/target/dependency/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
An example program must be given as the first argument.
Valid program names are:
arff.vector: : Generate Vectors from an ARFF file or directory
baumwelch: : Baum-Welch algorithm for unsupervised HMM training
canopy: : Canopy clustering
cat: : Print a file or resource as the logistic regression models would see it
cleansvd: : Cleanup and verification of SVD output
clusterdump: : Dump cluster output to text
clusterpp: : Groups Clustering Output In Clusters
cmdump: : Dump confusion matrix in HTML or text formats
cvb: : LDA via Collapsed Variation Bayes (0th deriv. approx)
cvb0_local: : LDA via Collapsed Variation Bayes, in memory locally.
dirichlet: : Dirichlet Clustering
eigencuts: : Eigencuts spectral clustering
evaluateFactorization: : compute RMSE and MAE of a rating matrix factorization against probes
fkmeans: : Fuzzy K-means clustering
fpg: : Frequent Pattern Growth
hmmpredict: : Generate random sequence of observations by given HMM
itemsimilarity: : Compute the item-item-similarities for item-based collaborative filtering
kmeans: : K-means clustering
lda: : Latent Dirchlet Allocation
ldatopics: : LDA Print Topics
lucene.vector: : Generate Vectors from a Lucene index
matrixdump: : Dump matrix in CSV format
matrixmult: : Take the product of two matrices
meanshift: : Mean Shift clustering
minhash: : Run Minhash clustering
pagerank: : compute the PageRank of a graph
parallelALS: : ALS-WR factorization of a rating matrix
prepare20newsgroups: : Reformat 20 newsgroups data
randomwalkwithrestart: : compute all other vertices' proximity to a source vertex in a graph
recommendfactorized: : Compute recommendations using the factorization of a rating matrix
recommenditembased: : Compute recommendations using item-based collaborative filtering
regexconverter: : Convert text files on a per line basis based on regular expressions
rowid: : Map SequenceFile to {SequenceFile, SequenceFile}
rowsimilarity: : Compute the pairwise similarities of the rows of a matrix
runAdaptiveLogistic: : Score new production data using a probably trained and validated AdaptivelogisticRegression model
runlogistic: : Run a logistic regression model against CSV data
seq2encoded: : Encoded Sparse Vector generation from Text sequence files
seq2sparse: : Sparse Vector generation from Text sequence files
seqdirectory: : Generate sequence files (of Text) from a directory
seqdumper: : Generic Sequence File dumper
seqwiki: : Wikipedia xml dump to sequence file
spectralkmeans: : Spectral k-means clustering
split: : Split Input data into test and train sets
splitDataset: : split a rating dataset into training and probe parts
ssvd: : Stochastic SVD
svd: : Lanczos Singular Value Decomposition
testclassifier: : Test the text based Bayes Classifier
testnb: : Test the Vector-based Bayes classifier
trainAdaptiveLogistic: : Train an AdaptivelogisticRegression model
trainclassifier: : Train the text based Bayes Classifier
trainlogistic: : Train a logistic regression using stochastic gradient descent
trainnb: : Train the Vector-based Bayes classifier
transpose: : Take the transpose of a matrix
validateAdaptiveLogistic: : Validate an AdaptivelogisticRegression model against hold-out data set
vecdist: : Compute the distances between a set of Vectors (or Cluster or Canopy, they must fit in memory) and a list of Vectors
vectordump: : Dump vectors from a sequence file to text
viterbi: : Viterbi decoding of hidden states from given output states sequence
wikipediaDataSetCreator: : Splits data set of wikipedia wrt feature like country
wikipediaXMLSplitter: : Reads wikipedia data and creates ch

So it seems to work. Anyway it doesnt matter if I change my classpath to bin/ -directory or to root -directory. Always the same error message I already posted.

ottomatias’s picture

Status: Fixed » Active
danithaca’s picture

Priority: Major » Normal

There's no need to run "mvn install" if you download the binary distribution. Download this one: mahout-distribution-0.6.tar.gz.
I'm quite sure the error is because the program can't find Mahout jar files.

danithaca’s picture

Status: Active » Fixed

Please try the latest RecommenderAPI release. See #5 also, and uncompress mahout to sites/libraries/mahout

Note this in the error message: "java.lang.NoClassDefFoundError: org/apache/mahout/cf/taste/common/TasteException". This is clearly a CLASSPATH problem that java can't find the required class.

I'll mark this as fixed. You can re-open it if it doesn't work.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.