OSGI unsatisfied referenceOSGI unsatisfied referencehttps://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=1148361192024-03-29T13:09:42Z2024-03-29T13:09:42ZRE: OSGI unsatisfied referenceYan Painghttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1148457202019-08-22T16:13:31Z2019-08-22T16:13:31ZThank you so much David, <br /> Firstly i tried to put @Component in GuestbookFinderImpl but it is also fail. Finally i changed following without using @Reference and it is working.<br /><br />From GuestbookFinderImpl class<br />---------------------------------------------------<br />String sql = CustomSQLUtil.get(<br />// String sql = _customSQL.get(<br /> getClass(),<br /> FIND_BY_ENTRYNAME_ENTRYMESSAGE_GUESTBOOKNAME);<br />// @Reference<br />// private CustomSQL _customSQL;<br /><br />From build.gradle<br />-------------------------------<br />compileOnly group: 'com.liferay', name: 'com.liferay.portal.dao.orm.custom.sql', version: '1.0.22'<br />runtime group: 'com.liferay', name: 'com.liferay.portal.dao.orm.custom.sql', version: '1.0.22'<br /><br />from bnd.bnd<br />-------------------------------<br />Import-Package: \ *<br />-includeresource: \ @com.liferay.portal.dao.orm.custom.sql-1.0.22.jar<br /><br />from service.xml--------------------------dependency-injector use with spring. Earlier with ds. <service-builder dependency-injector="spring" package-path="com.liferay.docs.guestbook" mvcc-enabled="true">Yan Paing2019-08-22T16:13:31ZRE: OSGI unsatisfied referenceDavid H Nebingerhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1148426072019-08-22T14:04:49Z2019-08-22T14:04:49ZYou cannot @Reference a class that is not itself an @Component.<br /><br />Your GuestbookFinderImpl is not an @Component, so OSGi has nothing to inject.David H Nebinger2019-08-22T14:04:49ZRE: OSGI unsatisfied referenceYan Painghttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1148402922019-08-22T06:47:40Z2019-08-22T06:47:40ZHi David,<br />Please see the attached for all source code.<br /><br />Yes, correct and agree that GuestbookLocalServiceImpl has an @Reference dependency on a GuestbookFinder and can't find.<br /><br />guestbookFinder.findByEntryNameEntryMessageGuestbookName(entryName, entryMessage,guestbookName, begin, end); is calling within GuestbookEntryLocalServiceImpl .<br /><br />Please suggest how should i fix it. I am using liferay 7.2 GA1. I also attached web portlet as well. Thank youYan Paing2019-08-22T06:47:40ZRE: OSGI unsatisfied referenceDavid H Nebingerhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1148392632019-08-22T03:16:49Z2019-08-22T03:16:49ZSo this line:<br /><br />guestbookFinder: com.liferay.docs.guestbook.service.persistence.GuestbookFinder UNSATISFIED 1..1 static target=(*) scope=bundle<br /><br /><br />This tells you that your GuestbookLocalServiceImpl has an @Reference dependency on a GuestbookFinder, but it is not finding one.<br /><br />So this points to your GuestbookFinder not starting and/or not registering. Do you have this corresponding info on the GuestbookFinder? Can you share some or all of your GuestbookFinder class?David H Nebinger2019-08-22T03:16:49ZRE: OSGI unsatisfied referenceYan Painghttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1148381052019-08-22T01:14:30Z2019-08-22T01:14:30ZHi Everyone,Any suggestion? Thank youYan Paing2019-08-22T01:14:30ZOSGI unsatisfied referenceYan Painghttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1148361182019-08-21T15:44:13Z2019-08-21T15:44:13ZHi All,I tried to do custom finder method according to <a href="https://portal.liferay.dev/docs/7-2/appdev/-/knowledge_base/a/defining-a-custom-finder-method">https://portal.liferay.dev/docs/7-2/appdev/-/knowledge_base/a/defining-a-custom-finder-method</a> . After that there is OSGI unsatisfied reference error is coming as per following. Any one please suggest how should i solve for the issue. I am using liferay 7.2 GA1. Thank you<br /><br />Component Description: com.liferay.docs.guestbook.service.impl.GuestbookLocalServiceImpl<br />========================================================================================<br />Class: com.liferay.docs.guestbook.service.impl.GuestbookLocalServiceImpl<br />Bundle: 120 (com.liferay.docs.guestbook.service:1.0.0)<br />Enabled: true<br />Immediate: false<br />Services: [com.liferay.portal.aop.AopService]<br />Scope: singleton<br />Config PID(s): [com.liferay.docs.guestbook.service.impl.GuestbookLocalServiceImpl], Policy: optional<br />Base Props: (1 entry)<br /> model.class.name<String> = com.liferay.docs.guestbook.model.GuestbookComponent Configuration Id: 5043<br />--------------------------------<br />State: UNSATISFIED REFERENCE<br />Config Props: (3 entries)<br /> component.id<Long> = 5043<br /> component.name<String> = com.liferay.docs.guestbook.service.impl.GuestbookLocalServiceImpl<br /> model.class.name<String> = com.liferay.docs.guestbook.model.Guestbook<br />References: (total 7)<br /> - guestbookFinder: com.liferay.docs.guestbook.service.persistence.GuestbookFinder UNSATISFIED 1..1 static<br /> target=(*) scope=bundle<br /> - classNameLocalService: com.liferay.portal.kernel.service.ClassNameLocalService SATISFIED 1..1 static<br /> target=(*) scope=bundle (no active bindings)<br /> - counterLocalService: com.liferay.counter.kernel.service.CounterLocalService SATISFIED 1..1 static<br /> target=(*) scope=bundle (no active bindings)<br /> - guestbookEntryPersistence: com.liferay.docs.guestbook.service.persistence.GuestbookEntryPersistence SATISFIED 1..1 s<br />tatic<br /> target=(*) scope=bundle (no active bindings)<br /> - guestbookPersistence: com.liferay.docs.guestbook.service.persistence.GuestbookPersistence SATISFIED 1..1 static<br /> target=(*) scope=bundle (no active bindings)<br /> - resourceLocal