Foren

NPE on JSONWebServiceServiceAction

Peter Helgren, geändert vor 6 Jahren.

NPE on JSONWebServiceServiceAction

Regular Member Beiträge: 124 Beitrittsdatum: 14.11.13 Neueste Beiträge
I have a JSON service that I am testing directly from /api/jsonws and I see the following error in the IDE console:

JSONWebServiceServiceAction:97] java.lang.NullPointerException

I can step through the call in debug. In this particular case, I have a module web service that invokes an API in another module and the call fails in the *second* module. My question is: Do BOTH modules need to have the API exposed as a JSON service call? In other words if only mymodule.foo is exposed as a web service but IT calls myothermodule.bar do BOTH api's have to be exposed as web services? If that is the case, then in explains the NULL value on the second call but if not, is there something I need to do so that that API in the second module can be invoked from another module?

I hope that is clear enough....still feeling my way through all the hoops here as I migrate these portlets from 6.0.6 to 7.0.....
thumbnail
David H Nebinger, geändert vor 6 Jahren.

RE: NPE on JSONWebServiceServiceAction

Liferay Legend Beiträge: 14919 Beitrittsdatum: 02.09.06 Neueste Beiträge
The 2nd shouldn't need to be exposed, but it does depend upon how you are getting and invoking it.









Come meet me at the 2017 LSNA!
thumbnail
Christoph Rabel, geändert vor 6 Jahren.

RE: NPE on JSONWebServiceServiceAction (Antwort)

Liferay Legend Beiträge: 1554 Beitrittsdatum: 24.09.09 Neueste Beiträge
I think, if you enable Debug Logging for JSONWebServiceServiceAction, you should get the full nullpointerexception in the log file. I have looked this up in the source code a while ago, but I never tried it.

Go to Control Panel -> Configuration -> Server Administration -> Log Levels.
You have to add com.liferay.portal.jsonwebservice there and set it to debug level.
Peter Helgren, geändert vor 6 Jahren.

RE: NPE on JSONWebServiceServiceAction

Regular Member Beiträge: 124 Beitrittsdatum: 14.11.13 Neueste Beiträge
Thanks That seems to have helped to generate more information which has led to more questions (of course)... will post in new thread.