-
Notifications
You must be signed in to change notification settings - Fork 40
NullPointerException when adding @NoCache annotation to a JAX-RS resource method #35
Comments
Hi, this occasionally happens when there are compiler errors on a field. Could you maybe check to see if there are no uncommitted changes? If there are errors like |
Hi @Shredder121, thanks for the answer! No, there is no uncommited changes and eclipse doesn't point any compile error. But maybe this is related to the fact I will take a look for any evidence that this is indeed what is causing this problem. In the mean time, do you agree this is an abstraction leak from apt-maven-plugin? It is pretty hard to infer a classpath issue from the NPE error message, do you think it is possible to provide a better message for this problem? Note: I vaguely remember of something like this happening a long time ago, but the root cause was something else. |
Yeah, the problem was really related to my classpath. Maven didn't know about my dependencies that were added by JBoss Tools. To fix this I removed the eclipse dependencies to see compile errors in eclipse before running the build. Here is the build that fixes the issue: https://travis-ci.org/FagnerMartinsBrack/WebStories/builds/54607699 But I believe the issue still stands, is there a way to provide a clearer error message to avoid this abstraction leak? Or there's a limitation that prevents you to do so? I see you mentioned:
Is there a workaround that could provide a better error message? Maybe detect the NPE and do something about that? Thanks again! |
Yes, I believe there is a workaround for exactly that. I still have to see if that is practical, but it looks like a very reproducible way of going about this. As for the clearer error message, I agree that it should be done, and a way back (with PR #34) I wanted to add support for 'generic' messages from javac/apt. I have some code that does this, just not the effective code that prints the actual error, since I still had to see if it was practical or not. |
Well then, it seems at least this was useful to document a valid use case :D |
Hi @timowest,
I am sorry to bother but something very strange started happening in my build today related to the apt plugin, here is the offending build log: https://travis-ci.org/FagnerMartinsBrack/WebStories/builds/54536967
it throws an "execute error" when executing the "--- apt-maven-plugin:1.1.1:process (default)" goal:
This happened exactly after the following commit: web-stories/WebStories@11ebada
Now, here is the problem: I have no idea where to start looking for it. This clearly seems to be happening due to some abstraction leak, but since I don't understand Maven and apt-maven-plugin internals, I have no idea where to start looking!
Do you have any idea of what could be happening in this case, maybe just to have something for me to look into? Could this be related to something that was already reported?
Local system data (if relevant):
pom.xml:
NOTE: I didn't started yet to create a reduced test case in hope you could find the root cause by the symptoms.
Thanks.
The text was updated successfully, but these errors were encountered: