Stanford CORENLP Master Keep Crashing (NullPointerException) - nlp

I downloaded the latest version of Stanford CoreNLP with the larger english model from this link
Placing the model downloaded in the same project folder, i am using "ant" / "ant jar" to build the project.
I then load the server using this command on windows:
java -d64 -mx20g -classpath "*;lib\*;liblocal\*;libsrc\*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer -timeout 500000
Loading the result page from http://localhost:9000 , the server crashes when using filters such as relations, coreference.
I get the error:
java.util.concurrent.ExecutionException: java.lang.NullPointerException
The log from server:
Some annotation fail such as:
[pool-1-thread-1] INFO edu.stanford.nlp.pipeline.MentionAnnotator - Error with building coref mention annotator!
And the main problem / exception:
java.util.concurrent.ExecutionException: java.lang.NullPointerException
at java.util.concurrent.FutureTask.report(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at edu.stanford.nlp.pipeline.StanfordCoreNLPServer$CoreNLPHandler.handle(StanfordCoreNLPServer.java:497)
at com.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)
at sun.net.httpserver.AuthFilter.doFilter(Unknown Source)
at com.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)
at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(Unknown Source)
at com.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)
at sun.net.httpserver.ServerImpl$Exchange.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at edu.stanford.nlp.pipeline.MentionAnnotator.annotate(MentionAnnotator.java:100)
at edu.stanford.nlp.pipeline.AnnotationPipeline.annotate(AnnotationPipeline.java:75)
at edu.stanford.nlp.pipeline.StanfordCoreNLP.annotate(StanfordCoreNLP.java:606)
at edu.stanford.nlp.pipeline.StanfordCoreNLPServer$CoreNLPHandler.lambda$handle$344(StanfordCoreNLPServer.java:479)
at java.util.concurrent.FutureTask.run(Unknown Source)
... 3 more
Any help on what could be causing this would be much appreciated.
Thanks

What are you feeding to the library? I used to run coreNLP library in IntelliJ and Netbeans and I had an issue where if I fed a blank space (either one or more spaces, a tab or an empty blank line) I would get a null pointer exception. I had to check every sentence so they wouldn't be blank when feeding it to the coreNLP library. (I was storing each sentence as a String in a Array, so if I stored a blank string in the array and passed it to the CoreNLP library it would crash). I don't know if its your case but hope this helps.

Related

AndroidPlot null pointer exception, Android Studio

I was given this error in the google play console:
java.lang.NullPointerException:
1. at com.androidplot.Plot$BufferedCanvas.recycle (Plot.java:225)
2. at com.androidplot.Plot$1.run (Plot.java:407)
3. at java.lang.Thread.run (Thread.java:818)
can someone explain why this is happening and suggest how I could fix this.
Thanks.

What happens - NoSuchMethodError: com.datastax.driver.core.ResultSet.fetchMoreResults

cassandra-connector-assembly-2.0.0 built from github project.
with Scala 2.11.8, cassandra-driver-core-3.1.0
sc.cassandraTable("mykeyspace", "mytable").select("something").where("key=?", key).mapPartitions(par => {
par.map({ row => (row.getString("something"), 1 ) })
})
.reduceByKey(_ + _).collect().foreach(println)
The same job works fine for reading less mass data
java.lang.NoSuchMethodError: com.datastax.driver.core.ResultSet.fetchMoreResults()Lshade/com/datastax/spark/connector/google/common/util/concurrent/ListenableFuture;
at com.datastax.spark.connector.rdd.reader.PrefetchingResultSetIterator.maybePrefetch(PrefetchingResultSetIterator.scala:26)
at com.datastax.spark.connector.rdd.reader.PrefetchingResultSetIterator.next(PrefetchingResultSetIterator.scala:39)
at com.datastax.spark.connector.rdd.reader.PrefetchingResultSetIterator.next(PrefetchingResultSetIterator.scala:17)
at scala.collection.Iterator$$anon$11.next(Iterator.scala:409)
at scala.collection.Iterator$$anon$11.next(Iterator.scala:409)
at scala.collection.Iterator$$anon$12.next(Iterator.scala:444)
at com.datastax.spark.connector.util.CountingIterator.next(CountingIterator.scala:16)
at scala.collection.Iterator$$anon$11.next(Iterator.scala:409)
at org.apache.spark.util.collection.ExternalSorter.insertAll(ExternalSorter.scala:194)
at org.apache.spark.shuffle.sort.SortShuffleWriter.write(SortShuffleWriter.scala:63)
at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:79)
at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:47)
at org.apache.spark.scheduler.Task.run(Task.scala:85)
at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:274)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Can any one suggest or point out to the issue, and a possible solution?
had the same problem
There were two dependencies in the project which both had cassandra-driver-core as a dependency
spark-cassandra-connector_2.11-2.0.0-M3 &
job-server-api_2.10-0.8.0-SNAPSHOT
spark-cassandra-connecter expected ResultSet.fetchMoreResults to have a different return type, due to its shading of guava
expected . shade.com.datastax.spark.connector.google.common.util.concurrent.ListenableFuture
found .
com.google.common.util.concurrent.ListenableFuture
switched to an unshaded version of cassandra-connector to correct the issue
It is a conflict with the Cassandra driver-core that
libraryDependencies += "com.datastax.spark" % "spark-cassandra-connector_2.11" % "2.0.0-M3"
brings in.
If you go into the ~/.ivy2/cache/com.datastax.spark/spark-cassandra-connector_2.11 you will find a file called ivy-2.0.0-M3.xml
In that file the dependency is
com.datastax.cassandra" name="cassandra-driver-core" rev="3.0.2" force="true"
Note that it is the 3.0.2 version of Cassandra driver core which gets overrun by the more recent one.
It just so happens that the latest source on Github does not show a implementation for fetchMoreResults which is inherited from interface PagingIterable
If you roll back the Git version to 3.0.x on Github, you'll find
public ListenableFuture<ResultSet> fetchMoreResults();
So it looks like the newest Cassandra core drivers were rushed out the door incomplete. Or I might be missing something. Hope this helps.
tl;dr; Remove the latest driver and use the one embedded in the spark cassandra connector.
The problem is resolved by removing cassandra-driver-core-3.1.0-shaded.jar from spark/jars/
a topical java duplicated classes conflicted problem?!
Need to confirm all jars included, if there're any duplicated jars involved.
The solution mentioned above is only one of case.
For all these problems run below command and check if there is any overlapping dependency exists-
mvn dependency:tree

MLlib: java.lang.UnknownError: no bin was found for continuous variable

I am using the decision tree algorithm and I get the following error. I have more than 500 features. Is that a problem? Any help would be great!
java.lang.UnknownError: no bin was found for continuous variable.
at org.apache.spark.mllib.tree.DecisionTree$.findBin$1(DecisionTree.scala:492)
at org.apache.spark.mllib.tree.DecisionTree$.org$apache$spark$mllib$tree$DecisionTree$$findBinsForLevel$1(DecisionTree.scala:529)
at org.apache.spark.mllib.tree.DecisionTree$$anonfun$3.apply(DecisionTree.scala:653)
at org.apache.spark.mllib.tree.DecisionTree$$anonfun$3.apply(DecisionTree.scala:653)
at scala.collection.Iterator$$anon$11.next(Iterator.scala:328)
at scala.collection.Iterator$class.foreach(Iterator.scala:727)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
at scala.collection.TraversableOnce$class.foldLeft(TraversableOnce.scala:144)
at scala.collection.AbstractIterator.foldLeft(Iterator.scala:1157)
at scala.collection.TraversableOnce$class.aggregate(TraversableOnce.scala:201)
at scala.collection.AbstractIterator.aggregate(Iterator.scala:1157)
at org.apache.spark.rdd.RDD$$anonfun$21.apply(RDD.scala:838)
at org.apache.spark.rdd.RDD$$anonfun$21.apply(RDD.scala:838)
at org.apache.spark.SparkContext$$anonfun$23.apply(SparkContext.scala:1116)
at org.apache.spark.SparkContext$$anonfun$23.apply(SparkContext.scala:1116)
at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:111)
at org.apache.spark.scheduler.Task.run(Task.scala:51)
at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:187)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
14/08/13 16:36:06 ERROR ExecutorUncaughtExceptionHandler: Uncaught exception in thread Thread[Executor task launch worker-0,5,main]
java.lang.UnknownError: no bin was found for continuous variable.
at org.apache.spark.mllib.tree.DecisionTree$.findBin$1(DecisionTree.scala:492)
at org.apache.spark.mllib.tree.DecisionTree$.org$apache$spark$mllib$tree$DecisionTree$$findBinsForLevel$1(DecisionTree.scala:529)
at org.apache.spark.mllib.tree.DecisionTree$$anonfun$3.apply(DecisionTree.scala:653)
at org.apache.spark.mllib.tree.DecisionTree$$anonfun$3.apply(DecisionTree.scala:653)
at scala.collection.Iterator$$anon$11.next(Iterator.scala:328)
at scala.collection.Iterator$class.foreach(Iterator.scala:727)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
at scala.collection.TraversableOnce$class.foldLeft(TraversableOnce.scala:144)
at scala.collection.AbstractIterator.foldLeft(Iterator.scala:1157)
at scala.collection.TraversableOnce$class.aggregate(TraversableOnce.scala:201)
at scala.collection.AbstractIterator.aggregate(Iterator.scala:1157)
at org.apache.spark.rdd.RDD$$anonfun$21.apply(RDD.scala:838)
at org.apache.spark.rdd.RDD$$anonfun$21.apply(RDD.scala:838)
at org.apache.spark.SparkContext$$anonfun$23.apply(SparkContext.scala:1116)
at org.apache.spark.SparkContext$$anonfun$23.apply(SparkContext.scala:1116)
at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:111)
at org.apache.spark.scheduler.Task.run(Task.scala:51)
at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:187)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
It was indeed happening due to unclean input data. Few rows had "NaN" entry for a column. Once we cleaned up that, everything was fine.

biff exception: unrecognizedOLE

Just trying to read from an ordinary excel file which I craeted using microsoft excel starter 2010 and saved as an excel 97-2003 file because I originally thought the exception was due to the file format. Apparently this exception means there is something embedded in the file that cannot be read, but for the life of me I dont know how or why that is. It's just a simple excel file I typed out myself. The stacktrace is as follows:
[CDATA[jxl.read.biff.BiffException: Unable to recognize OLE stream
at jxl.read.biff.CompoundFile.<init>(CompoundFile.java:116)
at jxl.read.biff.File.<init>(File.java:127)
at jxl.Workbook.getWorkbook(Workbook.java:221)
at jxl.Workbook.getWorkbook(Workbook.java:198)
at test.ExcelClass.updateTestResultsSpreadsheet(ExcelClass.java:1707)
at test.Internal_TestSuite.afterSuite(Internal_Virgin_TestSuite.java:846)
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.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:543)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:212)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:309)
at org.testng.SuiteRunner.run(SuiteRunner.java:241)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1169)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1094)
at org.testng.TestNG.run(TestNG.java:1006)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:107)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:199)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:170)
]]>
I have used similar files without this exception being thrown. Any ideas?? Thanks in advance!
UPDATE: I solved the problem by removing another MS excel starter 2010 (.xlsx) file I was using elsewhere in my testNG class and making it a .xls file. It appears the stacktrace was not pointing at the correct location of the problem? Or at least it didn't change when I removed the first file? Anyway it's fixed, the JExcel api isn't compatible with other excel formats.

WSDL to Java -client creation error

I am trying to create a web service from the WSDL but is repeatedly giving me the following error. Tried refreshing axis.jar in the build path but is still giving same error whereas I have another WSDL and client is very well being generated for the same.
Anyone here who has encountered something similar?
IWAB0399E Error in generating Java from WSDL: WSDLException (at
/definitions/types/xsd:schema): faultCode=OTHER_ERROR: An error
occurred trying to resolve schema referenced at
'#sp.schema.url#/FinancialStatement.xsd', relative to
'file:/C:/hrishi_workspace/findata/web/wsdl/FinancialStatement.wsdl'.:
This file was not found:
file:/C:/hrishi_workspace/findata/web/wsdl/#sp.schema.url#/FinancialStatement.xsd:
java.io.FileNotFoundException: This file was not found:
file:/C:/hrishi_workspace/findata/web/wsdl/#sp.schema.url#/FinancialStatement.xsd
at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(Unknown
Source) at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown
Source) at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown
Source) at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at
com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at
com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at
org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:516)
at
org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:495)
at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361)
Thanks.
Rishi
It looks as if your file:/C:/hrishi_workspace/findata/web/wsdl/FinancialStatement.wsdl is making a reference to an external schema file. If you look inside that WSDL file, under the definitions/types/xsd:schema element, you'll have one or more xsd:include and/or xsd:import. These elements may have a schemaLocation attribute; look for the one that ends in FinancialStatement.xsd; I suspect it has the #sp.schema.url# in there which to me looks like a placeholder that is probably supposed to be changed by your build script or something else... Replace that with the relative path between the WSDL and XSD; if they are in the same folder, simply use the XSD file name. It should take care of the error. Once it works, you should try to understand what's with that placeholder, and maybe figure out what you need to configure in your particular environment to make it work like that...

Resources