Fórumok

Nyitólap » Liferay Portal » English » 3. Development

Kombinált nézet Egyszerű nézet Fa-nézet
Szálak [ Előző | Következő ]
toggle
alex wom
Is there a template to build a service portlet without database?
2012. február 1. 21:50
Válasz

alex wom

Rangsorolás: Regular Member

Hozzászólások: 154

Csatlakozás dátuma: 2009. május 4.

Legújabb hozzászólások

I would like to build a service portlet to integrate external REST services.
Jan Gregor
RE: Is there a template to build a service portlet without database?
2012. február 2. 7:24
Válasz

Jan Gregor

Rangsorolás: Regular Member

Hozzászólások: 224

Csatlakozás dátuma: 2010. október 20.

Legújabb hozzászólások

Hi Alex,

I don't know what you mean exactly by building a service. Are you using service builder ? If yes, the only thing, which you need to do is define no entities in your service.xml. After generating your service classes no model will be created, but all service classes will be generated.

Regards,
Jan.
alex wom
RE: Is there a template to build a service portlet without database?
2012. február 2. 8:56
Válasz

alex wom

Rangsorolás: Regular Member

Hozzászólások: 154

Csatlakozás dátuma: 2009. május 4.

Legújabb hozzászólások

I tried to use an empty service.xml:
<?xml version="1.0"?>
<service-builder package-path="it.etc.portlet.restServices">

</service-builder>

but service builder generates a null pointer exception: there's probably something required to be included in service.xml.
alex wom
RE: Is there a template to build a service portlet without database?
2012. február 2. 9:01
Válasz

alex wom

Rangsorolás: Regular Member

Hozzászólások: 154

Csatlakozás dátuma: 2009. május 4.

Legújabb hozzászólások

I reply to myself: but the solution may be to create an empty entity... Now I try to go ahead.
Jan Gregor
RE: Is there a template to build a service portlet without database?
2012. február 3. 6:58
Válasz

Jan Gregor

Rangsorolás: Regular Member

Hozzászólások: 224

Csatlakozás dátuma: 2010. október 20.

Legújabb hozzászólások

Hi Alex,

Sorry, you are right. Basically entity without any fields.

Regards,
Jan.
alex wom
RE: Is there a template to build a service portlet without database?
2012. február 6. 9:14
Válasz

alex wom

Rangsorolás: Regular Member

Hozzászólások: 154

Csatlakozás dátuma: 2009. május 4.

Legújabb hozzászólások

Hi I tried with Liferay 6.0.6 and it doesn't work, when I call the service it says:
17:10:20,412 ERROR [jsp:154] com.liferay.portal.kernel.bean.BeanLocatorException: BeanLocator has not been set
at com.liferay.portal.kernel.bean.PortletBeanLocatorUtil.locate(PortletBeanLocatorUtil.java:40)
at it.etc.portlet.contentAnnotation.service.ContentAnnotationLocalServiceUtil.getService(ContentAnnotationLocalServiceUtil.java:51)
at it.etc.portlet.contentAnnotation.service.ContentAnnotationLocalServiceUtil.getArticleSuggestedAnnotations(ContentAnnotationLocalServiceUtil.java:41)
at it.etc.portlet.contentAnnotation.controller.AnnotationController.doView(AnnotationController.java:26)
at com.liferay.portal.kernel.portlet.LiferayPortlet.doDispatch(LiferayPortlet.java:206)
at com.liferay.util.bridges.mvc.MVCPortlet.doDispatch(MVCPortlet.java:294)
at javax.portlet.GenericPortlet.render(GenericPortlet.java:233)
at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:101)
at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:64)
at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:92)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:551)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:488)
at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:638)
at com.liferay.portlet.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:723)
at com.liferay.portlet.InvokerPortletImpl.render(InvokerPortletImpl.java:425)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
David H Nebinger
RE: Is there a template to build a service portlet without database?
2012. február 6. 10:12
Válasz

David H Nebinger

Rangsorolás: Liferay Legend

Hozzászólások: 4550

Csatlakozás dátuma: 2006. szeptember 1.

Legújabb hozzászólások

The BeanLocator not set is a known issue w/ 6.0.6 that is supposed to be resolved w/ 6.1.

In the mean time if you search the forums for the BeanLocator has not been set message you'll find a couple of workarounds that may work for you.
alex wom
RE: Is there a template to build a service portlet without database?
2012. február 7. 4:09
Válasz

alex wom

Rangsorolás: Regular Member

Hozzászólások: 154

Csatlakozás dátuma: 2009. május 4.

Legújabb hozzászólások

I tried the work arounds, but I have not solved. I have also portal-impl (as expected in LPS-13 073) patched but in any case does not work. I have a portlet created with the service builder, with an empty service.xml. I modified and regenerated service.impl services and I have that error
David H Nebinger
RE: Is there a template to build a service portlet without database?
2012. március 19. 17:08
Válasz

David H Nebinger

Rangsorolás: Liferay Legend

Hozzászólások: 4550

Csatlakozás dátuma: 2006. szeptember 1.

Legújabb hozzászólások

I got the bean locator error during startup if I was trying to access the BlahLocalServiceUtil before the portlet hosting the Blah service had started up and initialized. Adding a Required Deployment Context entry in liferay-plugin-package.properties helped with that.

Does the bean locator error happen every time or just during startup?

Also you'll get the bean locator error if the portlet hosting the service fails to load, but that's an indicator that your service portlet is having problems...