Question

I followed the setup from Setting up Nutch 2.1 with MySQL and i ran

bin/crawl urls -depth 1 -topN 2

but it throughs an IOException shown as below

InjectorJob: starting at 2014-03-15 12:22:10 
InjectorJob: Injecting urlDir: urls
InjectorJob: org.apache.gora.util.GoraException: java.io.IOException:om.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-depth_webpage (id VARCHAR(767) PRIMARY KEY,headers BLOB,text VARCHAR(32000),sta' at line 1

This is how the Hadoop.log looks like

2014-03-15 12:25:44,275 INFO  crawl.InjectorJob - InjectorJob: starting at 2014-03-15 12:25:44
2014-03-15 12:25:44,275 INFO  crawl.InjectorJob - InjectorJob: Injecting urlDir: urls
2014-03-15 12:25:45,467 INFO  store.SqlStore - creating schema: -depth_webpage
2014-03-15 12:25:45,517 ERROR crawl.InjectorJob - InjectorJob: org.apache.gora.util.GoraException: java.io.IOException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-depth_webpage (id VARCHAR(767) PRIMARY KEY,headers BLOB,text VARCHAR(32000),sta' at line 1
    at org.apache.gora.store.DataStoreFactory.createDataStore(DataStoreFactory.java:167)
    at org.apache.gora.store.DataStoreFactory.createDataStore(DataStoreFactory.java:135)
    at org.apache.nutch.storage.StorageUtils.createWebStore(StorageUtils.java:75)
    at org.apache.nutch.crawl.InjectorJob.run(InjectorJob.java:221)
    at org.apache.nutch.crawl.InjectorJob.inject(InjectorJob.java:251)
    at org.apache.nutch.crawl.InjectorJob.run(InjectorJob.java:273)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
    at org.apache.nutch.crawl.InjectorJob.main(InjectorJob.java:282)
Caused by: java.io.IOException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-depth_webpage (id VARCHAR(767) PRIMARY KEY,headers BLOB,text VARCHAR(32000),sta' at line 1
    at org.apache.gora.sql.store.SqlStore.createSchema(SqlStore.java:226)
    at org.apache.gora.sql.store.SqlStore.initialize(SqlStore.java:172)
    at org.apache.gora.store.DataStoreFactory.initializeDataStore(DataStoreFactory.java:102)
    at org.apache.gora.store.DataStoreFactory.createDataStore(DataStoreFactory.java:161)
    ... 7 more

Also nothing is entered into my SQL Database.

Is this error connect to My table CREATION or something else

I am using nutch 2.2.1

Was it helpful?

Solution

Yes, the stacktrace says clearly that there is a syntax in your MySQL query for table creation.

Caused by: java.io.IOException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-depth_webpage (id VARCHAR(767) PRIMARY KEY,headers BLOB,text VARCHAR(32000),sta' at line 1

Please make sure that the query executes successfully in standalone from MySQL workbench or phpmyadmin

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top