Getting Exception in JchemBaseSearch using "Jchem .Net API"

User 73ad691ca3

25-10-2012 12:30:37

Dear Support Team,


We are implementing 'Structure search functionality' using 'Jchem .Net API', version: JChem .NET API 5.10.3.437.


We are calling "the Jchem Structure search API methods" in ".Net WCF service" and we are getting the exception "ServiceConfigurationError-No service found for chemaxon.sss.screen.handler.AfterEnumSHCreator".


While we run the Example program('\ChemAxon\JChem .NET API 5.10.3.437\Examples\JChemBaseSearch') its working fine.


Please look into this issue, and let us know how to achieve the structure search functionality in .Net WCF service Using Jchem .Net API.


Please find the attached screen with the exception for your reference.


Please find the sample code, which we used for the Structure search using Jchem .Net API.


 


Thanks and Regards,


D. Senthil kumar vijai.


 


 


 


 

ChemAxon eb65a25631

25-10-2012 12:39:29

Hi,


 


If you want to use JChemBaseSearch in a thread other than the main thread, you have to have the following workaround:


var loader = java.lang.Thread.currentThread().getContextClassLoader();
if (!(loader is ikvm.runtime.AssemblyClassLoader))
{
    var asm = Assembly.GetExecutingAssembly();
    var asmClassLoader = new ikvm.runtime.AssemblyClassLoader(asm);
    java.lang.Thread.currentThread().setContextClassLoader(asmClassLoader);

}


in the current thread right before executing the search.


 


Regards,


Andras

User 73ad691ca3

25-10-2012 13:45:11

Dear Andras,


Thanks for your solution,  JChemBaseSearch is working fine.


We have added your workaround code before calling the search functionality.


We will get back you, if we have any further queries on the JChemBaseSearch....


----------


Thanks & Regards,


D. Senthil kumar vijai.