Plex 2E

Expand all | Collapse all

[PLEX9999] Exception has been thrown by the target of an invocation.

  • 1.  [PLEX9999] Exception has been thrown by the target of an invocation.

    Posted Feb 05, 2016 03:03 AM
    05/02/2016 07:51:47 Type=4 [PLEX0003] Received request to call function Server.GJ1oF_ObFnc. Client=******
    05/02/2016 07:51:47 Type=0 [PLEX9999] Exception has been thrown by the target of an invocation. Client=*********
    05/02/2016 07:51:47 Type=0    at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
       at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
       at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
       at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)
       at ObRun.ObMain.ObFunction.loadFunction(String className, Boolean log, Boolean tryRemote, ObCallMgr obcallmgr) Client=xxxxxxx
    05/02/2016 07:51:47 Type=4 [PLEX0002] Ended client session. Client=******

     

     

    Any ideas. Plex7.0 Build 38.0013. SQL Server.   CA Plex r7.0 .NET Runtime Service

     

    Simple WinC panel test function to call a single fetch (GJ1oF - table has only two fields, no dates, just char)

     

    Originally dispatcher could not find GJ1oF so amended AssemblyList and the fnc is now found but no further.

     

    My guess is a problem of instantiating the found GJ1oF function but any ideas?  Any one had to register plex generated stuff with GAC https://msdn.microsoft.com/en-us/library/dkkx7f79(v=vs.110).aspx



  • 2.  Re:  [PLEX9999] Exception has been thrown by the target of an invocation.

    Posted Feb 05, 2016 03:57 AM

    GJ1oF now is just a server external and still the same error..... so to conclude the problem is winc panel calling a C# function (empty function)

     

    registered with GAC and still have the error...and probably a new problem down the line having the plex dll registered in GAC not being supported by ca plex.....better un-register

     

    Any help appreciated after 10 hours this is a little frustrating.



  • 3.  Re:  [PLEX9999] Exception has been thrown by the target of an invocation.

    Posted Feb 05, 2016 04:03 AM

    George -

    Why do you want to put the dll in the GAC ?

     

    Best

    Lorenz



  • 4.  Re:  [PLEX9999] Exception has been thrown by the target of an invocation.

    Posted Feb 05, 2016 04:12 AM

    it is nothing to do with COM but just hitting and hoping!



  • 5.  Re:  [PLEX9999] Exception has been thrown by the target of an invocation.

    Posted Feb 05, 2016 04:13 AM

    any ideas? anything to check? Why would the dispatcher throw this error message, how do i fix it?



  • 6.  Re:  [PLEX9999] Exception has been thrown by the target of an invocation.

    Posted Feb 05, 2016 04:29 AM

    Unfortunately the inner exception is not logged by Plex. Inner exception should show root cause. Try debugging.



  • 7.  Re:  [PLEX9999] Exception has been thrown by the target of an invocation.

    Posted Feb 05, 2016 04:36 AM

    debugging what? You can debug the Dispatcher in Plex C#  ???

     

    It is not the simple C# function as it has no action diagram and is only ServerExternal.



  • 8.  Re:  [PLEX9999] Exception has been thrown by the target of an invocation.

    Posted Feb 05, 2016 04:46 AM

    Please explain, what you are trying to achieve. Can you run a function that actually has an AD ? I have never seen this error before.

     

    Using Redgate Tools you can debug almost everything, but the tools are not free and setting up a debug environment takes some time.

     

    Best

    Lorenz



  • 9.  Re:  [PLEX9999] Exception has been thrown by the target of an invocation.

    Posted Feb 05, 2016 05:16 AM

    removed the server from the equation.

     

    Same problem if I run it locally.



  • 10.  Re:  [PLEX9999] Exception has been thrown by the target of an invocation.

    Posted Feb 05, 2016 05:49 AM

    Sample model works so I will work backwards and see what is different. Maybe should have started with sample model first.



  • 11.  Re:  [PLEX9999] Exception has been thrown by the target of an invocation.

    Posted Feb 05, 2016 07:51 AM

    worked it out.

     

    Package included a function that calls a stored procedure.

     

    The function was not being called by my simple test but the .net dll as a whole when being instantiated cant work out what to do with the stored procedure call.

     

    Calling a Stored Procedure is fine in WinC generator I guess not at runtime (as it builds with no errors or warnings) for .NET variant.....



  • 12.  Re:  [PLEX9999] Exception has been thrown by the target of an invocation.
    Best Answer

    Posted Feb 05, 2016 03:18 PM

    Finally Solved. That was a real hard one. This is why even trying to call an empty server shell still got the error. The object can not be instantiated with duplicate fields.

     

     

    Fields had been added to the environment variable with the Prefix of * trick. But a mistake in the pattern library design meant two fields of identical imp name and length etc are being placed in the environment variable.

    This did not hurt the C++ at runtime but does C#

     

     

    Capture.PNG

     

     

    Here is the C#

     

            ////////////////////////////////////////////////////////////////

            // Environment Variable

            public ObVariableX initvarGJ2_GJ2_Environment()

            {

                ObVariableX var = new ObVariableX(this, "varGJ2_GJ2_Environment");

     

     

                var.addField("pF0TmFn", new ObIntFld(ObField.ENVIRONMENT, 1, 0, 'p', "pF0TmFn", "", M_ObApp, "")); /* *Terminate */

                var.addField("VBERRTXT", new ObCharFld(ObField.ENVIRONMENT, 78, 'c', "VBERRTXT", false, false, false, "", M_ObApp, false, "")); /* *VBSCRIPT error

                var.addField("VBRET", new ObCharFld(ObField.ENVIRONMENT, 7, 'c', "VBRET", false, false, false, "", M_ObApp, false, "")); /* *VBSCRIPT returned status - FROM LIBRARY A*/

                var.addField("VBRET", new ObCharFld(ObField.ENVIRONMENT, 7, 'c', "VBRET", false, false, false, "", M_ObApp, false, "")); /* *VBSCRIPT returned status - FROM LIBRARY B */

                var.addField("pFACFN", new ObCharFld(ObField.ENVIRONMENT, 128, 'c', "pFACFN", false, true, false, "", M_ObApp, false, "")); /* *CalledFunctionName */

                var.addField("mmapiERD", new ObCharFld(ObField.ENVIRONMENT, 78, 'c', "mmapiERD", false, false, false, "", M_ObApp, false, "")); /* *mmapiErrorDesc */

                var.addField("mmapiRST", new ObCharFld(ObField.ENVIRONMENT, 7, 'c', "mmapiRST", false, false, false, "", M_ObApp, false, "")); /* *mmapiReturnedStatus */

                var.addField("Sqmx1ac", new ObCharFld(ObField.ENVIRONMENT, 1, 'c', "Sqmx1ac", false, false, false, "", M_ObApp, false, "")); /* *Focus set */

                var.addField("Sqmx1bm", new ObCharFld(ObField.ENVIRONMENT, 32, 'c', "Sqmx1bm", false, false, false, "", M_ObApp, false, "")); /* *Database */

                var.addField("Sqmx1bo", new ObCharFld(ObField.ENVIRONMENT, 32, 'c', "Sqmx1bo", false, false, false, "", M_ObApp, false, "")); /* *System */

                var.addField("Sqmx1c9", new ObCharFld(ObField.ENVIRONMENT, 512, 'c', "Sqmx1c9", false, false, false, "", M_ObApp, false, "")); /* *Message */

                var.addField("XM9A", new ObCharFld(ObField.ENVIRONMENT, 78, 'c', "XM9A", false, false, false, "", M_ObApp, false, "")); /* *VBSCRIPT error description */

                var.addField("XM8A", new ObCharFld(ObField.ENVIRONMENT, 7, 'c', "XM8A", false, false, false, "", M_ObApp, false, "")); /* *VBSCRIPT returned status */

                var.addField("Sqmx1e9", new ObCharFld(ObField.ENVIRONMENT, 7, 'c', "Sqmx1e9", false, false, false, "", M_ObApp, false, "")); /* *Validation */

                var.addField("Sqmx1ed", new ObCharFld(ObField.ENVIRONMENT, 256, 'c', "Sqmx1ed", false, true, false, "", M_ObApp, false, "")); /* *Message text */

                var.addField("Sqmx1eq", new ObCharFld(ObField.ENVIRONMENT, 1, 'c', "Sqmx1eq", false, false, false, "", M_ObApp, false, "")); /* *Message delivery */

                var.addField("Sqmx1eu", new ObCharFld(ObField.ENVIRONMENT, 128, 'c', "Sqmx1eu", false, true, false, "", M_ObApp, false, "")); /* *Object */

                var.addField("Sqmx1g5", new ObCharFld(ObField.ENVIRONMENT, 32, 'c', "Sqmx1g5", false, false, false, "", M_ObApp, false, "")); /* *Message ID */

                var.addField("pF0Clo", new ObIntFld(ObField.ENVIRONMENT, 1, 0, 'p', "pF0Clo", "", M_ObApp, "")); /* *FullClose */

                var.addField("Sqmx0r4", new ObCharFld(ObField.ENVIRONMENT, 7, 'c', "Sqmx0r4", false, false, false, "", M_ObApp, false, "")); /* *View status */

                var.addField("Sqmx0r6", new ObCharFld(ObField.ENVIRONMENT, 7, 'c', "Sqmx0r6", false, false, false, "", M_ObApp, false, "")); /* *Returned status */

                var.addField("Sqmx0r8", new ObCharFld(ObField.ENVIRONMENT, 7, 'c', "Sqmx0r8", false, false, false, "", M_ObApp, false, "")); /* *Returning status */

                var.addField("Sqmx0ra", new ObCharFld(ObField.ENVIRONMENT, 7, 'c', "Sqmx0ra", false, false, false, "", M_ObApp, false, "")); /* *Report status */

                var.addField("Sqmx0rc", new ObCharFld(ObField.ENVIRONMENT, 7, 'c', "Sqmx0rc", false, false, false, "", M_ObApp, false, "")); /* *Panel status */

                var.addField("Sqmx0re", new ObCharFld(ObField.ENVIRONMENT, 7, 'c', "Sqmx0re", false, false, false, "", M_ObApp, false, "")); /* *Error status */

                var.addField("Sqmx0rg", new ObCharFld(ObField.ENVIRONMENT, 7, 'c', "Sqmx0rg", false, false, false, "", M_ObApp, false, "")); /* *Call status */

                var.addField("Sqmx0s3", new ObCharFld(ObField.ENVIRONMENT, 1, 'c', "Sqmx0s3", false, false, false, "", M_ObApp, false, "")); /* *Boolean */

                var.addField("VBETXT", new ObCharFld(ObField.ENVIRONMENT, 78, 'c', "VBETXT", false, false, false, "", M_ObApp, false, "")); /* *VBSCRIPT error description */

                var.addField("pF0TmErr", new ObIntFld(ObField.ENVIRONMENT, 1, 0, 'p', "pF0TmErr", "", M_ObApp, "")); /* *TerminateOnError */

                var.addField("pF0Mod", new ObIntFld(ObField.ENVIRONMENT, 1, 0, 'p', "pF0Mod", "", M_ObApp, "")); /* *Modified */

                var.addField("Sqmx0xh", new ObCharFld(ObField.ENVIRONMENT, 32, 'c', "Sqmx0xh", false, false, false, "", M_ObApp, false, "")); /* *Object name */

     

     

                return var;

            }

     

     

     

    The following is generated C++ where you see you don't get the error with duplicate names (note: G&B setting 'Use field implementation names in C++ source' not checked!)

     

     

    ObPtrArray*  ObFnc_GJ2::SetRTDIFldArray()

    {

        CreateRTDIFldArray(31);

     

     

        OB_RTDI_FLDD( 2    , 0x5A000632, 'n', 'i', 'p', 'n', 1    , 0    , 1    , 0    , "*Terminate", xTerminate_0);

        OB_RTDI_FLDD( 3    , 0x4F00271E, 'c', 'c', 'c', 'c', 78   , 0    , 78   , 0    , "*VBSCRIPT error description", xVBSCRIPT_error_description_1);

        OB_RTDI_FLDD( 4    , 0x4F002720, 'c', 'c', 'c', 'c', 7    , 0    , 7    , 0    , "*VBSCRIPT returned status", xVBSCRIPT_returned_status_2);

        OB_RTDI_FLDD( 5    , 0x43000E2C, 'c', 'c', 'c', 'c', 7    , 0    , 7    , 0    , "*VBSCRIPT returned status", xVBSCRIPT_returned_status_3);

        OB_RTDI_FLDD( 6    , 0x5A000397, 'c', 'c', 'c', 'c', 128  , 0    , 128  , 0    , "*CalledFunctionName", xCalledFunctionName_4);

        OB_RTDI_FLDD( 7    , 0x2B000462, 'c', 'c', 'c', 'c', 78   , 0    , 78   , 0    , "*mmapiErrorDesc", xmmapiErrorDesc_5);

        OB_RTDI_FLDD( 8    , 0x2B000464, 'c', 'c', 'c', 'c', 7    , 0    , 7    , 0    , "*mmapiReturnedStatus", xmmapiReturnedStatus_6);

        OB_RTDI_FLDD( 9    , 0x600002C4, 'c', 'c', 'c', 'c', 1    , 0    , 1    , 0    , "*Focus set", xFocus_set_7);

        OB_RTDI_FLDD( 10   , 0x600002F2, 'c', 'c', 'c', 'c', 32   , 0    , 32   , 0    , "*Database", xDatabase_8);

        OB_RTDI_FLDD( 11   , 0x600002F4, 'c', 'c', 'c', 'c', 32   , 0    , 32   , 0    , "*System", xSystem_9);

        OB_RTDI_FLDD( 12   , 0x60000309, 'c', 'c', 'c', 'c', 512  , 0    , 512  , 0    , "*Message", xMessage_10);

        OB_RTDI_FLDD( 13   , 0x1B0002D5, 'c', 'c', 'c', 'c', 78   , 0    , 78   , 0    , "*VBSCRIPT error description", xVBSCRIPT_error_description_11);

        OB_RTDI_FLDD( 14   , 0x1B0002DE, 'c', 'c', 'c', 'c', 7    , 0    , 7    , 0    , "*VBSCRIPT returned status", xVBSCRIPT_returned_status_12);

        OB_RTDI_FLDD( 15   , 0x60000351, 'c', 'c', 'c', 'c', 7    , 0    , 7    , 0    , "*Validation", xValidation_13);

        OB_RTDI_FLDD( 16   , 0x60000355, 'c', 'c', 'c', 'c', 256  , 0    , 256  , 0    , "*Message text", xMessage_text_14);

        OB_RTDI_FLDD( 17   , 0x60000362, 'c', 'c', 'c', 'c', 1    , 0    , 1    , 0    , "*Message delivery", xMessage_delivery_15);

        OB_RTDI_FLDD( 18   , 0x60000366, 'c', 'c', 'c', 'c', 128  , 0    , 128  , 0    , "*Object", xObject_16);

        OB_RTDI_FLDD( 19   , 0x60000395, 'c', 'c', 'c', 'c', 32   , 0    , 32   , 0    , "*Message ID", xMessage_ID_17);

        OB_RTDI_FLDD( 20   , 0x5A0004F2, 'n', 'i', 'p', 'n', 1    , 0    , 1    , 0    , "*FullClose", xFullClose_18);

        OB_RTDI_FLDD( 21   , 0x60000010, 'c', 'c', 'c', 'c', 7    , 0    , 7    , 0    , "*View status", xView_status_19);

        OB_RTDI_FLDD( 1    , 0x60000012, 'c', 'c', 'c', 'c', 7    , 0    , 7    , 0    , "*Returned status", xReturned_status_20);

        OB_RTDI_FLDD( 0    , 0x60000014, 'c', 'c', 'c', 'c', 7    , 0    , 7    , 0    , "*Returning status", xReturning_status_21);

        OB_RTDI_FLDD( 22   , 0x60000016, 'c', 'c', 'c', 'c', 7    , 0    , 7    , 0    , "*Report status", xReport_status_22);

        OB_RTDI_FLDD( 23   , 0x60000018, 'c', 'c', 'c', 'c', 7    , 0    , 7    , 0    , "*Panel status", xPanel_status_23);

        OB_RTDI_FLDD( 24   , 0x6000001A, 'c', 'c', 'c', 'c', 7    , 0    , 7    , 0    , "*Error status", xError_status_24);

        OB_RTDI_FLDD( 25   , 0x6000001C, 'c', 'c', 'c', 'c', 7    , 0    , 7    , 0    , "*Call status", xCall_status_25);

        OB_RTDI_FLDD( 26   , 0x60000033, 'c', 'c', 'c', 'c', 1    , 0    , 1    , 0    , "*Boolean", xBoolean_26);

        OB_RTDI_FLDD( 27   , 0x43000D5A, 'c', 'c', 'c', 'c', 78   , 0    , 78   , 0    , "*VBSCRIPT error description", xVBSCRIPT_error_description_27);

        OB_RTDI_FLDD( 28   , 0x5A0009A8, 'n', 'i', 'p', 'n', 1    , 0    , 1    , 0    , "*TerminateOnError", xTerminateOnError_28);

        OB_RTDI_FLDD( 29   , 0x5A0005D0, 'n', 'i', 'p', 'n', 1    , 0    , 1    , 0    , "*Modified", xModified_29);

        OB_RTDI_FLDD( 30   , 0x600000F5, 'c', 'c', 'c', 'c', 32   , 0    , 32   , 0    , "*Object name", xObject_name_30);

     

     

        return GetRTDIFldArray();



  • 13.  Re:  [PLEX9999] Exception has been thrown by the target of an invocation.

    Posted Feb 05, 2016 04:04 PM

    George -

     

    Glad you solved the issue and thanks for sharing.

     

    Best

    Lorenz