Foros de discusión

NPE on JSONWebServiceServiceAction

Peter Helgren, modificado hace 6 años.

NPE on JSONWebServiceServiceAction

Regular Member Mensajes: 124 Fecha de incorporación: 14/11/13 Mensajes recientes
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, modificado hace 6 años.

RE: NPE on JSONWebServiceServiceAction

Liferay Legend Mensajes: 14918 Fecha de incorporación: 2/09/06 Mensajes recientes
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, modificado hace 6 años.

RE: NPE on JSONWebServiceServiceAction (Respuesta)

Liferay Legend Mensajes: 1554 Fecha de incorporación: 24/09/09 Mensajes recientes
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, modificado hace 6 años.

RE: NPE on JSONWebServiceServiceAction

Regular Member Mensajes: 124 Fecha de incorporación: 14/11/13 Mensajes recientes
Thanks That seems to have helped to generate more information which has led to more questions (of course)... will post in new thread.