Fórum
Liferay 7.0 JAX-RS - no services available
Kevin Matthews, modificado 7 Anos atrás.
Liferay 7.0 JAX-RS - no services available
Expert Postagens: 253 Data de Entrada: 25/01/16 Postagens Recentes
Hi, I am using the sample OSGI module JAX-RS from the sample module github.
1.) I imported the gradle project into eclipse
2.) I compile the project which generated a jar file.
3.) I install the jar file as a bundle using blade deploy
4) I verified the bundle was active
5.) I wen into control panel under System setting configured both CXF and Rest Extenders
- Search for CXF Endpoints under Foundations
- create new CXFEndpoint publisher configuration providing Context path rest-test
- Go back to System Settings > Foundation and select REST Extender
- create new Rest extender configuration (search with rest) providing Context paths /rest-test) and jaxrs.applications.filters set to: - (jaxrs.application=true)
However when I run
http://localhost:8080/o/rest-test/blade.users/list/ then I get no services available. Is there something I am doing wrong? Please advise I have attached the code
Thanks,
Kevin
1.) I imported the gradle project into eclipse
2.) I compile the project which generated a jar file.
3.) I install the jar file as a bundle using blade deploy
4) I verified the bundle was active
5.) I wen into control panel under System setting configured both CXF and Rest Extenders
- Search for CXF Endpoints under Foundations
- create new CXFEndpoint publisher configuration providing Context path rest-test
- Go back to System Settings > Foundation and select REST Extender
- create new Rest extender configuration (search with rest) providing Context paths /rest-test) and jaxrs.applications.filters set to: - (jaxrs.application=true)
However when I run
http://localhost:8080/o/rest-test/blade.users/list/ then I get no services available. Is there something I am doing wrong? Please advise I have attached the code
Thanks,
Kevin
Anexos:
A. Rock, modificado 7 Anos atrás.
RE: Liferay 7.0 JAX-RS - no services available
New Member Postagens: 6 Data de Entrada: 19/10/16 Postagens Recentes
I'm having the same Problem as well as the other developers at this post:
https://web.liferay.com/de/community/forums/-/message_boards/message/77759245
I'm guessing the code in the Java class is correct, but somehow our RestExtenderConfigruation is wrong.
If you're starting your liferay 7 server in debug mode you'll probable see some error or warning:
Could someone provide a screenshot or further explanation of what do add in
Control Panel --> Configuration --> System Settings -> Foundation --> REST Extender
to get the official Rest Blade Example up and running?
https://web.liferay.com/de/community/forums/-/message_boards/message/77759245
I'm guessing the code in the Java class is correct, but somehow our RestExtenderConfigruation is wrong.
If you're starting your liferay 7 server in debug mode you'll probable see some error or warning:
WARN [CM Event Dispatcher (Fire ConfigurationEvent: pid=com.liferay.portal.remote.rest.extender.configuration.RestExtenderConfiguration.07cbc538-6291-4d5b-b6a5-a9c953e4231d)][com_liferay_portal_remote_rest_extender:103] Invocation of 'addApplication' failed.
org.apache.cxf.service.factory.ServiceConstructionException
Could someone provide a screenshot or further explanation of what do add in
Control Panel --> Configuration --> System Settings -> Foundation --> REST Extender
to get the official Rest Blade Example up and running?
A. Rock, modificado 7 Anos atrás.
RE: Liferay 7.0 JAX-RS - no services available
New Member Postagens: 6 Data de Entrada: 19/10/16 Postagens Recentes
I was able to get the Blade Rest Example running.
I used the following basic liferay setup for the REST Example:
Steps to reproduce:
Hint:
I personally use a DHC REST Client Browser Extention for debugging my REST API.
@Kevin Matthews:
I also analysed your bladeRest.zip file and probably found the reason why our REST example is not working:
You're using @Path("/blade.users") instead of @ApplicationPath("/blade.users") as the class annotation. That's fixed in the newer Version of the blade example project
Have a look an the latest version of UserRestService and edit the class header with:
Give in another try then
I used the following basic liferay setup for the REST Example:
- Liferay Community Edition Portal 7.0.2 GA3 (Wilberforce / Build 7002 / August 5, 2016) bundled with Tomcat
- Eclipse Liferay IDE Latest release 3.0.1 (June 2016) with an new empty eclipse workspace
Steps to reproduce:
- Inside Eclipse, generate a fresh clean liferay-workspace and setup the download liferay bundle as the server runtime environment.
- startup the liferay-ce-portal-7.0-ga3 server in debug mode (to see possible problems in the console)
- Download or git clone the Blade Rest Example project
- Copy the Blade Rest Example project into the modules directory in you liferay-workspace, for example:
C:\DEV\WORKSPACE_LIFERAY7_GA2\my-liferay-workspace\modules\blade.rest - Inside the Eclipse IDE, click on the liferay-workspace project --> Gradle --> Refresh Gradle Project
- You should see the blade.rest project now as an eclipse project and can can build and deploy it to your liferay portal server --> Gradle Task --> "deploy"
You should see an INFO Message from the servers console simliar to this:16:49:17,231 INFO [fileinstall-C:/opt/Liferay/liferay-ce-portal-7.0-ga3/osgi/modules][BundleStartStopLogger:35] STARTED blade.rest_1.0.0 [548]
- Make sure that the gradle deployment to the liferay portal server worked properly, there are no errors in the console and you'll see the generated blade.rest.jar in the osgi modules folder from your portal server. For example, the *.jar should be deployed at
C:\opt\Liferay\liferay-ce-portal-7.0-ga3\osgi\modules\blade.rest.jar - Check twice via Apache Felix Gogo Shell Console if the blade.rest.jar is running as an active OSGi Bundle. Therefore, in Eclipse rightclick on your liferay-ce-portal-7.0-ga3 server and chosse in the context menu --> Open GoGo Shell
Use the lb command to check the statusg! lb rest START LEVEL 20 ID|State |Level|Name 129|Active | 10|Liferay Dynamic Data Mapping Data Provider REST (2.0.3) 279|Active | 10|Liferay Portal Remote REST Extender (2.0.3) 547|Active | 10|blade.rest (1.0.0)
In case you have the same problem I had, it can somtimes happen that there are more then one blade.rest modules from older deployments...In that case you can uninstall them via the command uninstall <processID>. So for the given example above you can deinstall the old osgi module withg! uninstall 547
- Now we open our portal in a webbrowser and sign in as admin user (default is test@liferay.com) and configure the CFX Endpoint:
(btw, this is the part I missunderstood in the offical tutorial section, cause I accidently thought CFX is only for webservices with SOAP)
Control Panel --> Stytem Settings --> Foundation --> CXF Endpoints --> Add Entry
As Context path we set an example url /rest-test
See screenshot: CXF_Endpoint_Setting.png - We also have to configure the REST Extender
Control Panel --> Stytem Settings --> Foundation --> REST Extender --> Add Entry
Context paths: /rest-test
jaxrs.applications.filters: (jaxrs.application=true)
My misstake was here, that I did not know that the param need to be with configured with parentesis (...)
See screenshot: Liferay_REST_Extender_Settings.png - Final Step:
If you don't see any errors in the console, you should be now able to call the configured REST API by the following url
http://localhost:8080/o/rest-test/blade.users/list/
Hint:
I personally use a DHC REST Client Browser Extention for debugging my REST API.
@Kevin Matthews:
I also analysed your bladeRest.zip file and probably found the reason why our REST example is not working:
You're using @Path("/blade.users") instead of @ApplicationPath("/blade.users") as the class annotation. That's fixed in the newer Version of the blade example project
Have a look an the latest version of UserRestService and edit the class header with:
@ApplicationPath("/blade.users")
@Component(
immediate = true, property = {"jaxrs.application=true"},
service = Application.class
)
public class UsersRestService extends Application {...}
Give in another try then
Kevin Matthews, modificado 7 Anos atrás.
RE: Liferay 7.0 JAX-RS - no services available
Expert Postagens: 253 Data de Entrada: 25/01/16 Postagens Recentes
Hi,
I have been running my JAX-RS web service for sometime by doing blade deploy. But now none of my services are not running and if I got to http://localhost:8080/o/portal-api/blade.rest/list its returning a 404. Also, I notice that the jar is not being copied to the C:\\liferay-ce-portal-7.0-ga3\osgi\modules. I started the server in debug mode and I am not able to see the deployment in that directory.
Can someone please help !
Thanks,
kevin
I have been running my JAX-RS web service for sometime by doing blade deploy. But now none of my services are not running and if I got to http://localhost:8080/o/portal-api/blade.rest/list its returning a 404. Also, I notice that the jar is not being copied to the C:\\liferay-ce-portal-7.0-ga3\osgi\modules. I started the server in debug mode and I am not able to see the deployment in that directory.
Can someone please help !
Thanks,
kevin
Jamie Sammons, modificado 7 Anos atrás.
RE: Liferay 7.0 JAX-RS - no services available
Expert Postagens: 297 Data de Entrada: 05/09/14 Postagens Recentes
Hi Kevin,
I just tried deploying blade.rest using the newly released blade CLI 2.0 and it seems to work for me. Please try updating to 2.0 and see if that helps.
-Jamie
I just tried deploying blade.rest using the newly released blade CLI 2.0 and it seems to work for me. Please try updating to 2.0 and see if that helps.
-Jamie
Benjamin BATBIE, modificado 7 Anos atrás.
RE: Liferay 7.0 JAX-RS - no services available
New Member Mensagem: 1 Data de Entrada: 24/12/15 Postagens Recentes
Hi everyone,
According to this sample, I've developed 2 different modules (let's say M1 and M2) that are deployed in Liferay.
However, M2 needs to use some APIs provided by M1.
Is there a way to configure M1 to provide such APIs as OSGi services and for M2 to depend on ? I would like to avoid making REST calls between M2 and M1 ...
Thank you.
According to this sample, I've developed 2 different modules (let's say M1 and M2) that are deployed in Liferay.
However, M2 needs to use some APIs provided by M1.
Is there a way to configure M1 to provide such APIs as OSGi services and for M2 to depend on ? I would like to avoid making REST calls between M2 and M1 ...
Thank you.
Siby Mathew, modificado 7 Anos atrás.
RE: Liferay 7.0 JAX-RS - no services available
Expert Postagens: 268 Data de Entrada: 04/03/11 Postagens Recentes
Hello Benjamin,
You can have a look in these videos where Liferay 7 dependencies are explained.
https://www.youtube.com/channel/UCVIWn7o3162j_lJFJfs7mDA
Thanks,
Siby Mathew
You can have a look in these videos where Liferay 7 dependencies are explained.
https://www.youtube.com/channel/UCVIWn7o3162j_lJFJfs7mDA
Thanks,
Siby Mathew
Adnan Yaqoob, modificado 6 Anos atrás.
RE: Liferay 7.0 JAX-RS - no services available
Junior Member Postagens: 36 Data de Entrada: 24/03/14 Postagens Recentes
I followed all your steps, double check twice but it doesn't works. I have downloaded the code from liferay blade sample (no change). Just deployed, it appear active but... when I tried to hit the url it takes me to the REST Extender page (which is weird)
A. Rock:
I was able to get the Blade Rest Example running.
I used the following basic liferay setup for the REST Example:
- Liferay Community Edition Portal 7.0.2 GA3 (Wilberforce / Build 7002 / August 5, 2016) bundled with Tomcat
- Eclipse Liferay IDE Latest release 3.0.1 (June 2016) with an new empty eclipse workspace
Steps to reproduce:
- Inside Eclipse, generate a fresh clean liferay-workspace and setup the download liferay bundle as the server runtime environment.
- startup the liferay-ce-portal-7.0-ga3 server in debug mode (to see possible problems in the console)
- Download or git clone the Blade Rest Example project
- Copy the Blade Rest Example project into the modules directory in you liferay-workspace, for example:
C:\DEV\WORKSPACE_LIFERAY7_GA2\my-liferay-workspace\modules\blade.rest- Inside the Eclipse IDE, click on the liferay-workspace project --> Gradle --> Refresh Gradle Project
- You should see the blade.rest project now as an eclipse project and can can build and deploy it to your liferay portal server --> Gradle Task --> "deploy"
You should see an INFO Message from the servers console simliar to this:16:49:17,231 INFO [fileinstall-C:/opt/Liferay/liferay-ce-portal-7.0-ga3/osgi/modules][BundleStartStopLogger:35] STARTED blade.rest_1.0.0 [548]
- Make sure that the gradle deployment to the liferay portal server worked properly, there are no errors in the console and you'll see the generated blade.rest.jar in the osgi modules folder from your portal server. For example, the *.jar should be deployed at
C:\opt\Liferay\liferay-ce-portal-7.0-ga3\osgi\modules\blade.rest.jar- Check twice via Apache Felix Gogo Shell Console if the blade.rest.jar is running as an active OSGi Bundle. Therefore, in Eclipse rightclick on your liferay-ce-portal-7.0-ga3 server and chosse in the context menu --> Open GoGo Shell
Use the lb command to check the statusg! lb rest START LEVEL 20 ID|State |Level|Name 129|Active | 10|Liferay Dynamic Data Mapping Data Provider REST (2.0.3) 279|Active | 10|Liferay Portal Remote REST Extender (2.0.3) 547|Active | 10|blade.rest (1.0.0)
In case you have the same problem I had, it can somtimes happen that there are more then one blade.rest modules from older deployments...In that case you can uninstall them via the command uninstall <processID>. So for the given example above you can deinstall the old osgi module withg! uninstall 547
- Now we open our portal in a webbrowser and sign in as admin user (default is test@liferay.com) and configure the CFX Endpoint:
(btw, this is the part I missunderstood in the offical tutorial section, cause I accidently thought CFX is only for webservices with SOAP)
Control Panel --> Stytem Settings --> Foundation --> CXF Endpoints --> Add Entry
As Context path we set an example url /rest-test
See screenshot: CXF_Endpoint_Setting.png- We also have to configure the REST Extender
Control Panel --> Stytem Settings --> Foundation --> REST Extender --> Add Entry
Context paths: /rest-test
jaxrs.applications.filters: (jaxrs.application=true)
My misstake was here, that I did not know that the param need to be with configured with parentesis (...)
See screenshot: Liferay_REST_Extender_Settings.png- Final Step:
If you don't see any errors in the console, you should be now able to call the configured REST API by the following url
http://localhost:8080/o/rest-test/blade.users/list/
Hint:
I personally use a DHC REST Client Browser Extention for debugging my REST API.
@Kevin Matthews:
I also analysed your bladeRest.zip file and probably found the reason why our REST example is not working:
You're using @Path("/blade.users") instead of @ApplicationPath("/blade.users") as the class annotation. That's fixed in the newer Version of the blade example project
Have a look an the latest version of UserRestService and edit the class header with:@ApplicationPath("/blade.users") @Component( immediate = true, property = {"jaxrs.application=true"}, service = Application.class ) public class UsersRestService extends Application {...}
Give in another try then
Nagendra Kumar Busam, modificado 5 Anos atrás.
RE: Liferay 7.0 JAX-RS - no services available
Liferay Master Postagens: 678 Data de Entrada: 07/07/09 Postagens RecentesI am trying to test the same on LR 7.1 GA2 CE, configured exactly as mentioned by A.Rock. I am getting below error message in console
2018-12-27 17:32:23.566 WARN [http-nio-8080-exec-6][ServletController:88] Can't find the request for http://localhost:8080/o/rest-test/users/list's Observer
Please let me know If anybody able to test it recently, any pointers much helpful
Avinash Kashid, modificado 5 Anos atrás.
RE: Liferay 7.0 JAX-RS - no services available
New Member Postagens: 5 Data de Entrada: 22/09/14 Postagens Recentes
<p>Please let me know If anybody able to test it recently, any pointers
much helpful</p>
I am facing same issue.
@Nagendra Kumar Busam have you found any solution?