getting java.lang.NoClassDefFoundError: com/liferay/portal/kernel/service/B

Ganesh Puli, modified 5 Years ago. New Member Posts: 19 Join Date: 2/27/18 Recent Posts
when am calling the services of a serviceBuilder from a normal module portlet am getting the below exceptioncom.liferay.portal.kernel.portlet.PortletContainerException: com.liferay.portal.kernel.portlet.PortletContainerException: javax.servlet.ServletException: java.lang.NoClassDefFoundError: com/liferay/portal/kernel/service/BaseLocalService

please suggest me  , in resolving the above exceptionThanks & Regards
thumbnail
David H Nebinger, modified 5 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
You never should be accessing the service classes directly, only the interfaces from the API, and wired into your portlet using @Reference annotations.
Ganesh Puli, modified 5 Years ago. New Member Posts: 19 Join Date: 2/27/18 Recent Posts
Hi David H Nebinger, thanks for your reply
I tried  as you said like below
@Override
    public void doView(RenderRequest renderRequest, RenderResponse renderResponse)
            throws IOException, PortletException {
    try {
        Emp ewmp= EmpLocalServiceUtil.fetchEmp(1);
        System.out.println("details : "+ewmp.getEmpName());
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    
    try {
        //VYPGProviderDetails details= VYPGProviderDetailsLocalServiceUtil.getVYPGProviderDetails(1);
        VYPGProviderDetails details= vypgProviderDetailsService.getVYPGProviderDetails(1);
        System.out.println("details =====>: "+details.getProviderName());
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    
    super.doView(renderRequest, renderResponse);
    }
    
    @Reference(service = com.vy.payment.gateway.service.VYPGProviderDetailsLocalService.class)
    protected com.vy.payment.gateway.service.VYPGProviderDetailsLocalService vypgProviderDetailsService;
    but am getting the below exceptionERROR [http-nio-8080-exec-6][status_jsp:950] com.liferay.portal.kernel.portlet.PortletContainerException: com.liferay.portal.kernel.portlet.PortletContainerException: javax.servlet.ServletException: java.lang.NoClassDefFoundError: com/vy/payment/gateway/service/VYPGProviderDetailsLocalService 
please give me some guidance David
thumbnail
David H Nebinger, modified 5 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
Is the package exported in the bnd.bnd file for the module?
Ganesh Puli, modified 5 Years ago. New Member Posts: 19 Join Date: 2/27/18 Recent Posts
yes devid , thanks for your reply 
package exported in the bnd.bnd file for the modulethis is my bnd.bnd file of service moduleBundle-Name: VyPaymentGateway-api
Bundle-SymbolicName: VyPaymentGateway.api
Bundle-Version: 1.0.0
Export-Package:\
    com.vy.payment.gateway.exception,\
    com.vy.payment.gateway.model,\
    com.vy.payment.gateway.service,\
    com.vy.payment.gateway.service.persistence,\
    com.stripe.*,\
    com.google.*;-split-package:=merge-last;-noimport:=true
-check: EXPORTS    
-includeresource: META-INF/service.xml=../VyPaymentGateway-service/service.xml
Import-Package: *; version="0";resolution:=optional