gora-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apostolis Giannakidis <ap.giannaki...@gmail.com>
Subject Problem with escaping spaces in bin/gora
Date Fri, 14 Jun 2013 02:27:43 GMT
Hello all,

I encountered an issue that I believe needs addressing.

After executing:
$ mvn clean install
$ bin/gora goracompiler

I received the following exception:
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/avro/Schema
at java.lang.Class.getDeclaredMethods0(Native Method)
 at java.lang.Class.privateGetDeclaredMethods(Class.java:2451)
at java.lang.Class.getMethod0(Class.java:2694)
 at java.lang.Class.getMethod(Class.java:1622)
at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
 at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)
Caused by: java.lang.ClassNotFoundException: org.apache.avro.Schema
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
 at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
 ... 6 more

After investigation I did not identify any issue regarding the avro
dependency and that the classpath contained the lib folder. So, at first
everything seems to be set up properly.

However, after some trial and error I realised that what is causing the
problem is a space character that I have in the path where Gora is
installed. This space character was causing the Java Class Loader not be
able to properly load the classes. I fixed the problem by changing the
bin/gora script to the following:

SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
# add libs to CLASSPATH
for f in $GORA_HOME/$MODULE/lib/*.jar; do
  CLASSPATH=${CLASSPATH}:$f;
done

for f in $GORA_HOME/$MODULE/target/*.jar; do
  CLASSPATH=${CLASSPATH}:$f;
done
IFS=$SAVEIFS

I created a Jira issue (GORA-243) for this and I uploaded a fixed version
of the bin/gora script.
https://issues.apache.org/jira/browse/GORA-243

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message