logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
judy at Web2Market  
#1 Posted : Monday, March 18, 2024 12:02:39 PM(UTC)
judy at Web2Market

Rank: Advanced Member

Groups: Developers
Joined: 11/7/2018(UTC)
Posts: 289

Thanks: 21 times
Was thanked: 5 time(s) in 5 post(s)
I am re-writing one of our plugins so that I am just adding all the files to the solution instead of using a plugin. The plugin was written by another developer years ago and I can't get an upgrade to 909 to pick it up, probably our fault.
I always have trouble figuring out what kind of entries to put into the windsor.config, so I usually use the namespace AbleCommerce.Code on repos I create, but this code has several files and uses a different namespace. What entries would I put into nhibernate.config and windsor.config for this repo, as an example? There are numerous other classes including the ContentSliderSettingRepository.cs and I have made sure that the ContentSliderSetting class is embeded.

namespace W2M.ContentSliderPlugin.Code
{
using System.Collections.Generic;
using CommerceBuilder.DomainModel;

/// <summary>
/// Interface for Location entities
/// </summary>
public interface IContentSliderSettingRepository : IRepository<ContentSliderSetting>
{
ContentSliderSetting LoadForContentSlider(int sliderId);

}
}

I've tried
<component id="ContentSliderSettingRepo" service="W2M.ContentSliderPlugin.Code.IContentSliderSettingRepository, W2M.ContentSliderPlugin" type="W2M.ContentSliderPlugin.Code.ContentSliderSettingRepository, W2M.ContentSliderPlugin"/>
and get the following error:
Could not convert string 'W2M.ContentSliderPlugin.Code.ContentSliderSettingRepository, W2M.ContentSliderPlugin' to a type. Assembly was not found. Make sure it was deployed and the name was not mistyped.

I have added the following to nhibernate.config
<mapping assembly="W2M.ContentSliderPlugin"/>

Thanks

Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

shaharyar  
#2 Posted : Tuesday, March 19, 2024 2:57:23 AM(UTC)
shaharyar

Rank: Advanced Member

Groups: Admin, Developers, Registered, HelpDesk, Authorized User
Joined: 10/5/2018(UTC)
Posts: 703

Thanks: 5 times
Was thanked: 113 time(s) in 112 post(s)
Quote:
I am re-writing one of our plugins so that I am just adding all the files to the solution instead of using a plugin.


Are you creating a separate class library or adding the files in one of the existing projects. If you are creating files in one of the existing projects, then there is no need to add anything in nhibernate.config and to register the repositories, instead of using windsor.config, there is a RegisterForAttribute that you add at top of the ContentSliderSettingRepository.cs class.

If creating classes in Ablecommerce project, then add <mapping assembly="AbleCommerce"/> in nhibernate.config

e.g

Code:
[RegisterFor(typeof(IContentSliderSettingRepository))]
[RegisterFor(typeof(IRepository<ContentSliderSetting>))]


You might get some help from this old forum post.
https://www.ablecommerce...rsister-for-custom-table

Hope this helps.


judy at Web2Market  
#3 Posted : Tuesday, March 19, 2024 8:09:34 AM(UTC)
judy at Web2Market

Rank: Advanced Member

Groups: Developers
Joined: 11/7/2018(UTC)
Posts: 289

Thanks: 21 times
Was thanked: 5 time(s) in 5 post(s)
Thanks for the answer. The files are included in the AbleCommerce project, but they don't use the AbleCommerce namespace right now. That is the issue- trying to figure out what to put in the nhibernate.config and windsor.config.
I'll just give up and change them all to AbleCommerce namespace
judy at Web2Market  
#4 Posted : Thursday, March 21, 2024 7:35:22 AM(UTC)
judy at Web2Market

Rank: Advanced Member

Groups: Developers
Joined: 11/7/2018(UTC)
Posts: 289

Thanks: 21 times
Was thanked: 5 time(s) in 5 post(s)
I've tried something new to troubleshoot this. I know it is not AC code, but am asking for some resources to troubleshoot. I've googled, but must be using the wrong search terms and I don't know if it is an nhibernate, windsor or database issue.
I was able to install the plugin in question on a different 909 site OK, but when I try to access it on the dev site for the site I am upgrading, I still get unable to locate a persister error.
The files on the dev site are the same as the live site- I have copied them over from the plugins folder, including the zip, the plugin folder itself and the installedplugins.xml entry. I made a new backup of the live site and restored as dev database and changed the dev site to use that. This all didn't work.
I took another custom entity from another 909 site, added the table to the dev site database, copied the class, hbm.xml, IRepository,Repository files over. Set the .hbm.xml file to embed. Add the same entries in the nhibernate.config and windsor.config files as were in the site where it worked. Compiled the site solution, restarted the app pool. I get the same persister error.
Is there a way I can debug this that I haven't thought of?
I am hesitant to assume that the plugin will still work after the upgrade until I can figure out the issue.
Thanks for any help.
judy at Web2Market  
#5 Posted : Thursday, March 21, 2024 8:53:38 AM(UTC)
judy at Web2Market

Rank: Advanced Member

Groups: Developers
Joined: 11/7/2018(UTC)
Posts: 289

Thanks: 21 times
Was thanked: 5 time(s) in 5 post(s)
Here's what I get when I debug to step through code.
2024-03-21_9-26-05.png (8kb) downloaded 5 time(s).
shaharyar  
#6 Posted : Monday, March 25, 2024 1:03:31 AM(UTC)
shaharyar

Rank: Advanced Member

Groups: Admin, Developers, Registered, HelpDesk, Authorized User
Joined: 10/5/2018(UTC)
Posts: 703

Thanks: 5 times
Was thanked: 113 time(s) in 112 post(s)
The error message seems related to the nHibernate mapping. Please make sure that the hbm.xml files are copied correctly from live to dev site.

judy at Web2Market  
#7 Posted : Monday, March 25, 2024 8:06:58 AM(UTC)
judy at Web2Market

Rank: Advanced Member

Groups: Developers
Joined: 11/7/2018(UTC)
Posts: 289

Thanks: 21 times
Was thanked: 5 time(s) in 5 post(s)
Thanks, they are all there. Any more ideas?
judy at Web2Market  
#8 Posted : Monday, March 25, 2024 12:09:40 PM(UTC)
judy at Web2Market

Rank: Advanced Member

Groups: Developers
Joined: 11/7/2018(UTC)
Posts: 289

Thanks: 21 times
Was thanked: 5 time(s) in 5 post(s)
I found the issue! It was a mapping file for a sql table that had been removed as we upgrade.Not related to the plugin at all.
Users browsing this topic
Guest (2)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.