How do we run our crawler from openlab?
This is pretty last-minute, but as I'm seeing plenty of ppl successfuly testing their code, I'm hoping for a quick response.
I've exported a jar file of my code onto my personal ICS space on my account, and I'm accessing it via PuTTY and connecting through the family guy UNIX machine. However, when I try to run the main method from the Controller class with the following command:
nohup java -cp crawler.jar src.crawler.Controller
I get a NoClassDefFoundError: src/crawler/Controller
Am I going about this the wrong way? I have plenty of code, but I'm afraid of testing it on my computer, as it has limited resources and I don't want to burn it out.
I've exported a jar file of my code onto my personal ICS space on my account, and I'm accessing it via PuTTY and connecting through the family guy UNIX machine. However, when I try to run the main method from the Controller class with the following command:
nohup java -cp crawler.jar src.crawler.Controller
I get a NoClassDefFoundError: src/crawler/Controller
Am I going about this the wrong way? I have plenty of code, but I'm afraid of testing it on my computer, as it has limited resources and I don't want to burn it out.
1
person has this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
Create a customer community for your own organization
Plans starting at $19/month
-
Inappropriate?I don't know your package structure, but I guess you don't have "src" in your structure and it should be like:
nohup java -cp crawler.jar crawler.Controller -
Inappropriate?Thanks for the quick response! A couple of questions:
1) I'm currently getting an UnsupportedClassVersionError. which terminates at java.lang.ClassLoader.defineClass0, when I run my code as above. I'm guessing this has to do with me running it on my personal ICS space, as opposed to the extra ugrad space?
2) This is more out of curiosity, but why is "src" omitted? my crawler package is structured underneath the src package in Eclipse, so I figured it would be part of the command.
I’m slightly more motivated.
-
Inappropriate?1) You have compiles your classes with a JDK which doesn't match the one on the machine you're using to run the code. This have already discussed in answers to other questions here. Please read them.
2) "src" is a holder. The right package is the one which is declared by the "package ..." line at the first line of your java class file. -
Inappropriate?Thanks. I'm building the project with the Java 1.5 JRE, but I'm running into the same error. Is there a way for me to double check if my jar file is being compiled with the right JRE? Otherwise, I'm not sure what other possibilities there are.
I’m a little frustrated again.
-
Inappropriate?I checked the java version on Family guy server and found that it's 1.4 (you can use java -version for this purpose). Therefore, you should use another server.
-
Inappropriate?Switched to the openlab server; now it's throwing a NoClassDef exception at me; I noticed that Jordan had gone through the same problem, so I attempted to run the code on my desktop, and kill it as soon as I could see it starting to crawl. However, I got the same msg; Eclipse posted the following to me:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Logger
at edu.uci.ics.crawler4j.crawler.CrawlController.<clinit>(CrawlController.java:27)
at crawler.Controller.main(Controller.java:7)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 2 more
As far as I can tell, it just can't find the pertinent classes in the edu.uci.ics.crawler4j.crawler.CrawlController import? How is that possible?
I should also add that I've even tried running the basic code you posted up on the Google Code page. I still get the same error.</clinit> -
Inappropriate?Oops, never mind! Got it to work, somehow >.>
-
Inappropriate?Our solution was to export it as a "Runnable JAR file". It includes all the dependencies and turned out to be 15MB.
-
Inappropriate?Thanks for the hints! - everyone should feel free to chime in. There are 40ish of you and two of us!!!
-
Inappropriate?Hey all, just wanted to update how my problem got solved, just in case there are other ppl working with it. I apparently imported the crawler4j dependencies as the original zip file into Eclipse, which is why Eclipse couldn't find the classes it needed when I ran the assignment. Once I unzipped the dependencies and imported them all into eclipse, the problem was solved.
I’m thankful.
Loading Profile...



EMPLOYEE
EMPLOYEE