-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cant create JVM Error #13
Comments
@avinashmkb Are you able to creata a Java VM from scratch outside of the gem, using Rjb? What does the following output?
|
Guess the JAVA VM does not get created using RJB itself , so the problem is not with stanford nlp gem :( |
Hi I managed to solve the issue with RJB and now RJB is working but still i get the below error in irb ubuntu@ip-10-130-70-172:~/shoutout_web$ irb The file joda-time.jar is located in the gem's bin directory |
Do you have multiple versions of the stanford-core-nlp gem? Then maybe the jar is in one of the alternate version's bin folder. Did you happen to check this? |
Yes, that may be the problem. You need to copy the files from one version's folder to the other. |
Also, #14 may have affected you. |
Yes it is now fixed thanks a lot ! |
OK great! |
I thought I had the JVM error fixed, but when I ran my app today I got the can't create Java VM error on the stanford-core-nlp-0.3.0 gem. Infact when I ran pipeline = StanfordCoreNLP.load(:tokenize, :ssplit, :pos, :lemma, :parse, :ner, :dcoref) on the console I got a Segmentation fault. The JVM seems to be getting created correctly for rjb (on the console), but is throwing this error for the StanfordCoreNLP gem. Would you happen to have any suggestions? Thanks! |
Can you please update to the latest version of the gem and try with that? |
I saw that you'd reported that the JVM error could be caused by insufficient RAM. I think this could be the cause, since our app was moved to a new server recently. I have to check with my professor before increasing the memory available to the application. |
OK! Please do report back when you have a chance. |
The system has about 151MB free, and when I looked up Stanford NLP's page I found that it would need at least 2GB of memory. Could this probably be why I am getting the segmentation fault also, due to insufficient memory? |
I don't know the ins and outs of Rjb; it is possibly related, but I doubt that's the problem. My gut feeling is that you updated the gem but not the model files. Otherwise, can you narrow down the problem a bit? Does it occur only when you try to load all annotators at once, or does it occur regardless of what you load (see what happens when you remove each of them sequentially starting from the last one)? |
The JVM seems to be getting created now, but I am facing a problem with the stanford-core-nlp gem. When I run the following line on the console I get the below error. I am not sure what is wrong since the file mentioned in the highlighted line englishPCFG.ser.gz is in the appropriate folder. Any suggestions would be of great help! Thanks! > pipeline = StanfordCoreNLP.load(:tokenize, :ssplit, :pos, :lemma, :parse, :ner, :dcoref) |
You're going to hate me for this, but ... Can you try with the latest gem version? I'm pretty sure your issue has been fixed in there. |
I am getting the JVM error as well. I just started working with the gem today. Do you have any insite to what the issue might be? |
Hi Stefanie, What does the following output?
|
Hi Louis, I dont think I can upgrade to the latest version of the stanford NLP gem, since my app runs Ruby 1.8.7, with which the latest gem version may not be compatible! Would you happen to have any other suggestions for fixing the above error "Unable to resolve "edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz"? Could this have something to do with the fact that the grammar file is gzipped? It works fine on my development system, on which I have the gzipped format. Thanks! |
Hey LRamach, If you're motivated you could go and find the commit that fixes the bug, but I'm not even sure which one that is. A lot has changed since 0.3.0! I would suggest you upgrade to the latest version; I'm pretty sure that there are no Ruby-compatibility-breaking changes in there. |
Thanks! I will try that out! |
I'm having trouble with Ruby 1.9.3? rjb? jvm? treat? on Mac OS X 10.6. I tried to install treat with Ruby 1.8.7 but the data Hashes failed to load, I hacked the data files so they were old style Hashes, but then what should have ended up being worker Classes (I think) ended up being Structs :/ something to do with 1.8.7 not having 'define_singleton_method' (I think) Here's what (irb):4: [BUG] Segmentation fault Control frame information ----------------------------------------------- -- Ruby level backtrace information ---------------------------------------- -- C level backtrace information ------------------------------------------- See Crash Report log file under ~/Library/Logs/CrashReporter or -- Other runtime information -----------------------------------------------
[NOTE] BTW my use of the treat gem could be viewed as trivial as all I'm after is splitting text into sentences and phrases ready for translation, which could be done with regex ,with the odd tolerable error, so treat is probably overkill for what I want. Thanks for your work :) |
Hey, I believe this is an issue with Rjb 1.4.5. The fix is to:
See #17. Please report if it works! |
Have done as suggested and also added "gem 'rjb', "1.4.3" to the app's Gemfile and then did bundle update Ok rjb 1.4.3 seems to load and function in the RoR console :), but ... here's what I get creating the awt point 1.9.3-p327 :009 > Point = Rjb::import('java.awt.Point') So the point is there, but for some reason treat produces a 'NoMethodError' exception. In irb I get this 1.9.3-p327 :001 > $DEBUG=true Another Exception but Hey it works. Thanks again :) |
Weird - this is probably due to a Treat DSL/Rjb conflict. You shouldn't have any problems when actually using Treat, though. I'll look into this soon. |
I'm not sure if this is the right place for this but, .... Installer Output for failed gems
Warning: couldn't install gem 'bson_ext' (bson_ext requires bson (
Everything else installed OK I've installed the gems manually and all went well except for linkparser which gave this error checking for pkg-config... yes So a missing package or an unset environment variable. I'm not sure if the gem install failures are an rvm issue treat is functioning (at least for my basic needs) except when I call :parse or .parse I get this error in the rails app console .9.3-p327 :001 > include Treat::Core::DSL 1.9.3-p327 :005 > s1.parse Just thought I'd let you know :-) It'd be nice to get phrases from the sentences, but hey.... Cheers |
I need to fix this and put a better error message, but I think this is just because you did not tokenize the sentence before parsing it. |
Hmmn that seems kinda counter intuitive, from the manual .... Parsers Parsers parse a group of words (a sentence, phrase or fragment) into its syntactical tree. s = sentence('The prospect of an Asian arms race is genuinely frightening.').parse ... and Tokenizers Tokenizers split a group of words (a sentence, phrase or fragment) into tokens. s = sentence('An uninteresting sentence, yes it is.').tokenize ... So reading that I thought tokens would be too fine grained for what I want and I thought the output from a Parser would contain the tokens anyway. Does it depend on the Parser? I'll try what you suggest BTW there's a typo I've noticed in the manual under "Word stemming" it says "Available annotators" instead of Cheers |
Thanks for the typo. The manual is outdated, you need to tokenize before parsing. All parsers perform tokenizing as a first step, so it's logical to separate that from the parsing process. There was a limitation that I hadn't managed to get around initially with the Stanford parser, but it's now been fixed. |
Please pardon my NLP ignorance :) PS the rails webrick server can't cope with the java VM used by the stanford gem, I've switched to another server https://github.com/37signals/pow. Thanks again Louis |
Please be patient, we are working on this issue! |
I have installed RJB and the followed all instructions as suggested in your gem documentation.
Have installed JAVA 1.6 and set the $JAVA_HOME TO /home/avinash/jdk1.6.0_38 similarly i have set $LD_LIBRARY_PATH=/home/avinash/jdk1.6.0_38/lib
Also defined Ruby Enviroment variables
ENV['JAVA_HOME'] = "/home/avinash/jdk1.6.0_38"
ENV['LD_LIBRARY_PATH']="/home/avinash/jdk1.6.0_38/lib"
[root@avinash shoutout_railsengine]# IRB
'-bash: IRB: command not found
[root@avinash shoutout_railsengine]# irb
irb(main):001:0> require 'stanford-core-nlp'
=> true
irb(main):002:0> StanfordCoreNLP.log_file = 'log.txt'
=> "log.txt"
irb(main):003:0> StanfordCoreNLP.set_model('pos.model', 'english-left3words-distsim.tagger')
=> "taggers/english-left3words-distsim.tagger"
irb(main):004:0> text = 'Angela Merkel met Nicolas Sarkozy on January 25th in '
=> "Angela Merkel met Nicolas Sarkozy on January 25th in "
irb(main):005:0> pipeline = StanfordCoreNLP.load(:tokenize, :ssplit, :pos, :lemma, :parse, :ner, :dcoref)
RuntimeError: can't create Java VM
from /usr/local/lib/ruby/gems/1.9.1/gems/bind-it-0.2.0/lib/bind-it/jar_loader.rb:19:in
load' from /usr/local/lib/ruby/gems/1.9.1/gems/bind-it-0.2.0/lib/bind-it/jar_loader.rb:19:in
init'from /usr/local/lib/ruby/gems/1.9.1/gems/bind-it-0.2.0/lib/bind-it/jar_loader.rb:36:in
load' from /usr/local/lib/ruby/gems/1.9.1/gems/bind-it-0.2.0/lib/bind-it/binding.rb:56:in
load_jar'from /usr/local/lib/ruby/gems/1.9.1/gems/bind-it-0.2.0/lib/bind-it/binding.rb:64:in
block in load_default_jars' from /usr/local/lib/ruby/gems/1.9.1/gems/bind-it-0.2.0/lib/bind-it/binding.rb:61:in
each'from /usr/local/lib/ruby/gems/1.9.1/gems/bind-it-0.2.0/lib/bind-it/binding.rb:61:in
load_default_jars' from /usr/local/lib/ruby/gems/1.9.1/gems/bind-it-0.2.0/lib/bind-it/binding.rb:48:in
bind'from /usr/local/lib/ruby/gems/1.9.1/gems/stanford-core-nlp-0.3.5/lib/stanford-core-nlp.rb:118:in
load' from (irb):5 from /usr/local/bin/irb:12:in
The text was updated successfully, but these errors were encountered: