Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: WEB Services JAX-RS
I have folleowed the instructions for deploying a simple web service to Liferay portal:
https://dev.liferay.com/de/develop/tutorials/-/knowledge_base/7-1/jax-rs
As written there, I have created an OSGi Module using an Maven REST Archetype.
I have depooyed it to Liferay Community Edition Portal 7.1.2 CE GA3.
I am ablo to obtain the access_token from Liefray, but when I want to call the service with curl (on a localhost - exactly like in the tutorial), than there is no response (see attacheed iamge).
https://dev.liferay.com/de/develop/tutorials/-/knowledge_base/7-1/jax-rs
As written there, I have created an OSGi Module using an Maven REST Archetype.
I have depooyed it to Liferay Community Edition Portal 7.1.2 CE GA3.
I am ablo to obtain the access_token from Liefray, but when I want to call the service with curl (on a localhost - exactly like in the tutorial), than there is no response (see attacheed iamge).
Attachments:
Follow this link which shows step by step implementation of JAX-RS
https://www.youtube.com/watch?v=0F2onRk4WYA
https://www.youtube.com/watch?v=0F2onRk4WYA
When starting on something new, you should start with the easiest scenario and then move to more complex thing.
I would first test your service after disabling authentication.
This can be acheived with following code as the header of your main REST application
I would first test your service after disabling authentication.
This can be acheived with following code as the header of your main REST application
@Component(
property = {
JaxrsWhiteboardConstants.JAX_RS_APPLICATION_BASE + "=/yourpath",
JaxrsWhiteboardConstants.JAX_RS_NAME + "=Your.Application.NAME",
"liferay.auth.verifier=[b]false[/b]",
"liferay.oauth2=[b]false[/b]",
},
service = Application.class
)
public class YourRestApplication extends Application {
...
}
Then try again your curl command.
Helllo, thanks for your support.
I have finally got the example from Liferay Site to work. I have had to add following line to the JAX-RSn Application Class:
"oauth2.scopechecker.type=none"
I have finally got the example from Liferay Site to work. I have had to add following line to the JAX-RSn Application Class:
"oauth2.scopechecker.type=none"
@Component(
property = {
JaxrsWhiteboardConstants.JAX_RS_APPLICATION_BASE + "=/greetings",
JaxrsWhiteboardConstants.JAX_RS_NAME + "=Greetings.Rest",
"oauth2.scopechecker.type=none"
},
service = Application.class
)
public class MyRestApplication extends Application {
...
}
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™