Corticon .Net Server 5.5.2

Posted by A_Haddad on 06-Jul-2016 10:20

Hello,

Corticon used version : 5.5.2

I am trying to call a decision service using the  in-process server approach in a C# application.

When executing the service I have following exception:

2016-07-06 16:22:51.120 DEBUG  [pool-1-thread-1] d.c.1.0 com.corticon.reactor.engine.DataManagerForObj - Ignoring object of typecli.Tupperware.Gina.SFPromotion.Promotion0.Animatrice
2016-07-06 16:22:51.781 ERROR  [pool-1-thread-1] d.c.1.0  -  cli.System.IO.FileNotFoundException: Impossible de charger le fichier ou l'assembly 'SFPromotion0, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' ou une de ses déndances. Le fichier sécifié est introuvable.
==> For French language lovers :)  "cannot load file or assembly 'SFPromotion0, Version=0.0.0.0... The specified file was not found"

So it seems that there is a problem for the instantiated iCcServer to load the SFPromotion0.dll file?

But the called .eds file embeds the Assembly.DLL obtained by "compile assembly.bat" batch utility.

And I tried to copy the assembly file "SFPromotion0.dll" in many folders thet are in the path of the application (for example under \bin or \work and even in rule-assets folder)...


What am I missing?

Any help, please!


Thx.

Posted by A_Haddad on 08-Jul-2016 04:23

Finally, the context seems to be a fundamental security feature in .Net framework. No way to force it. And the observed ClassCastException is not related to Java-C# interoperability.

So the solution I see now is using XML payloads for decision services.

All Replies

Posted by Jan Krishnamurthy on 06-Jul-2016 22:09

It looks like the error is occurring because the Business Object .dll is dependent on other .dll's that are not in the /bin directory.

I will need the Business Object jar, Business Object  .dll ,  all its dependencies and the .eds with the assembly .dll to look into the problem further.

Were the .dll's compiled using .NET Framework 4.5 ?

- Jan

Posted by Jan Krishnamurthy on 06-Jul-2016 22:12

Try to add the dependencies to the References section in the Visual Studio solution

Posted by A_Haddad on 07-Jul-2016 02:04

Hi Jan,

You have guessed it : the .dll have to be loaded by the .net project containing the main entry program of the application. In may case, it is the Asp.Net project.

I think this point is not clearly explained in the documentation (Cf. Deploying Web Services with .NET pdf file), from which one can understand that it is enough to copy the .dll in thg bin folder of the Corticon server. And then, this dll will be loaded when the Corticon server is initalized...

And that's the point for me: this dll is dynamically generated in run-time: it is not referenced in the Asp.Net project during design-time. The reason is that we want to generate dynamically classes from the vocabulary itself without having to build the whole application every time there is a new rule-flow (there can be a big number of rule-flows in our case).

I will try to load the generated dll dynamically in the controller and see if it works...

Another point taht is not clear for me: is it possible to use a business-objects payload with a Corticon Server installed on IIS webServer?

The documentation gives an example where the .eds embedding the Assembly.dll have to be copied in the axis\rule-assets folder, but I could not find C# (or Java) samples showing how it can be used in this case??

Thank you very much for your help!

Posted by A_Haddad on 07-Jul-2016 04:24

So,

I forced loading the .dll containing business classes just before executing business service.

I did that in the C# project embedding Corticon Server DLLs (so it was not necessary to do it in the asp.net client project and that's better). I used standard C# instruction Assembly.LoadFrom() method.

The good news is that the previous error message disappeared.

The bad news: there is a new one (from Corticon logs):

2016-07-07 11:01:16.927 ERROR  [pool-1-thread-1] d.c.1.0  -  java.lang.ClassCastException:

[ A ] Customer.Application.SFPromotion.Promotion0.Animatrice cannot be converted to

[ B ] Customer.Application.SFPromotion.Promotion0.Animatrice.

Type A comes from 'SFPromotion0, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' in the context 'LoadNeither' from folder 'C:/fra2ntas07/DefaultCollection/Gina/POCS/CompetitionInlineConsole/BRMSResources\bin\SFPromotion0.dll'.

Type B comes from 'SFPromotion0, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' in the context 'LoadFrom'    from folder 'C:\fra2ntas07\DefaultCollection\Gina\POCS\CompetitionInlineConsole\BRMSResources\bin\SFPromotion0.dll'.

So the only difference I can see is about dll's "context"... But for the moment, I don't see any way to force the same context?

Posted by A_Haddad on 08-Jul-2016 04:23

Finally, the context seems to be a fundamental security feature in .Net framework. No way to force it. And the observed ClassCastException is not related to Java-C# interoperability.

So the solution I see now is using XML payloads for decision services.

This thread is closed