This is a migrated thread and some comments may be shown as answers.

en-US-Custom.txt access error in Web Farm

2 Answers 154 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Eric asked on 26 Apr 2010, 11:04 AM
Hi,

I have a web farm with 3 servers. I am using RadEditor with Ajax spellchecker enabled on it in a web page.

I sometimes get the below report from the production servers:

Exception Message:

Access to the path 'C:\PayrollPortalWWW\PayrollIssueWeb\App_Data\RadSpell\en-US-Custom.txt' is denied.

Source:

mscorlib

Target Site:

WinIOError

Call Stack:

at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.IO.StreamWriter.CreateFile(String path, Boolean append) at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize) at System.IO.StreamWriter..ctor(String path, Boolean append) at Telerik.Web.UI.Dictionaries.FileCustomDictionarySource.AddWord(String word) at Telerik.Web.UI.SpellChecker.AddToCustom(String word) at Telerik.Web.UI.SpellCheckHandler.ProcessAddWordRequest(HttpResponse response, SpellChecker checker, String word) at Telerik.Web.UI.SpellCheckHandler.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)


When I click the Add to dictionary option in Spellchecker for a misspelled word, sometimes the word is added to the dictionary and I can see the word in the text file but sometimes the control just doesn't do anything and Misspelled word menu stays open. What could be the problem?

Thank you...

2 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 27 Apr 2010, 04:08 PM
Hi Eric,

The problem could be due to insufficient permissions for the en-US-Custom.txt file. Can you please check whether the ASPNET / NETWORK SERVICE account has read / write permission?

If it has then try the following two suggestions:

You can change the default dictionary location and move them out of your application folder. For example:

<telerik:RadEditor ID="RadEditor1" runat="Server"> 
<SpellCheckSettings DictionaryPath="/common/RadSpell/" /> 
...  

In this case, the /common/RadSpell/ folder can be mapped to a different directory outside of your main web application. As long as the path in DictionaryPath can be mapped to a physical location, the spell check will work.

Another approach is to implement your own custom dictionary provider. Here is what you need to do:

1) create a class that implements the ICustomDictionarySource interface. Here is an example:
public class myType : Telerik.Web.UI.Dictionaries.ICustomDictionarySource 

    #region ICustomDictionarySource Members 
    string _dictionaryPath; 
    public string DictionaryPath 
    { 
        get 
        { 
            return _dictionaryPath; 
        } 
        set 
        { 
            _dictionaryPath = value; 
        } 
    } 
 
    string _language; 
    public string Language 
    { 
        get 
        { 
            return _language; 
        } 
        set 
        { 
            _language = value; 
        } 
    } 
 
    string _customAppendix; 
    public string CustomAppendix 
    { 
        get 
        { 
            return _customAppendix; 
        } 
        set 
        { 
            _customAppendix = value; 
        } 
    } 
 
    public string ReadWord() 
    { 
        //return a string containing a word from the custom dictionary 
        //return null when there are no more words in the custom dictionary 
        return null; 
    } 
 
    public void AddWord(string word) 
    { 
        //implement custom code to add the word in your custom dictionary 
    } 

    #endregion 

The ReadWord function is called from the spell code as many times as you return a string. When you return null, the spell assumes there are no more words in the custom dictionary.

The AddWord function is called if the user chooses to add a new word to the custom dictionary.


2) set the CustomDictionarySourceTypeName in the SpellCheckSettings to the full type name of your custom provider. For example CustomDictionarySourceTypeName="myType, App_Code"


Regards,
Rumen
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Eric
Top achievements
Rank 1
answered on 28 Apr 2010, 12:57 PM
Hi Rumen,

Thank you for your reply.

I already set the Spell Check Settings using the below code.

txtComments.SpellCheckSettings.DictionaryPath = GlobalParams.DictionaryLocation

If I set DictionaryLocation as a network location "\\XXX\YYY\RadSpell" it doesn't work but if I set DictionaryLocation as "~\App_Data\RadSpell" or "C:\XXX\YYY\RadSpell" it works.

I am using impersonation with identity impersonate and I can Create/Read files from "\\XXX\YYY\Uploads" directory from the same application. So I don't think that's an access problem because the account I use for impersonation has all the read&write permissions for both of the directories and files under them ("\\XXX\YYY\RadSpell" and "\\XXX\YYY\Uploads").

I don't plan to use custom dictionary provider for now so I'll first try to solve the problem with DictionaryPath.

Thank you...



Tags
Editor
Asked by
Eric
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Eric
Top achievements
Rank 1
Share this question
or