cancel
Showing results for 
Search instead for 
Did you mean: 

In storefront, b2c on logout I am getting "cannot find cmssite associated with current url". The console shows "logout=true"

Former Member
0 Kudos
 

Accepted Solutions (0)

Answers (10)

Answers (10)

Former Member
0 Kudos

Hi Apoorv,

You can choose either of the below mentioned solution to fix this:

  1. Do host entry and use electronics.local:9001 instead of localhost:9001

  2. OR import following impex if you wish to continue with localhost:9001

UPDATE CMSSite;uid[unique=true];urlPatterns[mode=append];

;electronics;(?i)^https?://localhost(:[\d]+)?./electronics/.$;

0 Kudos

Hi Indrajeet,

I too facing the similar problem. I tried with 2 option ie impex approach. After clicking on "sign out" I am able to sign out. Bu the page is in the same location , it is not redirecting to home page which will generally happens. For Eg: If I am in PDP(Product Details Page) page and clicked on "sign out" I am not going to home page of my site instead I am in the PDP page only. Please guide me how to reach to home page.

Thanks, Subbu.

Former Member
0 Kudos

The URL Pattern of the site is localhost:9001/electronicsstorefront?site=electronics

The hybris version is 5.1. (Cannot upgrade to 5.3)

Have made no customization to the code generated by default from storefront.

Former Member
0 Kudos

Hi Apoorv,

I am having the same issue with b2baccelerator, please suggest me if you succeed with the above suggestions.

Former Member
0 Kudos

Hi Apoorv,

Please share the following information to find the root cause of the issue: 1) URL pattern of the website 2) Hybris Version 3) Any customizations - code, configuration in properties files etc.

Thanks IK

Former Member
0 Kudos

Ideally after logout, if the parameters are ?logout=true, then "if(logout)" should be called. But it is not getting called and generating a "HTTP Status 500 - Cannot find CMSSite associated with current URL"

Former Member
0 Kudos

The homepage controller is not getting called when I navigate to some other page and give logout. And hence, it throws error.

@

RequestMapping("/") public class HomePageController extends AbstractPageController { @RequestMapping(method = RequestMethod.GET) public String home(@RequestParam(value = "logout", defaultValue = "false") final boolean logout, final Model model, final RedirectAttributes redirectModel) throws CMSItemNotFoundException { if (logout) {

      GlobalMessages.addFlashMessage(redirectModel, GlobalMessages.INFO_MESSAGES_HOLDER, "account.confirmation.signout.title");
      return REDIRECT_PREFIX + ROOT;
  }

  storeCmsPageInModel(model, getContentPageForLabelOrId(null));
  setUpMetaDataForContentPage(model, getContentPageForLabelOrId(null));
  updatePageTitle(model, getContentPageForLabelOrId(null));

  return getViewForPage(model);

}

Former Member
0 Kudos

Also, when I logout after navigating from homepage and logout i not working, the url after logout is https://localhost:9002/yacceleratorstorefront/electronics/en/?logout=true --and throws "HTTP Status 500 - Cannot find CMSSite associated with current URL"

But when I logout immediately after login and the logout is working, the url after logout is http://localhost:9001/yacceleratorstorefront/electronics/en/?site=electronics

Former Member
0 Kudos

Hi Luke! The issue is that if I login and logout immediately from the homepage, then it works fine. But if I navigate to any other page and then logout, I get the error as "HTTP Status 500 - Cannot find CMSSite associated with current URL"

Also, the above solution is also not working for me.

Is it a bug in the b2c accelerator store front as I have not modified anything and still it is not working?

Former Member
0 Kudos

You can change the spring-security*.xml file so modify the logout redirect url so that it points to home page of b2c storefront, i.e. "/yacceleratorstorefront/?site=apparel-uk"

Former Member
0 Kudos

Yes, It redirects to home page but problem is that session is not getting null

former_member387866
Active Contributor
0 Kudos

Hi Apoorv,

I seen your Answer on the other Logout Page Error question, where you cannot modify the hosts file.

Have you tried adding the websites to your local.properties file?

In my local.properties file I have:

 # B2C ACCELERATOR ELECTRONICS URLs
 website.electronics.http=http://electronics.local:9001/yacceleratorstorefront
 website.electronics.https=https://electronics.local:9002/yacceleratorstorefront
 media.electronics.http=http://electronics.local:9001
 media.electronics.https=https://electronics.local:9002
 
 # B2C ACCELERATOR APPAREL-UK URLs
 website.apparel-uk.http=http://apparel-uk.local:9001/yacceleratorstorefront
 website.apparel-uk.https=https://apparel-uk.local:9002/yacceleratorstorefront
 media.apparel-uk.http=http://apparel-uk.local:9001
 media.apparel-uk.https=https://apparel-uk.local:9002
 
 # B2C ACCELERATOR APPAREL-DE URLs
 website.apparel-de.http=http://apparel-de.local:9001/yacceleratorstorefront
 website.apparel-de.https=https://apparel-de.local:9002/yacceleratorstorefront
 media.apparel-de.http=http://apparel-de.local:9001
 media.apparel-de.https=https://apparel-de.local:9002

And I can access the stores with:

I hope this helps,
Luke

Former Member
0 Kudos

Hi Apoorv,

it seems that URL pattern configured in your website in hmc doesn't resolved the logout URL.

You should check your website URL Pattern.

Thanks IK