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: Liferay 7 portlet can't deploy due to OSGI reference not found
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")
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:
Yan Paing:
Check the reasons for your plugin's non-deployment with Gogo Shell. Here's a good starting point.
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
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.
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]
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]