Startup Problems in Leopard and Ubuntu

Forum is for miscellaneous user help requests.

Startup Problems in Leopard and Ubuntu

Postby fsancho » Thu May 29, 2008 2:08 pm

Hi,

First, congratulations for the software... it is really interesting and useful for me.

I have tried to run the program under Mac (Leopard) and Ubuntu and I have the same problem in both trying to run the Wandora.sh script. (With windows I don't find any problem).

I must start saying that I am not linux user. I am using the bcsh shell, but I have found several problems. I will try to explain the situation as I have:

I unziped the folder in the desktop... and after that:

1.- Wandora.sh can't find SetClasspath.sh: I fixed this problem providing the complete path for the file.

2.- It seems that SetClasspath.sh doesn't store all the paths, and finally it rewrites once a again over the same one, so finally it only has the last path library (lib/jtidy/Tidy.jar): I fixed this problem giving directly the value of WANDORACLASSES variable with the complete paths.

3.- When running

java -Xms512m -Xmx750m -classpath $WANDORACLASSES org.wandora.application.Wandora

I obtain the next error (I have Java JRE 6 installed in both machines):

Exception in thread "main" java.lang.NoClassDefFoundError: org/wandora/application/Wandora
Caused by: java.lang.ClassNotFoundException: org.wandora.application.Wandora
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

...I suppose that I am doing something wrong... If you can tell me how to fix the problem and run the program it would be great.

Thanks a lot in advance...
Fernando Sancho
Universidad de Sevilla, España
fsancho
 
Posts: 11
Joined: Thu May 29, 2008 1:50 pm

Postby akivela » Thu May 29, 2008 5:44 pm

Hello Fernando

Thanks for your bug report. We really should set up a test bench for Linux systems. As we develop the application in Windows, the Linux/Mac/Unix world gets forgotten just too easily.

The initial problem of $WANDORACLASSES containing only lib/jtidy/Tidy.jar is a consequence of semicolon ( ; ) character between $WANDORACLASSES and lib/jtidy/Tidy.jar. Character was accidentally copied to the SetClasspath.sh script from Windows variant where semicolon is used as a path delimiter. Change this semicolon to colon ( : ) and you should be able to use the original startup script (wandora.sh).

This should fix your problems 1 & 2.

Third problem, occurred while running the application is a consequence of missing classpath setting. Exception says JRE can't find class

org.wandora.application.Wandora

This class is part of Wandora application and it locates in classes folder (precisely build/classes). Check that your classpath also include this folder (classes). If you look at the original SetClasspath.sh, the folder is injected into the $WANDORACLASSES in the first line.

Notice also that using "classes" in Java's classpath assumes you run the application within a folder above "classes". When you run the application with wandora.sh there is a line "cd ../build" that moves the execution to the right folder and JRE finds "classes" successfully. If you run the application directly with Java command please ensure you locate within "build". Or you might want to add classpaths the route from your current directory to the "classes" folder.

I hope this helped to solve the problem. Please drop a line if you still have problems running the Wandora application.

Kind Regards,
Aki Kivelä
akivela
Site Admin
 
Posts: 260
Joined: Tue Sep 18, 2007 10:20 am
Location: Helsinki, Finland

Partial solution

Postby fsancho » Fri Jun 13, 2008 12:34 am

Hi Aki,

Thanks a lot for your reply, and sorry for the delay in mine... But it didn't work and I was trying to get some other solution.

After having problems with the scripts, I have found that, directly, it works on linux, using something so ugly as:

java -Xms512m -Xmx750m -classpath classes:resources:lib/jmbox/commons-collections-3.1.jar:lib/jmbox/commons-logging.jar:lib/jmbox/ehcache-1.1.jar:lib/jmbox/jmbox.jar:lib/poi-3.0-alpha1-20050704.jar:lib/poi-contrib-3.0-alpha1-20050704.jar:lib/poi-scratchpad-3.0-alpha1-20050704.jar:lib/jena/antlr-2.7.5.jar:lib/jena/arq.jar:lib/jena/commons-logging.jar:lib/jena/concurrent.jar:lib/jena/icu4j_3_4.jar:lib/jena/iri.jar:lib/jena/jena.jar:lib/jena/jenatest.jar:lib/jena/json.jar:lib/jena/junit.jar:lib/jena/log4j-1.2.12.jar:lib/jena/stax-api-1.0.jar:lib/jena/wstx-asl-2.8.jar:lib/jena/xercesImpl.ja:lib/jena/xml-apis.jar:lib/hsqldb.jar:lib/jpegrdf.jar:lib/gnu-regexp-1.1.4.jar:lib/bsh-2.0b2.jar:lib/jid3lib-0.5.4.jar:lib/velocity-dep-1.4.jar:lib/mail.jar:lib/xerces.jar:lib/mysql-connector-java-3.1.13-bin.jar:lib/acrobat.jar:lib/MRJToolkitStubs.zip:lib/mstor/jdom.jar:lib/mstor/jdom.jar:lib/mstor/xstream.jar:lib/mstor/commons-logging.jar:lib/mstor/mstor.jar:lib/msbase.jar:lib/activation.jar:lib/mssqlserver.jar:lib/msutil.jar:lib/lucene-1.3-final.jar:lib/axis.jar:lib/commons-discovery-0.2.jar:lib/commons-logging-1.0.4.jar:lib/jaxrpc.jar:lib/saaj.jar:lib/wsdl4j-1.5.1.jar:lib/jtidy/Tidy.jar:lib/gdata/gdata-appsforyourdomain-1.0.jar:lib/gdata/gdata-appsforyourdomain-meta-1.0.jar:lib/gdata/gdata-base-1.0.jar:lib/gdata/gdata-calendar-1.0.jar:lib/gdata/gdata-calendar-meta-1.0.jar:lib/gdata/gdata-client-1.0.jar:lib/gdata/gdata-client-meta-1.0.jar:lib/gdata/gdata-codesearch-1.0.jar:lib/gdata/gdata-codesearch-meta-1.0.jar:lib/gdata/gdata-contacts-1.0.jar:lib/gdata/gdata-contacts-meta-1.0.jar:lib/gdata/gdata-core-1.0.jar:lib/gdata/gdata-docs-1.0.jar:lib/gdata/gdata-docs-meta-1.0.jar:lib/gdata/gdata-media-1.0.jar:lib/gdata/gdata-photos-1.0.jar:lib/gdata/gdata-photos-meta-1.0.jar:lib/gdata/gdata-spreadsheet-1.0.jar:lib/gdata/gdata-spreadsheet-meta-1.0.jar:lib/gdata/gdata-youtube-1.0.jar:lib/gdata/gdata-youtube-meta-1.0.jar org.wandora.application.Wandora

... yes, I know, it can be done with a script, but it didn't wotk properly, ... who knows why?.

It works on Linux, but not in Leopard... in this last case, although I have installed Java SE 6, it doesn't work and wandora tries to use 1.5 instead, and it gives a expection errror in main module... but it seems now to be a problem with my knowledge on mac, and not a wandora problem... so I will try my best in the next few days and I will write one more message here if I get some advance...

Anyway... anyone knows a way to make a script in linux (and under which shell) in order to execute the same?.. and, of course, if someone has a solution for MAC it will be more than wellcomed.

Thanks a lot for your patiente and the fast reply...

Fernando Sancho
University of Seville, Spain
fsancho
 
Posts: 11
Joined: Thu May 29, 2008 1:50 pm

Postby akivela » Mon Jun 16, 2008 4:57 pm

Hello Fernando

Indeed new Wandora uses Java 6 and throws exceptions with older java versions. I suggest you check java version with shell command

java -version

If 'java' command points at older java version _and_ you have installed newer version, I assume your shell PATH settings are broken. To run Wandora in system with 'java' command addressing older java version, add absolute path of java 6 folder in front of java command. For example if java 6 locates in /usr/opt/java6 folder, you should run Wandora like this:

/usr/opt/java6/bin/java -Xms512m -Xmx750m -classpath etc...

Another - more permanent - solution is to add new java path to the environment variable 'PATH' using 'env' command. If you have the java 6 installation in /usr/opt/java6 then environment variable PATH is set like this:

env PATH=/usr/opt/java6/bin/:$PATH

Note the additional '/bin' folder at the end. Java executables usually locate in bin folder.

To run Wandora's shell script in Leopard check the script has been given appropriate rights. I don't know Leopard in detail but assume you need to set script's execute rights like this

chmod a+x Wandora.sh

In general Linux scripts are plain text files with appropriate rights.

Kind Regards,
Aki
akivela
Site Admin
 
Posts: 260
Joined: Tue Sep 18, 2007 10:20 am
Location: Helsinki, Finland

Wandora running

Postby fsancho » Tue Jun 24, 2008 6:27 pm

Hi,

Finally, Wandora is running correctly in my Linux and Mac computers... I still have to run it with the long sentence directly from the terminal in Mac (the script is not running on it), but then the problem is mine, not from wandora....

Thanks a lot for your fast ans useful answers.

Fernando Sancho
fsancho
 
Posts: 11
Joined: Thu May 29, 2008 1:50 pm

Postby erikalm » Mon Sep 08, 2008 8:39 pm

Hello,

I can see two problems with your scripts.

1. They lack a "prolog". This means in linux you put
#!/bin/sh
or
#!/bin/bash
at the beginning of a shell script to tell the system what shell to run.

2. They have improper line feeds (i.e. windows linefeeds) which means
every command, every classpath everything has a "\r" character added
just before EOL. (WIndows linefeed consists of "\r\n" while linux
linefeeds consists of only a "\n"... you should be able to find a coders
editor that can save in both formats.

If you clean up the scripts and add the prolog they run just fine. (I just tested)

TIA!

P.s. this is most likely why the scripts wont run mac OSX or others as
well. Old macs has the great taste of using "\r" as line feeds. OSXes
should, since they are BSD based probably use "\n" like Linux D.s.
erikalm
 
Posts: 1
Joined: Mon Sep 08, 2008 8:28 pm

New version

Postby fsancho » Thu Nov 27, 2008 12:28 am

Hi everybody,

Thanks a lot for your comments and help... This post is only to say that with the new version I have no problems in executing Wandora from XP, Vista, Mac or Linux.

Great job!,... and thanks again.
fsancho
 
Posts: 11
Joined: Thu May 29, 2008 1:50 pm


Return to How to... and problems

Who is online

Users browsing this forum: No registered users and 49 guests