cancel
Showing results for 
Search instead for 
Did you mean: 

NullPointer exception calling from Controller to Facade?

former_member1354369
Participant
0 Kudos
514

Hello Hybris Experts,

Am getting NullPointer exception when am calling from controller to facade.

Below is the piece of code added in controller class

Integer getMdfAmount=null; final mdfBalanceData getMdfBalData= mdfBalFacade.getAvailBal(getMdfAmount); model.addAttribute("getMdfBalData", getMdfBalData);

Error from console

java.lang.NullPointerException de.hybris.platform.b2bacceleratoraddon.controllers.pages.checkout.steps.PaymentTypeCheckoutStepController.enterStep(PaymentTypeCheckoutStepController.java:96) de.hybris.platform.b2bacceleratoraddon.controllers.pages.checkout.steps.PaymentTypeCheckoutStepController$$FastClassBySpringCGLIB$$8c8f1bcc.invoke(

Appreciate your help!

Thanks in Advance,

BR R venkata karthik

Accepted Solutions (1)

Accepted Solutions (1)

segalerba
Explorer
0 Kudos

mdfBalFacade is probably null, how did you inyect into your controller? It should be declared with that id as a bean and then added with @Resource in your controller to assure this.

It's also a good practice to validate that it's not null before using a resource, to give the server in order to improve resiliency.

Hope it helps!

former_member1354369
Participant
0 Kudos

Hi Guillermo,

Am still confused, in which spring configuration file should my Facade is injected. My controller is PaymentTypeCheckoutStepController which is in package de.hybris.platform.b2bacceleratoraddon.controllers.pages.checkout.steps

How do i search in my ee ide to inject Facade instance to the controller

Appreciate your help.

Thanks in Advance,

BR R venkata karthik

Answers (0)