Example EchoTest Failing - Could not find main class com.twitter.parrot.launcher.LauncherMain

193 views
Skip to first unread message

Michael Barton

unread,
Mar 10, 2014, 5:07:07 AM3/10/14
to iago-...@googlegroups.com
I'm following the Echo Example.

The EchoServer started up just fine:
${JAVA_HOME}/bin/java ${JAVA_OPTS} -cp "${MAIN_JAR}:libs/*" ${MAIN_CLASS}
+ /usr/lib/jvm/java-7-oracle/bin/java -server -XX:+UseConcMarkSweepGC -verbosegc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -XX:+UseParNewGC -Xloggc:gc.log -Xmx128m -Xms128m -XX:NewSize=64m -cp iago-echo-1.0.jar:libs/* com.twitter.example.EchoServer
Mar 10, 2014 1:30:23 AM com.twitter.finagle.Init$ apply
INFO: Finagle version 6.11.1 (rev=83de11a66b498351418433bcad00cbf4b7dc495c) built at 20140122-140039

I am encountering this error:

java -jar iago-echo-1.0.jar -f config/echo.scala
Error: Could not find or load main class com.twitter.parrot.launcher.LauncherMain

I checked MANIFEST.MF to see if anything stood out as odd. Something strange is going on with the Class Paths.

barton@backuplaptop:~/IdeaProjects/iago/examples/echo/target/yo$ unzip -c iago-echo-1.0.jar META-INF/MANIFEST.MF | head
Archive:  iago-echo-1.0.jar
  inflating: META-INF/MANIFEST.MF   
Manifest-Version: 1.0
Built-By: barton
Build-Jdk: 1.7.0_51
Class-Path: libs/null-null-nullnull.null libs/null-null-nullnull.null
 libs/null-null-nullnull.null libs/null-null-nullnull.null libs/null-n
 ull-nullnull.null libs/null-null-nullnull.null libs/null-null-nullnul
 l.null libs/null-null-nullnull.null libs/null-null-nullnull.null libs
 /null-null-nullnull.null libs/null-null-nullnull.null libs/null-null-

My version of maven fresh from the Ubuntu repository.

mvn -version
Apache Maven 2.2.1 (rdebian-10)
Java version: 1.7.0_51
Java home: /usr/lib/jvm/java-7-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "3.11.0-18-generic" arch: "i386" Family: "unix"

My path variable looks just fine.

barton@backuplaptop:~$ echo $PATH
/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/java-7-oracle/bin:/usr/lib/jvm/java-7-oracle/db/bin:/usr/lib/jvm/java-7-oracle/jre/bin

barton@backuplaptop:~$ echo $JAVA_HOME
/usr/lib/jvm/java-7-oracle

barton@backuplaptop:~$ echo $SCALA_HOME
barton@backuplaptop:~$


What am I overlooking? Do I need to define a SCALA_HOME variable?

Tom Howland

unread,
Mar 10, 2014, 1:44:23 PM3/10/14
to iago-...@googlegroups.com
Good call on suspecting your manifest. There is something funny with it. I just went through the example and it worked just fine. My manifest is:

[tw-mbp-thowland yo (master)]$ unzip -c iago-echo-1.0.jar META-INF/MANIFEST.MF | head
Archive:  iago-echo-1.0.jar
  inflating: META-INF/MANIFEST.MF    
Manifest-Version: 1.0
Built-By: thowland
Build-Jdk: 1.7.0_51
Class-Path: libs/com.twitter-iago-0.6.14.jar libs/com.twitter.common.z
 ookeeper-server-set-1.0.24.jar libs/com.twitter.common.zookeeper-clie
 nt-0.0.21.jar libs/com.twitter.common-net-util-0.0.43.jar libs/com.tw
 itter.common.zookeeper-group-0.0.28.jar libs/com.google.code.findbugs
 -jsr305-1.3.9.jar libs/com.twitter.common-args-0.1.51.jar libs/com.tw

I don't have a SCALA_HOME defined.

It would be good to understand why your manifest isn't being created correctly but the work-around is to do specify the classpath directly,

java -cp iago-echo-1.0.jar:libs/* com.twitter.parrot.launcher.LauncherMain -f config/echo.scala 



--

---
You received this message because you are subscribed to the Google Groups "Iago Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iago-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tom Howland

unread,
Mar 10, 2014, 4:37:40 PM3/10/14
to iago-...@googlegroups.com
oops

you have to quote it

java -cp 'iago-echo-1.0.jar:libs/*' com.twitter.parrot.launcher.LauncherMain -f config/echo.scala
Reply all
Reply to author
Forward
0 new messages