留言板

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

thumbnail
Rohan Manohar Bhagwat,修改在6 年前。

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

New Member 发布: 1 加入日期: 15-6-25 最近的帖子
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,修改在6 年前。

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

Junior Member 帖子: 28 加入日期: 17-5-18 最近的帖子
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,修改在6 年前。

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

Junior Member 帖子: 32 加入日期: 13-5-21 最近的帖子
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,修改在6 年前。

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

Junior Member 帖子: 28 加入日期: 17-5-18 最近的帖子
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,修改在6 年前。

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

Junior Member 帖子: 32 加入日期: 13-5-21 最近的帖子
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,修改在6 年前。

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

Junior Member 帖子: 28 加入日期: 17-5-18 最近的帖子
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,修改在6 年前。

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

Liferay Legend 帖子: 2416 加入日期: 10-12-22 最近的帖子
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,修改在5 年前。

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

New Member 帖子: 10 加入日期: 13-11-12 最近的帖子

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.