Posts

Showing posts with the label hybris

[Solved] Solr error while hybris server startup

Scenario Getting  error creating a bean with name 'defaultSolrServerService' , while Hybris server startup? Error creating bean with name 'defaultSolrServerService' defined in class path resource [global-solrserver-spring.xml]: Invocation of init method fa ing Solr start command for instance: [name: default, port: 8983] ... Solr server not yet started for instance: [name: default, port: 8983] [retry: 7, interval: 5000ms] Root cause OOTB (post hybris v5.5) default solr configuration ensures that a standalone Solr server is configured, started and stopped together with the platform. When we use  ctr + c  to stop the Hybris instance it should also stop the solr instance. But sometime solr instance not stopped properly with it and again we try to start the Hybris server, which internally tries to instantiate solr server (which already running) again and that leads to such errors. Troubleshoot steps to solve your issue 1. Stop and start Hybris server aga

How to block certain URLs access for some user type in Hybris?

Scenario: How to block certain URLs access for some user type in Hybris? Solution: In general, we should maintain spring  Authorities/group  for such users so that it can be blocked from  spring-security . But in my case, I don't have that choice. There are already many userType which can be identified when the user logged in and stored it in session. Here I have to use same. So I have decided to use Spring AOP to serve my aspect around the point-cut(custom annotation). In this post, I am not going to cover AOP in detail. If you don't know anything about  Spring AOP . You should first  explore it  first. 1. Create Annotation AllowUsers and BlockUsers package com . hybris . storefront . annotations ; import java . lang . annotation . ElementType ; import java . lang . annotation . Retention ; import java . lang . annotation . RetentionPolicy ; import java . lang . annotation . Target ; @Retention ( RetentionPolicy . RUNTIME ) @Target ( { ElementType . M