We are trying to use the Ubercart Products Recommender (6.x-2.0-alpha1) working, and when running the recommender from the recommender admin interface, and then executing run.sh from the shell, we are getting status=failure and the following message:
Command evaluation error. See script log for details. Error: Sourced file: inline evaluation of: ``app.runRecommender(); //uc_rec_i2i;'' : Method Invocation app.runRecommender : at Line: 1 : in file: inline evaluation of: ``app.runRecommender(); //uc_rec_i2i;'' : app .runRecommender ( ) Target exception: java.lang.NullPointerException
I've done a lot of searching but don't seem to be getting any clues on the source of the issue. Hoping that someone with more knowledge in this area can point me in the right direction.
Thanks
Comments
Comment #1
shotokai commentedTo try and figure things out a bit better I installed the history recommender as well. Can't get that to work either. Here is the shell output when running run.sh
Any guidance greatly appreciated!
Comment #2
danithaca commentedHave you modified run.sh? If so, please post it as well.
Also, you might delete all records in the {async_command} table before try to run it again.
Let me know if you still experience this problem.
Comment #3
shotokai commentedDan - thanks for your help!
The only modification to run.sh is that I uncommented CONFIG_FILE in async_command/run.sh:
Before uncommenting that line it was reading my database name incorrectly (placing a / before the name) and was unable to connect.
I've tried flushing that table but still the same output at the shell. Thanks again.
Comment #4
danithaca commentedI'm make considerable changes to the code these days. I'll give it a thorough test once it's done.
Comment #5
danithaca commentedPlease try 6.x-3.0-alpha4. The problem seems to be fixed.
It's a little strange that I see this problem too on my other development machine. But when I restart that machine, the problem goes away. I suspect this is some java class loading problem.
Comment #6
superfedya commentedAfter re-installation of the alpha4 it doesn't works...
Command evaluation error. See script log for details. Error: Sourced file: inline evaluation of: ``app.runRecommender();'' : Method Invocation app.runRecommender : at Line: 1 : in file: inline evaluation of: ``app.runRecommender();'' : app .runRecommender ( ) Target exception: java.lang.NullPointerExceptionI removed Rec, Async and reinstalled it, same problem.
Ping me works fine (Ping successful.).
On the test site (same server) it works fine. So, it's database fault? How I can erase this module completely?
Thanks
Comment #7
superfedya commentedIt doesn't work even after install of Alpha 1.
upd. it works after update to Alpha 2.
Alpha 3 - works.
Alpha 4 - works.
So strange. maybe because for alpha 2 I use WinSCP and not FileZilla...
Comment #8
danithaca commentedIt's a strange problem... My own experience is that sometimes Java stores old cache to old classes, and then even though you update the new classes on the hard drive won't clean up the cache in memory. But this is my own hypothesis. I'm not sure if it's the reason.
So I'd consider this issues as fixed. If you have other questions, feel free to reopen it.
Comment #9
neilnz commentedThis is not fixed in alpha4, I had the exact same output as #1
Java:
run.sh from the recommender module (stock) and using the config.properties edited only for database settings.
I'm running the git tip of recommender 6.x-3.x and async_command 6.x-1.x.
It appears that the use of eval() is masking the actual source of the NullPointerException. I traced the actual cause of it down to this code in RecommenderApp.java:
Running in a debugger, I noticed that tableName is set to "{recommender_prediction}". This table is empty on a new install. This means that DrupalUtils.getLong returns null. You can't store null in a primitive long, so it throws a NullPointerException that bubbles all the way back up and crashes the whole app.
Here's a possible solution that works for me, swapping the primitive long for Long, which can accept null:
It now runs to completion and populates the table properly.
It looks like future (D7) versions of this work in a different way, so this fix is possibly not forward-portable.
An alternative quick fix for those having trouble is to insert a dummy row into recommender_similarity with an update timestamp to get up and running.
Comment #10
superfedya commentedSo, I just need to replace those 2 lines:
By:
Done and reinstalled Recommender. But still have same issue.
Too many problems with this module :( I uninstalled it and waiting to the next version.
How I can do that?
Thanks
Comment #11
danithaca commentedRelease 6.x-3.x is not supported anymore. Please consider upgrading to 7.x-6.x release for D7.
Comment #12
danithaca commented