List Info

Thread: Launching custom classes




Launching custom classes
country flaguser name
United States
2007-03-19 09:09:56
Hi all,
I have a custom class in the nutch jar. Everything works
fine in eclipse but
when I try to run it from the command line using bin/nutch
it throws the
java.lang.NoClassDefFoundError. All the pages on the
internet helpfully
suggested that I make sure that the jar is in the classpath.
I think that
everything is correct since I can invoke any of the nutch
classes via its
class name e.g. bin/nutch org.apache.nutch.crawl.Crawl. This
may be a simple
Java problem but I have been banging my head against this
all weekend.

Thanks,

Steve


Re: Launching custom classes
country flaguser name
Poland
2007-03-19 09:18:19
Steve Severance wrote:
> Hi all,
> I have a custom class in the nutch jar. Everything
works fine in eclipse but
> when I try to run it from the command line using
bin/nutch it throws the
> java.lang.NoClassDefFoundError. All the pages on the
internet helpfully
> suggested that I make sure that the jar is in the
classpath. I think that
>   

What needs to be on your classpath is the *.job jar. The
bin/nutch 
script takes care of that if you built your Nutch using the
command-line 
version of ant.

-- 
Best regards,
Andrzej Bialecki     <><
 ___. ___ ___ ___ _ _   __________________________________
[__ || __|__/|__||/|  Information Retrieval, Semantic Web
___|||__||  |  ||  |  Embedded Unix, System Integration
http://www.sigram.com 
Contact: info at sigram dot com



RE: Launching custom classes
country flaguser name
United States
2007-03-19 15:16:11
> -----ORIGINAL MESSAGE-----
> FROM: ANDRZEJ BIALECKI [MAILTO:ABGETOPT.ORG]
> SENT: MONDAY, MARCH 19, 2007 10:18 AM
> TO: NUTCH-DEVLUCENE.APACHE.ORG
> SUBJECT: RE: LAUNCHING CUSTOM CLASSES
> 
> STEVE SEVERANCE WROTE:
> > HI ALL,
> > I HAVE A CUSTOM CLASS IN THE NUTCH JAR. EVERYTHING
WORKS FINE IN
> ECLIPSE BUT
> > WHEN I TRY TO RUN IT FROM THE COMMAND LINE USING
BIN/NUTCH IT THROWS
> THE
> > JAVA.LANG.NOCLASSDEFFOUNDERROR. ALL THE PAGES ON
THE INTERNET
> HELPFULLY
> > SUGGESTED THAT I MAKE SURE THAT THE JAR IS IN THE
CLASSPATH. I THINK
> THAT
> >
> 
> WHAT NEEDS TO BE ON YOUR CLASSPATH IS THE *.JOB JAR.
THE BIN/NUTCH
> SCRIPT TAKES CARE OF THAT IF YOU BUILT YOUR NUTCH USING
THE COMMAND-
> LINE
> VERSION OF ANT.

OK. THANKS. 2 MORE THINGS. I HAVE 2 DIRECTORIES FOR NUTCH, 1
IS SYNCHRONIZED WITH SVN AND THE OTHER IS MY WORKING
DIRECTORY. IF I RUN THE ANT PACKAGE COMMAND IN MY WORKING
DIRECTORY ANT SAYS 
BUILD FAILED
G:NUTCHINSTANCEBUILD.XML:61: SPECIFY AT LEAST ONE
SOURCE--A FILE OR RESOURCE COLLECTION.

TOTAL TIME: 0 SECONDS

IF I COPY MY SOURCE FOLDER INTO THE TRUNK DIR FOR MY
DIRECTORY THAT IS SYNCED WITH SVN MY CLASS DOES NOT GET
ADDED. I HAVE BEEN STUDYING THE BUILD.XML FILE AND I SEE THE
PLUGIN GENERATION JOBS, BUT MY REASONING IS THAT MY PACKAGE
NAME IS ORG.APACHE.NUTCH.<MY PACKAGE> SHOULD BE
COMPILED INTO THE CORE. IS THIS CORRECT? DO I NEED TO MAKE A
SEPARATE BUILD JOB FOR MY CLASS OR SOMETHING LIKE THAT?

SECOND, HOW DO PEOPLE GENERALLY SETUP THEIR DEVELOPMENT
MACHINES? DO YOU USE ECLIPSE, IF SO DO YOU JUST WORK OFF OF
THE TRUNK OR WHAT? WHAT IS RECOMMENDATION FOR SOURCE CONTROL
IN THIS SITUATION? IS THERE A WAY TO MAKE A SUBVERSION
REPOSITORY FOR ME SO THAT I CAN ADD MY OWN CODE BUT ALSO
RECEIVE UPDATES FROM THE TRUNK? USING AN OPEN SOURCE PROJECT
LIKE THIS SEEMS TO ADD SOME COMPLEXITY TO THE SOURCE CONTROL
PROCESS. BUT I AM SURE THIS PROBLEM HAS ALREADY BEEN WORKED
OUT.

REGARDS,

STEVE

> 
> --
> BEST REGARDS,
> ANDRZEJ BIALECKI     <><
>  ___. ___ ___ ___ _ _  
__________________________________
> [__ || __|__/|__||/|  INFORMATION RETRIEVAL, SEMANTIC
WEB
> ___|||__||  |  ||  |  EMBEDDED UNIX, SYSTEM
INTEGRATION
> HTTP://WWW.SIGRAM.COM  CONTACT: INFO AT SIGRAM DOT COM



[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )