I will be using a spare server for my recommender server. There is very little to no documentation on how to alter the run.sh file to point to another server. Im getting the

./run.sh
Exception in thread "main" java.lang.NoClassDefFoundError: org/drupal/project/recommender/RecommenderApp
Caused by: java.lang.ClassNotFoundException: org.drupal.project.recommender.RecommenderApp
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)
Could not find the main class: org.drupal.project.recommender.RecommenderApp. Program will exit.

Maybe we could have an example run.sh file that shows a seperate recommender server.

Comments

ktleow’s picture

Hmm I'm using the same server and ran into the same error as described above.

Did you get yours to work in same server?

bigsyke’s picture

I did get this working... Here is my run.sh

recommender directory is at ~/recommender...so its /home/xxx/recommender

Run.sh

# If you install the recommender module under 'sites/all/modules/recommeder' and 'sites/default/settings.php' is accessible, then you can run this script directly.
# Otherwise, please see README and make necessary configuration to make this script running correctly.

# config parameters whatever your drupal servers address is
export DRUPAL_HOME=192.168.0.90

ASYNC_COMMAND_HOME=~/recommender
RECOMMENDER_HOME=~/recommender
MAHOUT_HOME=~/recommender

# please make sure you have java and php installed.
command -v java >/dev/null || { echo "Cannot find java program. Please install Java first and make sure the executable is under PATH."; exit 1;}
command -v php >/dev/null || { echo "Cannot find php program. Please install PHP first and make sure the executable is under PATH."; exit 1;}

# set CLASSPATH
CLASSPATH=$RECOMMENDER_HOME/recommender.jar:$ASYNC_COMMAND_HOME/drupal-app.jar:$ASYNC_COMMAND_HOME/lib/*:$MAHOUT_HOME/*

# using the default config.properties file in the working directory, or fall back to use settings.php directly.
#java -cp $CLASSPATH org.drupal.project.recommender.RecommenderApp

# specify the location and filename of config.properties file. Default is the working directory
CONFIG_FILE=~/recommender/config.properties
java -cp $CLASSPATH org.drupal.project.recommender.RecommenderApp -c $CONFIG_FILE

config.properties

# This configuration file should follow the java .properties format. http://en.wikipedia.org/wiki/.properties

##### database configuration #####
# For a list of the database configuration parameters, please see http://commons.apache.org/dbcp/configuration.html

username=recommender
password=whatever

# could be mysql or postgresql
database_type=mysql
url=jdbc:mysql://192.168.0.90/whatever

##### Additional settings #####

drupal_version=7

# database prefix in Drupal
#db_prefix=

# mcrypt secret key. please specify if you use Encrypted Settings Field. Usually you can ignore it.
#mcrypt_secret_key=

# max database batch size for UPDATE/INSERT/DELETE. used in JDBC batchExecute()
#db_max_batch_size=5000

ktleow’s picture

Hmmm sorry it was my bad.

Somehow the Java isnt loading Apache Commons libraries from async_command module.
Had to hardcode the paths.

Thanks!

danithaca’s picture

Thanks for the report. I'll try to make better documentation in the next version.
I'll consider this problem as "fixed", right? If the problem still persists, please re-open the issue again.

danithaca’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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