Nutch - parse custom HTML elements
I'm trying to crawl and index (with Solr) specific parts of the pages I'm crawling.
So far with all the default Config I'm crawling and indexing the pages I want, but in Solr I only have 2 field, title and content, which contains the text of my pages, but it's not exactly the text that I want.
What I want to achieve is to have new field with the content of a specific div.
<div class="myDiv"> Content I want to index </div>
What I found so far is the Extractor Plugin which seems to be what I want.
After following the instructions I'm not able to parse the data since I get the following error and I don't understand what's wrong.
I'm using Nutch 1.15
java.lang.Exception: java.lang.LinkageError: loader constraint violation: when resolving method "org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;" the class loader (instance of org/apache/nutch/plugin/PluginClassLoader) of the current class, org/slf4j/LoggerFactory, and the class loader (instance of sun/misc/Launcher$AppClassLoader) for the method's defining class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type org/slf4j/ILoggerFactory used in the signature
at org.apache.hadoop.mapred.LocalJobRunner$Job.runTasks(LocalJobRunner.java:462)
at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:522)
java solr nutch
add a comment |
I'm trying to crawl and index (with Solr) specific parts of the pages I'm crawling.
So far with all the default Config I'm crawling and indexing the pages I want, but in Solr I only have 2 field, title and content, which contains the text of my pages, but it's not exactly the text that I want.
What I want to achieve is to have new field with the content of a specific div.
<div class="myDiv"> Content I want to index </div>
What I found so far is the Extractor Plugin which seems to be what I want.
After following the instructions I'm not able to parse the data since I get the following error and I don't understand what's wrong.
I'm using Nutch 1.15
java.lang.Exception: java.lang.LinkageError: loader constraint violation: when resolving method "org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;" the class loader (instance of org/apache/nutch/plugin/PluginClassLoader) of the current class, org/slf4j/LoggerFactory, and the class loader (instance of sun/misc/Launcher$AppClassLoader) for the method's defining class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type org/slf4j/ILoggerFactory used in the signature
at org.apache.hadoop.mapred.LocalJobRunner$Job.runTasks(LocalJobRunner.java:462)
at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:522)
java solr nutch
add a comment |
I'm trying to crawl and index (with Solr) specific parts of the pages I'm crawling.
So far with all the default Config I'm crawling and indexing the pages I want, but in Solr I only have 2 field, title and content, which contains the text of my pages, but it's not exactly the text that I want.
What I want to achieve is to have new field with the content of a specific div.
<div class="myDiv"> Content I want to index </div>
What I found so far is the Extractor Plugin which seems to be what I want.
After following the instructions I'm not able to parse the data since I get the following error and I don't understand what's wrong.
I'm using Nutch 1.15
java.lang.Exception: java.lang.LinkageError: loader constraint violation: when resolving method "org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;" the class loader (instance of org/apache/nutch/plugin/PluginClassLoader) of the current class, org/slf4j/LoggerFactory, and the class loader (instance of sun/misc/Launcher$AppClassLoader) for the method's defining class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type org/slf4j/ILoggerFactory used in the signature
at org.apache.hadoop.mapred.LocalJobRunner$Job.runTasks(LocalJobRunner.java:462)
at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:522)
java solr nutch
I'm trying to crawl and index (with Solr) specific parts of the pages I'm crawling.
So far with all the default Config I'm crawling and indexing the pages I want, but in Solr I only have 2 field, title and content, which contains the text of my pages, but it's not exactly the text that I want.
What I want to achieve is to have new field with the content of a specific div.
<div class="myDiv"> Content I want to index </div>
What I found so far is the Extractor Plugin which seems to be what I want.
After following the instructions I'm not able to parse the data since I get the following error and I don't understand what's wrong.
I'm using Nutch 1.15
java.lang.Exception: java.lang.LinkageError: loader constraint violation: when resolving method "org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;" the class loader (instance of org/apache/nutch/plugin/PluginClassLoader) of the current class, org/slf4j/LoggerFactory, and the class loader (instance of sun/misc/Launcher$AppClassLoader) for the method's defining class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type org/slf4j/ILoggerFactory used in the signature
at org.apache.hadoop.mapred.LocalJobRunner$Job.runTasks(LocalJobRunner.java:462)
at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:522)
java solr nutch
java solr nutch
asked Nov 24 '18 at 13:09
Gregory WullimannGregory Wullimann
363314
363314
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Seems that the slf4j-api used was an old version which didn't match with the one that Nutch uses. At least, that's what I understood.
To solve the issue I simply commented out the library in /plugins/extractor/plugin.xml
Remove this line: <library name="slf4j-api-1.7.5.jar"/>
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53458476%2fnutch-parse-custom-html-elements%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Seems that the slf4j-api used was an old version which didn't match with the one that Nutch uses. At least, that's what I understood.
To solve the issue I simply commented out the library in /plugins/extractor/plugin.xml
Remove this line: <library name="slf4j-api-1.7.5.jar"/>
add a comment |
Seems that the slf4j-api used was an old version which didn't match with the one that Nutch uses. At least, that's what I understood.
To solve the issue I simply commented out the library in /plugins/extractor/plugin.xml
Remove this line: <library name="slf4j-api-1.7.5.jar"/>
add a comment |
Seems that the slf4j-api used was an old version which didn't match with the one that Nutch uses. At least, that's what I understood.
To solve the issue I simply commented out the library in /plugins/extractor/plugin.xml
Remove this line: <library name="slf4j-api-1.7.5.jar"/>
Seems that the slf4j-api used was an old version which didn't match with the one that Nutch uses. At least, that's what I understood.
To solve the issue I simply commented out the library in /plugins/extractor/plugin.xml
Remove this line: <library name="slf4j-api-1.7.5.jar"/>
answered Nov 24 '18 at 14:15
Gregory WullimannGregory Wullimann
363314
363314
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53458476%2fnutch-parse-custom-html-elements%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown