RE: Liferay 7 portlet can't deploy due to OSGI reference not found

thumbnail
Yan Paing, modified 6 Years ago. Regular Member Posts: 130 Join Date: 3/11/10 Recent Posts
Hi All,
My portlet class can't put following OSGI reference in MVC class. If i put @reference for calling local service then the portlet is gone and can't able to see from the admin screen. Following is the information that i did. Please suggest. Thank you    
====================================================

MVC class 

public class InstituteSetupPortlet extends MVCPortlet {
..........@Reference(unbind = "-")
    protected void setInstituteService(InstituteLocalService instituteLocalService) {
        _instituteLocalService = instituteLocalService;
    }
    private InstituteLocalService _instituteLocalService;
==================================================    
in build.gradle i declare dependencies as per following as well  
   compileOnly group: "org.osgi", name: "osgi.cmpn"
    compileOnly project(":modules:SB-Institute:SB-Institute-api")
    compileOnly project(":modules:SB-Institute:SB-Institute-service")

Attachments:

thumbnail
Olaf Kock, modified 6 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts
Yan Paing:

My portlet class can't put following OSGI reference in MVC class. If i put @reference for calling local service then the portlet is gone and can't able to see from the admin screen. Following is the information that i did. Please suggest. Thank you   
Check the reasons for your plugin's non-deployment with Gogo Shell. Here's a good starting point.
Odds are that you correctly declared the compile-time dependencies, but haven't deployed your InstituteLocalService bundles (API as well as service) to the runtime server, so that they're there for compilation, but can't be resolved at runtime.
thumbnail
Yan Paing, modified 6 Years ago. Regular Member Posts: 130 Join Date: 3/11/10 Recent Posts
Thank you for reply.  After following your suggesting  "Here's a good starting point " ,i can see the error which cause porlet undeploy. Thank you

2019-05-27 13:11:10.686 WARN  [main][SystemCheckOSGiCommands:134] Spring Extender Unavailable Component Checker check result: _Bundle {id: 2022, name: com.futurestars.datastore.institute.service, version: 1.0.0}._    Component with ID 41 is unavailable due to missing required dependencies:_        ServiceDependency[interface com.liferay.portal.kernel.model.Release (&(release.bundle.symbolic.name=com.futurestars.datastore.institute.service)(&(release.schema.version>=1.0.0)(!(release.schema.version>=1.1.0)))(|(!(release.state=*))(release.state=0)))]_Bundle {id: 2022, name: com.futurestars.datastore.institute.service, version: 1.0.0}._    Component with ID 84 is unavailable due to missing required dependencies:_        ServiceDependency[interface com.liferay.portal.kernel.model.Release (&(release.bundle.symbolic.name=com.futurestars.datastore.institute.service)(&(release.schema.version>=1.0.0)(!(release.schema.version>=1.1.0)))(|(!(release.state=*))(release.state=0)))]_        ServiceDependency[interface com.liferay.portal.kernel.configuration.Configuration (&(configuration.bundle.symbolic.name=com.futurestars.datastore.institute.service)(name=service))] [Sanitized]