cancel
Showing results for 
Search instead for 
Did you mean: 

Autowiring not working in Hybris migration from 4.7 to 5.7

Former Member
0 Kudos

Hello All,

We are working on hybris migration from 4.7 to 5.7 .

We have used Annotation based approach for dependancy injecttion.

Suppose I have class :

@Service(CustomDefaultUIAccessRightService.BEAN_NAME) @Scope(value = "tenant") public class CustomDefaultUIAccessRightService extends DefaultUIAccessRightService {

 @Autowired(required = true)
 @Override
 public void setUserService(final UserService userService)
 {
     super.setUserService(userService);
 }
 
 
 @Autowired(required = true)
 @Override
 public void setCockpitTypeService(final TypeService typeService)
 {
     super.setCockpitTypeService(typeService);
 }

.... . .... .....

}

Auto wiring is working fine for UserService - bean dependency injection . It is also working fine for ModelService , but It is not working fine for CockpitTypeService .

I think we are able to bind beans which are inside platform .but not which are outside platform . ( bocs Hybris has revamped it internal structure .)

Any Suggestion will be appreciated .

Accepted Solutions (0)

Answers (2)

Answers (2)

bikrambsinha
Participant
0 Kudos

Since CockpitService bean is not available within the specific spring context for the platform, please try the following code to get it from global context.

Registry.getApplicationContext().getBean(name) - name will be "cockpitTypeService"

Former Member
0 Kudos

Hi, scope tenant is no longer used since version 5.0.

Please take a look to this link: https://wiki.hybris.com/display/release5/Spring+Framework+in+the+hybris+Commerce+Suite#SpringFramewo...