SeqFilesFromDirectory() error on amazon EMR - mahout

I am trying to run a simple program on Amazon EMR which converts text files in a directory into sequence files. The program runs fine on my local machine but gives me following error on Amazon EMR. Could someone please tell me how to get rid of this error.
Configuration conf=new Configuration();
System.out.println("fs.default.name : - " + conf.get("fs.default.name"));
Path input=new Path(URI.create(args[0]));
Path output=new Path(URI.create(args[1]));
ToolRunner.run(new SequenceFilesFromDirectory(),new String[]{
"--input",input.toString(),
"--output",output.toString(),
"--overwrite",
"--method","mapreduce"});
Thank you.
Exception in thread "main" java.lang.IllegalArgumentException: This file system object (hdfs://172.31.4.175:9000) does not support access to the request path ..
You possibly called FileSystem.get(conf) when you should have called FileSystem.get(uri, conf) to obtain a file system supporting your path.
at org.apache.hadoop.fs.FileSystem.checkPath(FileSystem.java:384)
at org.apache.hadoop.hdfs.DistributedFileSystem.getPathName(DistributedFileSystem.java:129)
at org.apache.hadoop.hdfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:513)
at org.apache.mahout.text.SequenceFilesFromDirectory.runMapReduce(SequenceFilesFromDirectory.java:140)
at org.apache.mahout.text.SequenceFilesFromDirectory.run(SequenceFilesFromDirectory.java:89)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:79)
at com.gifts.text.SeqFileDirectory.main(SeqFileDirectory.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.util.RunJar.main(RunJar.java:187)*

Related

Jenkins Out of Memory error while running multiple jmeter script

I have a Jmeter/Jenkins/maven/perforce framework for API testing purpose.Where each JMX contain around 200 test cases .each test cases are written inside a thread group with one user only. Each test case has some precondition for data fetching from multiple dbs then heating request then use multiple assertions using bean shell one also.Also we have used a lot of customize jar so that we can access server and read the logs or to edit the properties file over there.
If we ran the script from jmeter it ran smoothly but if we run the script from Jenkins say 20 jmx at a time sequentially,then after some time it may be 1 2 or 17 hr it fails showing out of memory error.
My current Jenkins server config is like this:
free -h
total used free shared buff/cache available
Mem:
31G 3.1G 12.9G 16M 15G 24G
i have already tweaked with heap space like 6/8 ,12/12.
Log at the time of failure:
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:508)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
at java.lang.Thread.run(Thread.java:811)
Caused by: java.lang.OutOfMemoryError: Java heap space
at org.apache.xerces.xni.XMLString.toString(Unknown Source)
at org.apache.xerces.parsers.AbstractDOMParser.characters(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.handleCharacter(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEntityReference(Unknown Source)
at <unknown class>.<unknown method>(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
at utils.APIReportProcessing.fetchAPIReportDetail(APIReportProcessing.java:84)
at jmeterRun.RunProcess.prepareFinalResults(RunProcess.java:179)
at jmeterRun.RunProcess.executeJMeterAndWriteResults(RunProcess.java:158)
at jmeterRun.ControllerJMeter.main(ControllerJMeter.java:115)
... 6 more
Here is code from APIReportProcessing part where it fails.
Below is the code where i am getting error.
public static void fetchAPIReportDetail(String rawXMLReportFile) {
File rawXMLReport = null;
try {
rawXMLReport = new File(rawXMLReportFile);
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuilder.parse(rawXMLReport);
doc.getDocumentElement().normalize();
individualModuleCount.add(passCount + "," + totalTestCount);
} catch (Exception var13) {
var13.printStackTrace();
Logging.log("info", "Error in fetching up data from XML file. Exception:" + var13.getMessage());
} finally {
try {
rawXMLReport.delete();
} catch (Exception var12) {
var12.printStackTrace();
Logging.log("error", "Error in deleting XML data file. Exception:" + var12.getMessage());
}
}
Thanks,
Bibek
You need to increase heap not for JMeter but for Jenkins, check out How to add Java arguments to Jenkins? article for instructions.
You might want to switch to XMLSlurper or XMLParser, both are SAX based therefore the memory footprint should be less.
According to JMeter Best Practices you should rather be using CSV output format for JMeter result files, if you need to have the count of passed requests you could go for JMeterPluginsCMD Command Line Tool
Sorry for delayed response.
In my case the issue resolved with updating correct java version.Previous java version was IBM version where the issue occured.I changed it to the openjdk version "1.8.0_191" version.
Thanks,
BIbek

Deploy wlapp files in MFP Liberty using ant

I'm trying to deploy wlapp file in MFP Liberty Server using ant task.
I created the build.xml then run "ant" in cmd.
C:\IBM\MobileFirst_Platform_Server\shortcuts>ant
Unable to locate tools.jar. Expected to find it in C:\IBM\Installation Manager\e
clipse\jre_7.0.9030.20160210_1426\lib\tools.jar
Buildfile: C:\IBM\MobileFirst_Platform_Server\shortcuts\build.xml
install:
[wladm] The REST service URL http://IP:9080/worklightconsol
e cannot be accessed in a secure way. You may want to use a https URL instead, o
r retry with the 'secure' option set to 'false'.
BUILD FAILED
C:\IBM\MobileFirst_Platform_Server\shortcuts\build.xml:9: com.ibm.worklight.admi
n.restclient.RESTException: The REST service URL http://IP:9080
/worklightconsole cannot be accessed in a secure way. You may want to use a http
s URL instead, or retry with the 'secure' option set to 'false'.
at com.ibm.worklight.admin.restclient.RESTClient.checkURI(RESTClient.jav
a:1001)
at com.ibm.worklight.admin.restclient.RESTClient.getPOSTResponse(RESTCli
ent.java:1433)
at com.ibm.worklight.admin.restclient.RESTClient.getPOSTFileResponse(RES
TClient.java:1464)
at com.ibm.worklight.admin.commands.DeployApp.getResponse(DeployApp.java
:41)
at com.ibm.worklight.admin.restclient.ActionClient.execute(ActionClient.
java:84)
at com.ibm.worklight.admin.ant.types.AbstractActionElement.executeComman
d(AbstractActionElement.java:76)
at com.ibm.worklight.admin.ant.types.ActionElement.executeCommands(Actio
nElement.java:43)
at com.ibm.worklight.admin.ant.WladmTask.executeCommands(WladmTask.java:
705)
at com.ibm.worklight.admin.ant.WladmTask.execute(WladmTask.java:459)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:95)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:56)
at java.lang.reflect.Method.invoke(Method.java:620)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:392)
at org.apache.tools.ant.Target.performTasks(Target.java:413)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
cutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:811)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Total time: 1 second
I don't know where to set the "secure to false" but I tried this one:
wladm --url= --user= ... [--passwordfile=...] [--secure=false]
It says:
Secure mode is enabled, but an option '--passwordfile' is missing.
Anyone know where to change the secure to false since the url is just http and not https?
I don't think you're supposed to keep the square brackets in the command.
Try without. Simply --secure=false.
For more details, please refer to the wladm usage documentation at http://www.ibm.com/support/knowledgecenter/SSHS8R_7.1.0/com.ibm.worklight.appadmin.doc/admin/r_invoking_the_wladm_program.html.

Cannot create project when using cloud dataflow plugin for Eclipse

I want to try setup the development environment on Windows with Eclipse. But failed at the final step after successfully setting project id and gs bucket. The errors seems related to network (I have set proxy in Eclipse), I guess Maven need to set proxy, but how? Can someone confirm it? Thanks.
"Error encountered when trying to create project"
java.lang.reflect.InvocationTargetException
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:423)
at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:1059)
at com.google.cloud.dataflow.eclipse.ui.wizard.NewDataflowProjectWizard.performFinish(NewDataflowProjectWizard.java:50)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:853)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:438)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:619)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:832)
at org.eclipse.jface.window.Window.open(Window.java:808)
at org.eclipse.ui.actions.NewProjectAction.run(NewProjectAction.java:117)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:519)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:595)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:511)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:420)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
Caused by: java.lang.IllegalStateException: org.eclipse.core.runtime.CoreException: Could not resolve artifact com.google.cloud.dataflow:google-cloud-dataflow-java-archetypes-examples:pom:LATEST
at com.google.cloud.dataflow.eclipse.core.project.DataflowProjectCreator.run(DataflowProjectCreator.java:207)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
Caused by: org.eclipse.core.runtime.CoreException: Could not resolve artifact com.google.cloud.dataflow:google-cloud-dataflow-java-archetypes-examples:pom:LATEST
at org.eclipse.m2e.core.internal.embedder.MavenImpl$5.call(MavenImpl.java:776)
at org.eclipse.m2e.core.internal.embedder.MavenImpl$5.call(MavenImpl.java:1)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.resolve(MavenImpl.java:743)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.resolve(MavenImpl.java:720)
at com.google.cloud.dataflow.eclipse.core.project.DataflowArtifactRetriever.archetypePom(DataflowArtifactRetriever.java:54)
at com.google.cloud.dataflow.eclipse.core.project.DataflowProjectCreator.defaultArchetypeVersions(DataflowProjectCreator.java:250)
at com.google.cloud.dataflow.eclipse.core.project.DataflowProjectCreator.run(DataflowProjectCreator.java:204)
... 1 more
"Couldn't get archetype versions to use as default"
org.eclipse.core.runtime.CoreException: Could not resolve artifact com.google.cloud.dataflow:google-cloud-dataflow-java-archetypes-examples:pom:LATEST
at org.eclipse.m2e.core.internal.embedder.MavenImpl$5.call(MavenImpl.java:776)
at org.eclipse.m2e.core.internal.embedder.MavenImpl$5.call(MavenImpl.java:1)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.resolve(MavenImpl.java:743)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.resolve(MavenImpl.java:720)
at com.google.cloud.dataflow.eclipse.core.project.DataflowArtifactRetriever.archetypePom(DataflowArtifactRetriever.java:54)
at com.google.cloud.dataflow.eclipse.core.project.DataflowProjectCreator.defaultArchetypeVersions(DataflowProjectCreator.java:250)
at com.google.cloud.dataflow.eclipse.core.project.DataflowProjectCreator.run(DataflowProjectCreator.java:204)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
Contains: Failed to resolve version for com.google.cloud.dataflow:google-cloud-dataflow-java-archetypes-examples:pom:LATEST: Could not find metadata com.google.cloud.dataflow:google-cloud-dataflow-java-archetypes-examples/maven-metadata.xml in local (C:\Users\ztang16\.m2\repository)
org.eclipse.aether.resolution.VersionResolutionException: Failed to resolve version for com.google.cloud.dataflow:google-cloud-dataflow-java-archetypes-examples:pom:LATEST: Could not find metadata com.google.cloud.dataflow:google-cloud-dataflow-java-archetypes-examples/maven-metadata.xml in local (C:\Users\ztang16\.m2\repository)
at org.apache.maven.repository.internal.DefaultVersionResolver.resolveVersion(DefaultVersionResolver.java:313)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:302)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:223)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:294)
at org.eclipse.m2e.core.internal.embedder.MavenImpl$5.call(MavenImpl.java:753)
at org.eclipse.m2e.core.internal.embedder.MavenImpl$5.call(MavenImpl.java:1)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.resolve(MavenImpl.java:743)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.resolve(MavenImpl.java:720)
at com.google.cloud.dataflow.eclipse.core.project.DataflowArtifactRetriever.archetypePom(DataflowArtifactRetriever.java:54)
at com.google.cloud.dataflow.eclipse.core.project.DataflowProjectCreator.defaultArchetypeVersions(DataflowProjectCreator.java:250)
at com.google.cloud.dataflow.eclipse.core.project.DataflowProjectCreator.run(DataflowProjectCreator.java:204)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
Caused by: org.eclipse.aether.transfer.MetadataNotFoundException: Could not find metadata com.google.cloud.dataflow:google-cloud-dataflow-java-archetypes-examples/maven-metadata.xml in local (C:\Users\ztang16\.m2\repository)
at org.eclipse.aether.internal.impl.DefaultMetadataResolver.resolve(DefaultMetadataResolver.java:247)
at org.eclipse.aether.internal.impl.DefaultMetadataResolver.resolveMetadata(DefaultMetadataResolver.java:205)
at org.apache.maven.repository.internal.DefaultVersionResolver.resolveVersion(DefaultVersionResolver.java:250)
... 15 more
You seem to be hitting an issue when resolving the latest version of our Maven archetype for the examples project. The most inner exception seems to be:
org.eclipse.aether.transfer.MetadataNotFoundException:
Could not find metadata com.google.cloud.dataflow:google-cloud-dataflow-java-archetypes-examples/maven-metadata.xml
in local (C:\Users\YOUR-USERNAME\.m2\repository)
This indicates a problem in your local repository.
We have not seen this specific error before, but tangentially related problems have been resolved by manually deleting the following directory on your local machine and retrying.
C:\Users\YOUR-USERNAME\.m2\repository\com\google\cloud\dataflow\dataflow:google-cloud-dataflow-java-archetypes-examples
This would force Maven to reinitialize that part of the local repository, and perhaps recreate the missing metadata file.
That said, we have slightly changed how our Eclipse plugin interacts with the m2e plugin. The new code doesn't take this path through m2e at all. It is quite likely that this would be a non-issue with an updated code. We tentatively plan to release a new version next week, which would contain this change.
Now, there also could be an issue with a HTTP proxy configuration in your environment. I found this StackOverflow question, which explains how to configure advanced options of the M2Eclipse plugin, including the proxy settings. Dataflow Eclipse plugin is built on top of M2Eclipse and I would expect those setting to apply automatically.

Galago 3.5 Indexing

Downloaded Galago 3.5 bin version and tried to index wiki-small.corpus following this guide. Strangely I get a File Not Found Exception for the .index file when trying to run the build index command. This error goes away when I explicitly use the inputPath and indexPath but instead now I get this exception -
Created executor: org.lemurproject.galago.tupleflow.execution.LocalCheckpointedStageExecutor#69107c05
Running without server!
Use --server=true to enable web-based status page.
Stage inputSplit completed with 0 errors.
Mar 14, 2014 3:26:01 PM org.lemurproject.galago.core.parse.UniversalParser process
INFO: Processing split: /Users/nanz/Downloads/wiki-small.corpus
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at org.lemurproject.galago.core.parse.UniversalParser.process(UniversalParser.java:137)
at org.lemurproject.galago.core.parse.UniversalParser.process(UniversalParser.java:52)
at org.lemurproject.galago.core.types.DocumentSplit$FileIdOrder$TupleUnshredder.processTuple(DocumentSplit.java:2033)
at org.lemurproject.galago.core.types.DocumentSplit$FileIdOrder$DuplicateEliminator.processTuple(DocumentSplit.java:1989)
at org.lemurproject.galago.core.types.DocumentSplit$FileIdOrder$ShreddedBuffer.copyTuples(DocumentSplit.java:1705)
at org.lemurproject.galago.core.types.DocumentSplit$FileIdOrder$ShreddedBuffer.copyUntilFileId(DocumentSplit.java:1732)
at org.lemurproject.galago.core.types.DocumentSplit$FileIdOrder$ShreddedBuffer.copyUntil(DocumentSplit.java:1740)
at org.lemurproject.galago.core.types.DocumentSplit$FileIdOrder$ShreddedReader.run(DocumentSplit.java:1940)
at org.lemurproject.galago.tupleflow.FileOrderedReader.run(FileOrderedReader.java:76)
at org.lemurproject.galago.tupleflow.execution.LocalCheckpointedStageExecutor$LocalExecutionStatus.run(LocalCheckpointedStageExecutor.java:96)
at java.lang.Thread.run(Thread.java:695)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.lemurproject.galago.core.parse.UniversalParser.constructParserWithSplit(UniversalParser.java:213)
at org.lemurproject.galago.core.parse.UniversalParser.process(UniversalParser.java:132)
... 10 more
Caused by: java.lang.NullPointerException
at org.lemurproject.galago.core.index.KeyValueReader.getManifest(KeyValueReader.java:35)
at org.lemurproject.galago.core.index.corpus.CorpusReader.init(CorpusReader.java:41)
at org.lemurproject.galago.core.index.corpus.CorpusReader.(CorpusReader.java:32)
at org.lemurproject.galago.core.parse.CorpusSplitParser.(CorpusSplitParser.java:33)
... 16 more
Stage parsePostings completed with 1 errors.
java.lang.Exception: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
Exception in thread "main" java.util.concurrent.ExecutionException: Stage threw an exception:
at org.lemurproject.galago.tupleflow.execution.JobExecutor$JobExecutionStatus.waitForStages(JobExecutor.java:1062)
at org.lemurproject.galago.tupleflow.execution.JobExecutor$JobExecutionStatus.run(JobExecutor.java:971)
at org.lemurproject.galago.tupleflow.execution.JobExecutor.runWithoutServer(JobExecutor.java:1122)
at org.lemurproject.galago.tupleflow.execution.JobExecutor.runLocally(JobExecutor.java:1177)
at org.lemurproject.galago.core.tools.AppFunction.runTupleFlowJob(AppFunction.java:101)
at org.lemurproject.galago.core.tools.apps.BuildIndex.run(BuildIndex.java:789)
at org.lemurproject.galago.core.tools.AppFunction.run(AppFunction.java:55)
at org.lemurproject.galago.core.tools.App.run(App.java:82)
at org.lemurproject.galago.core.tools.App.run(App.java:73)
at org.lemurproject.galago.core.tools.App.main(App.java:69)
Caused by: java.lang.Exception: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at org.lemurproject.galago.tupleflow.execution.LocalCheckpointedStageExecutor$LocalExecutionStatus.run(LocalCheckpointedStageExecutor.java:99)
at java.lang.Thread.run(Thread.java:695)
I tried building the source code and I got the same results in that case as well. Can somebody point out where I am going wrong ? Hardly anybody seems to have faced this issue so there's not much I get via a simple Google search.
Solved. Just in case someone else faces this issue, one of my friends figured it out that Galago would not work directly on the wiki-small.corpus file as it tries to look for corpus.keys which do not exist for this. Just replace this .corpus file instead with the directory of documents and everything will work just fine. Do specify the indexPath and inputPath parameters explicitly. Use "galago build help" to view the exact syntax. Cheers.
I know this is late, but the wiki-small.corpus file from the textbook's website was built with an old version of galago, namely the 1.0 series, which is preserved in this google code repository: https://code.google.com/p/galagosearch/
The newer releases of Galago (2.0 ... 3.5 ...3.7) are part of newer development under the Lemur Project on sourceforge, and the corpus format has since changed. If you had a corpus file built with Galago 3.5, your commands should have worked.

Loading beans from Grails Script

I'm running a grails script to load a bean from the grails application, however, it seems that I have a dependency problem. Here it's my code:
import grails.spring.BeanBuilder
import org.springframework.context.ApplicationContext
target(main: "Script to load location information into Solr") {
println "Hello script"
def bb = new BeanBuilder()
ApplicationContext appContext = bb.createApplicationContext()
def service = appContext.getBean("solrjService")
}
setDefaultTarget(main)
When I execute the script I get the following stacktrace:
main:
Hello script
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:108)
at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:130)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.lang.IllegalAccessError: tried to access field org.slf4j.impl.StaticLoggerBinder.SINGLETON from class org.slf4j.LoggerFactory
at org.slf4j.LoggerFactory.staticInitialize(LoggerFactory.java:83)
at org.slf4j.LoggerFactory.<clinit>(LoggerFactory.java:73)
at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:155)
at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:131)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:272)
at grails.spring.BeanBuilder.<clinit>(BeanBuilder.java:84)
Any ideas ??
Thanks for your time
If your read the call stack, it's obviously a problem with SLF4J.
See http://slf4j.org/faq.html#IllegalAccessError
It looks like you may be mixing versions of the SLF4J jars, and getting a conflict.
But, of course, Burt is correct - once you get past this, you will find that you've initialized you BeanBuilder's ApplicationContext with no beans.
I had to include the target _GrailsBootstrap to be able to load my beans http://grails.org/doc/latest/guide/commandLine.html#creatingGantScripts
includeTargets << grailsScript("_GrailsBootstrap")
target ('default': "Load Location Information to Solr Server") {
depends(configureProxy, packageApp, classpath, loadApp, configureApp)
def service = appCtx.getBean('solrjService')
println service.getLocationSuggestion("Barcelona")
}
I run script his way (that's why I had a classpath problem)
grails run-script scripts/Myscript.groovy
Then now, I run it this way
grails Myscript.groovy
and I don't have any classpath problems :D
thanks for your help

Resources