Foren

Home » Liferay Portal » English » 3. Development

Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Malek Tarboush
Access custom service from any portlet !?
19. Oktober 2010 09:14
Antwort

Malek Tarboush

Rang: Junior Member

Nachrichten: 30

Eintrittsdatum: 19. September 2010

Neue Beiträge

Hello

I have two vaadin portlets using the same custom service
one of this portlet has the source of my custom service
and it works fine

I want to use the same service from the second portlet
so i can use my custom service from any portlet
but the problem is when I'm trying to use my custom service in
the second portlet it throws exception BeanLocator has not been set
1
2ERROR [jsp:154] com.liferay.portal.kernel.bean.BeanLocatorException: BeanLocator has not been set


so is there any way to access my custom service from any new portlet?

thankx
Jelmer Kuperus
RE: Access custom service from any portlet !?
19. Oktober 2010 15:37
Antwort

Jelmer Kuperus

Rang: Liferay Legend

Nachrichten: 1187

Eintrittsdatum: 10. März 2010

Neue Beiträge

This may help you

http://www.liferay.com/community/forums/-/message_boards/message/5968217
Balu Sasidharan
RE: Access custom service from any portlet !?
20. Oktober 2010 00:50
Antwort

Balu Sasidharan

Rang: New Member

Nachrichten: 8

Eintrittsdatum: 18. August 2010

Neue Beiträge

Hi Jelmer,

I have the following problems

1.I have one portlet ,I added 5 tables to the existing database schema. In my portlet I'm using Hibernate to access the database.How can I make use of the liferay database classes for database operations?

2.When I generated the classes using eclipse for the liferay db schema,it does not contain the relationships ie Usually the User object need to have a getOrganization method but it is not there in the hibernate generated classes. In the liferay db classes we can see getOrganization ,getRole etc.. methods.

NB:Earlier I had another database ,Now I moved those tables into the liferay db And I want o get the User db Object

3. How can I get the User attributes from my portlet session?

I'm very much troubled with these problems?
Malek Tarboush
RE: Access custom service from any portlet !?
20. Oktober 2010 01:47
Antwort

Malek Tarboush

Rang: Junior Member

Nachrichten: 30

Eintrittsdatum: 19. September 2010

Neue Beiträge

thank you jelmer
but none of these methods worked for me

i read
http://www.liferay.com/community/wiki/-/wiki/Main/Using+Class+Loader+Proxy+classes+to+share+plugins+services

http://www.liferay.com/community/forums/-/message_boards/message/5968217

its all the same but also no one talk about the exception it throws
in my case
1ERROR [jsp:154] com.liferay.portal.kernel.bean.BeanLocatorException: BeanLocator has not been set
2at com.liferay.portal.kernel.bean.PortletBeanLocatorUtil.locate(PortletBeanLocatorUtil.java:40)


I tried this methods that Peter mentioned about

1. Placing the portlet-service.jar in the app server's global class path and not in the plugin's web-inf/lib
2. Restarting the app server


and this

1. Copying the portlet-service.jar to both plugin's web-inf/lib directories
2. Redeploying both portlets


and the same exception

I also tried to regenerate the same services in the two portlets and deploy it
and also the same exception !!

i don't know where the problem is?
as i can call any liferay portlet service from anywhere
and the portlet-service placed in the server global path
(as i did to my custom-portlet-service.jar)

any other idea will be appreciated