Foros de discusión

Liferay 7.0.3 GA4 No rest extenders and cxf created using rest template

thumbnail
Rohan Manohar Bhagwat, modificado hace 6 años.

Liferay 7.0.3 GA4 No rest extenders and cxf created using rest template

New Member Mensaje: 1 Fecha de incorporación: 25/06/15 Mensajes recientes
After upgrading to GA4 I am facing an issue that no rest extender and cxf are created by default using rest template. You have to manually add the entries using Portal. Is there any work-around?
thumbnail
Sunit Chatterjee, modificado hace 6 años.

RE: Liferay 7.0.3 GA4 No rest extenders and cxf created using rest template

Junior Member Mensajes: 28 Fecha de incorporación: 18/05/17 Mensajes recientes
I am too seeing this issue, after upgrading to 7.0 GA4

Both the following configuration files are created correctly
- /resources/configuration/com.liferay.portal.remote.cxf.common.configuration.CXFEndpointPublisherConfiguration
- /resources/configuration/com.liferay.portal.remote.rest.extender.configuration.RestExtenderConfiguration

But on deployment of this module, the CXFEndpoint and RestExtender entries are not created automatically in the Portal.
I have to go to Control Panel manually and then add the required entries
thumbnail
Carlos Sierra, modificado hace 6 años.

RE: Liferay 7.0.3 GA4 No rest extenders and cxf created using rest template

Junior Member Mensajes: 32 Fecha de incorporación: 21/05/13 Mensajes recientes
Sunit Chatterjee:
I am too seeing this issue, after upgrading to 7.0 GA4

Both the following configuration files are created correctly
- /resources/configuration/com.liferay.portal.remote.cxf.common.configuration.CXFEndpointPublisherConfiguration
- /resources/configuration/com.liferay.portal.remote.rest.extender.configuration.RestExtenderConfiguration

But on deployment of this module, the CXFEndpoint and RestExtender entries are not created automatically in the Portal.
I have to go to Control Panel manually and then add the required entries


Please, just try appending .properties to the name of your configuration file. That should solve your problem.
thumbnail
Sunit Chatterjee, modificado hace 6 años.

RE: Liferay 7.0.3 GA4 No rest extenders and cxf created using rest template

Junior Member Mensajes: 28 Fecha de incorporación: 18/05/17 Mensajes recientes
Hi Carlos,

I tried the solution suggested by you, but it did not work

I created two Rest template based modules
- In first one, I appended .properties to configuration files
- In second one, I did not do any change and kept as it is

I deployed both modules, and CXFEndpoint and RestExtender were not created for either of the modules
thumbnail
Carlos Sierra, modificado hace 6 años.

RE: Liferay 7.0.3 GA4 No rest extenders and cxf created using rest template (Respuesta)

Junior Member Mensajes: 32 Fecha de incorporación: 21/05/13 Mensajes recientes
Hey,
you also need to change the header in the bundle from Configuration-Path to Liferay-Configuration-Path since https://github.com/liferay/liferay-portal/commit/5cc4ca0e6286947663ae7c1581aeb2b79ffee112

sorry I forgot to mention it in the previous post.
thumbnail
Sunit Chatterjee, modificado hace 6 años.

RE: Liferay 7.0.3 GA4 No rest extenders and cxf created using rest template (Respuesta)

Junior Member Mensajes: 28 Fecha de incorporación: 18/05/17 Mensajes recientes
Thanks Carlos.

It is Working now

So to summarize we need to do 2 changes to make it work
  • Change header in bnd file from Configuration-Path to Liferay-Configuration-Path
  • Adding .properties to end of both the configuration files


Thanks again
Sunit
thumbnail
Andrew Jardine, modificado hace 6 años.

RE: Liferay 7.0.3 GA4 No rest extenders and cxf created using rest template

Liferay Legend Mensajes: 2416 Fecha de incorporación: 22/12/10 Mensajes recientes
Hey Carlos,

Just out o curiosity (admittedly I have not looked yet) -- is this kind of change documented anywhere? Maybe in some release or upgrade notes? Again, I haven't looked -- but before I go digging, I thought I might just ask in case you knew.
Chad LaVigne, modificado hace 5 años.

RE: Liferay 7.0.3 GA4 No rest extenders and cxf created using rest template

New Member Mensajes: 10 Fecha de incorporación: 12/11/13 Mensajes recientes

Carlos, thank you for posting this very helpful answer, it got me past this issue after a long search.  Is it possible to set list values in the com.liferay.portal.remote.cxf.common.configuration.CXFEndpointPublisherConfiguration-cxf.properties file?  I want to force basic auth for my service so I need to set two authVerifierProperties values, auth.verifier.BasicAuthHeaderAuthVerifier.urls.includes=* and auth.verifier.BasicAuthHeaderAuthVerifier.basic_auth=true. When I do this via the control panel it works fine.  However, I would rather avoid the manual configuration in the Control Panel and want to use the properties file instead so the value get configured when the module is deployed.  However, I am unable to set these value because they get stored in the database as a string.  I think the correct syntax is something like this:

authVerifierProperties=["auth.verifier.BasicAuthHeaderAuthVerifier.urls.includes\=*","auth.verifier.BasicAuthHeaderAuthVerifier.basic_auth\=true"]

I have tried many variations of this syntax (with/without brackets, quotes, escapes, etc) but none of them seem to work.  The value stored is always just a string representation.  I have verified this by looking at the configuration_ table in the database, the value is surrounded by quotes.  However, if I edit the endpoint in the Control Panel and just click update, I can see the value is then stored in the database as an array. Do you know if this is a bug or maybe I'm just doing something wrong? Any help would be greatly appreciated.