Skip to Content
author's profile photo Former Member
Former Member

Autowiring not working in Hybris migration from 4.7 to 5.7

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 .

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 15, 2015 at 03:43 PM
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 18, 2015 at 08:14 AM

    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"

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.