Forums de discussion

"Active Connection is Required" on LR 6.1.1 webservice call

Cedric Lecarpentier, modifié il y a 9 années.

"Active Connection is Required" on LR 6.1.1 webservice call

New Member Publications: 9 Date d'inscription: 09/06/14 Publications récentes
Hello,

I'm currently working with Lifery 6.1.1, I've created a remote service in service.xml of one of my portlets.
When calling for the first time this webservice in my browser, I'm getting this exception:
java.lang.IllegalArgumentException: Active Connection is required

When calling a second time this webservice, I'm getting no error and the expected result as JSON.

First note : I've written other webservices that work fine (in other portlets).
Second note : my portal-ext.properties file contains the following property: jsonws.web.service.public.methods=get*,retrieve*,fetch*
Third note : the call is the following: https://<myservername>/actualites-portlet/api/secure/jsonws/actualitesawarness/get-user-actu?<myparameters>
Fourth (and the strangest) note : The method I'm calling with the webservice is called getUserActu. When I change the method name into 'fetchUserActu', it still does not work at first call. But, when I change the method name into 'retrieveUserActu', the webservice works fine every time I run it, even the first time. Like if the 'get' or 'fetch' prefix in my method name is a special pattern ?

Does the service builder have a special behavior with methods prefixed by the keyword 'get' or 'fetch' ? I know it's a strange hypothesis, but if simply changing the webservice name make it work, that's the only idea I've got.

Do you guys have already met this kind of issue ?

Thanks in advance for your ideas.
Cedric
Chandan Chawhan, modifié il y a 8 années.

RE: "Active Connection is Required" on LR 6.1.1 webservice call

New Member Envoyer: 1 Date d'inscription: 12/05/15 Publications récentes
Hi Cedric

I'm facing the same issue. Did you manage to resolve it? If yes, could you please share how?

Thanks
Chandan
thumbnail
Vilmos Papp, modifié il y a 8 années.

RE: "Active Connection is Required" on LR 6.1.1 webservice call

Liferay Master Publications: 529 Date d'inscription: 21/10/10 Publications récentes
I suspect, that in ServiceBuilder.java there's a check for custom methods, and probably it has some correlations with this problem. To get better understanding of it, you should compare the generated services with get/fetch and wtih retrieve prefixes.
Corrado Mirra, modifié il y a 6 années.

RE: "Active Connection is Required" on LR 6.1.1 webservice call

New Member Envoyer: 1 Date d'inscription: 05/01/17 Publications récentes
Hello everyone,
we are using Liferay 6.2 Ga6 facing the same issues, but..
after renaming our jsonws method from getTest to doTest the problem was succesfully resolved.