-
Notifications
You must be signed in to change notification settings - Fork 43
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
Another null pointer exception #42
Comments
Can you please add the Listing model to your issue report? I've done quite some work on the JPATransformer, which fetches the models from database, but the Transformer has not (yet) been updated accordingly (see #32). In case you are using @ElasticSearchField annotations, this is what is probably causing the NPE. If you show us your Listing model we can confirm and help to fix it. |
The Listing model (only the field/property definitions) is shown below.
|
I just read issue #32 and it seems to be the problem I am facing. |
Thanks for posting your model. Yes, it appears that the use of @es annotations causes your NPE. I only use the JPATransformer myself, so this is a good case to update the Transformer. I'll get back to you when I make some progress on it. |
My apologies if I sound demanding but do you have a rough estimate of completing the updating of the Transformer? |
I'll try to make some progress this weekend :) |
Thanks mate :) |
Hi, as you can see I've commited some new code. It requires more testing; I mainly use the JPA-hydrated-results path, so please provide feedback once you have tested the new code. Are you able to roll your own (test) release so you test it out, or do you need a new "official" release for that? |
You're a legend. I'll have a go later today. |
Have you been able to have a go with the new code? |
My apologies I have been dealing with client woes. I did pull the latest version from github but I couldn't get it to work. Something about ElasticSearch dont being abled to be resolved in the ElasticSearchController. I think it had to do with the java library path. I'll try it again, if I can't get it to work maybe a new official release is needed for us noobs. Thanks again. |
Hi, have you had another chance to take a look? |
Hi, I keep on getting the following error:
It's not finding the elasticsearch play module. Any ideas? Thanks |
If you add the git repo as a project in your IDE (I use eclipse), you need to add "src" as a source folder, otherwise it won't find the play module itself. |
My apologies for the late response. I have the src folder linked into the project now, however the MapperTransformer.java file seems to be missing from the repo. |
You are right, See #47 |
Finally got some time to look at the search today but unfortunately I'm still having problems with the pathing of modules. I've added the git repo to eclipse, added the src folder. I tried modifying the .classpath file myself. Linked folders in my main project as well but to no avail. The only difference I see when compared to the 0.3 version is that in the .classpath file there is a link to a jar file play-elasticsearch.jar as well as the linked source folder "src". Is it possible to create a new play framework module (0.4) so that I can just pull it into the project using play install module??? |
I will ask felipe to roll a new release; The new functionality needs to be explicity enabled so it won't break existing code. |
Hi, 0.4 was just released. Please give it a try and report back. |
Thank you for version 0.4 (This is my first java project, I didn't know what I was missing to get the module working from the repo). I am receiving another null pointer exception. I am using the model I listed earlier in the thread and the following search command:
which results in the following exception:
|
Looks like the MapperTransformer class isn't being utilised. |
Hi, to prevent other users from getting problems (as the new code is relatively untested), you need to explicitly enable it. Please use
to enable the MapperTransformer for a query. |
Thanks mate, everything seems to be working. I'll close the thread next week after some more testing. |
Hi,
Using version 0.3 and the following code to search
this nullpointerexception is being thrown:
play.exceptions.JavaExecutionException
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:229)
at Invocation.HTTP Request(Play!)
Caused by: java.lang.NullPointerException
at play.modules.elasticsearch.util.ReflectionUtil.setFieldValue(ReflectionUtil.java:351)
at play.modules.elasticsearch.util.ReflectionUtil.setFieldValue(ReflectionUtil.java:339)
at play.modules.elasticsearch.transformer.Transformer.toSearchResults(Transformer.java:68)
at play.modules.elasticsearch.Query.fetch(Query.java:173)
at play.modules.elasticsearch.ElasticSearch.search(ElasticSearch.java:145)
at play.modules.elasticsearch.ElasticSearch.search(ElasticSearch.java:96)
at models.Listing.search(Listing.java:285)
at controllers.BidAndBuy.search(BidAndBuy.java:15)
at play.mvc.ActionInvoker.invokeWithContinuation(ActionInvoker.java:546)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:500)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:476)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:471)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:159)
... 1 more
The text was updated successfully, but these errors were encountered: