on 2012 Nov 08 4:25 AM
The title quotes the output from my MobiLink server when I try to load a .NET assembly for error reporting.
Background story: Our customer was running SA11 and ML11, the .net assembly was referenced in the report_error event and we went along fine (it worked). When upgrading the customer to SA12 we also upgraded to ML12. Long story made short, the .net assembly did not work anymore, throwing the same error as above.
I thought it might be like this because the assembly was referencing some DLL in ML 11 so now I have
Signature of ErrorReporting.MailReporting.ReportError is
public static void ReportError( ref int actionCode, int errorCode, string errorMessage, string user, string table)
I have installed 64-bit versions of SQL Anywhere 12 and MobiLink 12, but ml.net12.dll does not exist on my harddrive.
Can you help ?
EDIT: Update, I located a file named mldnet12.dll in /Bin64, copied this file to ml.net12.dll in the same folder and now I get a different error message.
E. 2012-11-08 10:59:38. <1> [-10179] No Assembly in domain 'DefaultMobiLinkDNetScriptingDomain' contains type 'ErrorReporting.MailReporting' E. 2012-11-08 10:59:38. <1> [-10018] Error fetching connection script begin_connection_autocommit E. 2012-11-08 10:59:38. <1> [-10179] No Assembly in domain 'DefaultMobiLinkDNetScriptingDomain' contains type 'ErrorReporting.MailReporting' E. 2012-11-08 10:59:38. <1> [-10018] Error fetching connection script begin_connection
Does this mean something ?
Complete output from server log (start and dbmlsync request) I. 2012-11-08 11:03:52. SQL Anywhere MobiLink Server Version 12.0.1.3769 I. 2012-11-08 11:03:52. I. 2012-11-08 11:03:52. Copyright © 2001-2012, iAnywhere Solutions, Inc. I. 2012-11-08 11:03:52. Portions copyright © 1988-2012, Sybase, Inc. All rights reserved. I. 2012-11-08 11:03:52. Use of this software is governed by the Sybase License Agreement. I. 2012-11-08 11:03:52. Refer to http://www.sybase.com/softwarelicenses. I. 2012-11-08 11:03:52. I. 2012-11-08 11:03:52. This server is licensed to: I. 2012-11-08 11:03:52. --- I. 2012-11-08 11:03:52. --- I. 2012-11-08 11:03:52. Running Unrecognized Windows version Build 9200 on X86_64 I. 2012-11-08 11:03:52. Server built for X86_64 processor architecture I. 2012-11-08 11:03:52. <Main> Local file for remote synchronization logs: 'mlsrv.mle' W. 2012-11-08 11:03:52. <Main> [10032] Unable to open the file to store the client synchronization logs. The filename is 'mlsrv.mle' W. 2012-11-08 11:03:52. <Main> [10036] Client synchronization logs will be shown in the MobiLink server message log file or the MobiLink server messages window I. 2012-11-08 11:03:52. <Main> Loaded Assembly "iAnywhere.MobiLink.Script, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a53f0c6f719e2641" from "file:///C:/Program Files/SQL Anywhere 12/Assembly/v2/iAnywhere.MobiLink.Script.DLL" into Domain "DefaultDomain" I. 2012-11-08 11:03:52. <Main> Loaded Assembly "iAnywhere.MobiLink, Version=12.0.1.3769, Culture=neutral, PublicKeyToken=a53f0c6f719e2641" from "file:///C:/Program Files/SQL Anywhere 12/Assembly/v2/iAnywhere.MobiLink.dll" into Domain "DefaultDomain" I. 2012-11-08 11:03:53. <Main> Loaded Assembly "iAnywhere.MobiLink.Script, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a53f0c6f719e2641" from "file:///C:/Program Files/SQL Anywhere 12/Assembly/v2/iAnywhere.MobiLink.Script.dll" into Domain "DefaultMobiLinkDNetScriptingDomain" I. 2012-11-08 11:03:53. <Main> Loaded Assembly "iAnywhere.MobiLink, Version=12.0.1.3769, Culture=neutral, PublicKeyToken=a53f0c6f719e2641" from "file:///C:/Program Files/SQL Anywhere 12/Assembly/v2/iAnywhere.MobiLink.dll" into Domain "DefaultMobiLinkDNetScriptingDomain" I. 2012-11-08 11:03:53. <Main> Loaded Assembly "ErrorReporting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" from "file:///B:/Workspace/MobiLink/ErrorReporting/ErrorReporting/bin/Debug/ErrorReporting.DLL" into Domain "DefaultMobiLinkDNetScriptingDomain" I. 2012-11-08 11:03:53. <Main> This software is using security technology from Certicom Corp. I. 2012-11-08 11:03:53. <Main> MobiLink server started I. 2012-11-08 11:03:53. <Main> Started RTNotifier 'RTNotifier1' I. 2012-11-08 11:04:09. <1> Loaded Assembly "iAnywhere.MobiLink.Script, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a53f0c6f719e2641" from "file:///C:/Program Files/SQL Anywhere 12/Assembly/v2/iAnywhere.MobiLink.Script.DLL" into Domain "DefaultDomain" I. 2012-11-08 11:04:09. <1> Loaded Assembly "iAnywhere.MobiLink, Version=12.0.1.3769, Culture=neutral, PublicKeyToken=a53f0c6f719e2641" from "file:///C:/Program Files/SQL Anywhere 12/Assembly/v2/iAnywhere.MobiLink.dll" into Domain "DefaultDomain" I. 2012-11-08 11:04:09. <1> Loaded Assembly "iAnywhere.MobiLink.Script, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a53f0c6f719e2641" from "file:///C:/Program Files/SQL Anywhere 12/Assembly/v2/iAnywhere.MobiLink.Script.dll" into Domain "DefaultMobiLinkDNetScriptingDomain" I. 2012-11-08 11:04:09. <1> Loaded Assembly "iAnywhere.MobiLink, Version=12.0.1.3769, Culture=neutral, PublicKeyToken=a53f0c6f719e2641" from "file:///C:/Program Files/SQL Anywhere 12/Assembly/v2/iAnywhere.MobiLink.dll" into Domain "DefaultMobiLinkDNetScriptingDomain" E. 2012-11-08 11:04:09. <1> [-10179] No Assembly in domain 'DefaultMobiLinkDNetScriptingDomain' contains type 'ErrorReporting.MailReporting' E. 2012-11-08 11:04:09. <1> [-10018] Error fetching connection script begin_connection_autocommit E. 2012-11-08 11:04:09. <1> [-10179] No Assembly in domain 'DefaultMobiLinkDNetScriptingDomain' contains type 'ErrorReporting.MailReporting' E. 2012-11-08 11:04:09. <1> [-10018] Error fetching connection script begin_connection
EDIT2: Confirmed that C:Program FilesSQL Anywhere 12bin64 is in my PATH variable and SQLANY12 variable is C:Program FilesSQL Anywhere 12
Thanks for reporting this long-standing problem!
I've fixed the plugin to use dnet
instead of .net
for the script language name, and to not add newlines to the script.
The issue number for this bug is 723981 and the fix is in build 12.0.1.3817, so will be in any future EBF releases with that build number or higher
I'm not sure how it worked for you in version 11. Perhaps someone hand edited the sync model file to make changes equivalent to those made by your UPDATE statements. The sync model code recognizes either .net
or dnet
when reading a sync model, but used the wrong one on output. As a possible workaround, you could try editing your model's mlsm
file in a text or XML editor (eg. locate the user-script
element for your handle_error
script, fix the type
attribute and delete the newlines around ErrorReporting.MailReporting.ReportError
so that the user-script
element is all on one line). If that works, it might last as long as you didn't change that script in the Events editor.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The newline is generated by the deployment wizard, it does not seem like I am able to edit it out from the model file.
Also, even if I change the type attribute to dnet the call to ml_add_lang_conn_script_chk
<user-script type=".Net" error="false">ErrorReporting.MailReporting.ReportError </user-script>
So the potential workaround doesn't work? Sorry about that. I guess whoever got it working in version 11 manually edited the generated SQL file before applying that to the consolidated, but didn't report the bug. FYI, editing the generated SQL file would be an alternative workaround to running the UPDATE statements, until an EBF with the fix is available.
This is my workaround so far, thanks to Reg Domaratzki - Sybase for pinpointing me in the right direction.
From my comments on his answers I hope there is something useable for you, because it seems like both my errors come from errors in the deploymentscript generated by the synchronization model designer.
My report_error script currently looks like this in the designer:
?report_error? ErrorReporting.MailReporting.ReportError
To get this to run I have to do this manually after deployment:
UPDATE ml_script SET script_language = 'dnet' WHERE script_language = '.Net' UPDATE ml_script SET script = 'ErrorReporting.MailReporting.ReportError' WHERE script LIKE '%ErrorReporting.MailReporting.ReportError%' COMMIT
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can probably stop trying to repro this for now. I found some suspicious code in the plugin and pointed it out to one of the plugin guys. They are discussing it.
As I have to manually tweak the ml_script table every time I deploy (creating a new model produced the same results) I would not mind spending some more time on getting to the final solution of this problem.
According to Bill Somers comment below I'll just wait a bit and see if the plugin guys come up with something.
The fact that you are getting the error "Cannot load DLL or shared object: 'ml.net12.dll' for Script Language: '.net'" means that you have somehow managed to get a row in the Mobilink system table that stores synchronization scripts with a language defined as ".net" instead of "dnet". That should not be possible using Sybase Central, or when using the standard SQL scripts to create synchronization scripts
ml_add_connection_script ml_add_dnet_connection_script ml_add_table_script ml_add_dnet_table_script ...
I don't like your work around to create a ml.net12.dll. I don't know if that will work, and I know that file will never be updated if you apply a future v1201 EBF. Please delete this file, and then read the next paragraph.
To solve the "Cannot load DLL or shared object: 'ml.net12.dll' for Script Language: '.net'" error, execute the following SQL against the consolidated database :
update ml_script set language = 'dnet' where language = '.net'; commit;
Stop and start the ML Server, and see if that solves your problem.
Reg
Aside : I'm happy to try and figure out how you got into this state, but for now, I'd like to concentrate on getting you back to a working system.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To elaborate on this a little, what's probably happening is that at startup the server sees your "-sl dnet" switch and so it loads mldnet12.dll and sets the MLAutoLoadPath you specified. Then, when it tries to run a script, it sees it's a ".net" script, so it tries to load ml.net12.dll using the default options. The ".net" script environment can't find any of your script classes because it doesn't have MLAutoLoadPath set.
Thank you. I might be closing in on something now. How I got into this seems to originate from the deployment of the synchronization model. I found this in the deployment script for my consolidated database:
CALL ml_add_lang_conn_script_chk ( 'version1', 'report_error', '.Net', ' ErrorReporting.MailReporting.ReportError ', 'FA16C87CD62289AAF625EC4D55A12214' )
This remains present in the deployment script also if I remove the event and recreate it.
Same thing happens on a brand new synchronization model:
CALL ml_add_lang_conn_script_chk ( 'Testmodell', 'report_error', '.Net', ' ErrorReporting.MailReporting.ReportError ', 'FA16C87CD62289AAF625EC4D55A12214' )
I updated ml_script and got rid of the ml.net12.dll error, but there seems to be something more to it.
I start the server like this:
mlsrv12 -c "DSN=consolidated" -sl dnet(-MLAutoLoadPath=b:\\Workspace\\MobiLink\\ErrorReporting\\ErrorReporting\\bin\\Debug)
The server outpout looks fine:
I. 2012-11-12 13:57:34. SQL Anywhere MobiLink Server Version 12.0.1.3769 I. 2012-11-12 13:57:34. I. 2012-11-12 13:57:34. Copyright © 2001-2012, iAnywhere Solutions, Inc. I. 2012-11-12 13:57:34. Portions copyright © 1988-2012, Sybase, Inc. All rights reserved. I. 2012-11-12 13:57:34. Use of this software is governed by the Sybase License Agreement. I. 2012-11-12 13:57:34. Refer to http://www.sybase.com/softwarelicenses. I. 2012-11-12 13:57:34. I. 2012-11-12 13:57:34. This server is licensed to: I. 2012-11-12 13:57:34. Oskar Emil Skeide I. 2012-11-12 13:57:34. *** I. 2012-11-12 13:57:34. Running Unrecognized Windows version Build 9200 on X86_64 I. 2012-11-12 13:57:34. Server built for X86_64 processor architecture I. 2012-11-12 13:57:34. <Main> Local file for remote synchronization logs: 'mlsrv.mle' I. 2012-11-12 13:57:35. <Main> Loaded Assembly "iAnywhere.MobiLink.Script, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a53f0c6f719e2641" from "file:///C:/Program Files/SQL Anywhere 12/Assembly/v2/iAnywhere.MobiLink.Script.DLL" into Domain "DefaultDomain" I. 2012-11-12 13:57:35. <Main> Loaded Assembly "iAnywhere.MobiLink, Version=12.0.1.3769, Culture=neutral, PublicKeyToken=a53f0c6f719e2641" from "file:///C:/Program Files/SQL Anywhere 12/Assembly/v2/iAnywhere.MobiLink.dll" into Domain "DefaultDomain" I. 2012-11-12 13:57:35. <Main> Loaded Assembly "iAnywhere.MobiLink.Script, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a53f0c6f719e2641" from "file:///C:/Program Files/SQL Anywhere 12/Assembly/v2/iAnywhere.MobiLink.Script.dll" into Domain "DefaultMobiLinkDNetScriptingDomain" I. 2012-11-12 13:57:35. <Main> Loaded Assembly "iAnywhere.MobiLink, Version=12.0.1.3769, Culture=neutral, PublicKeyToken=a53f0c6f719e2641" from "file:///C:/Program Files/SQL Anywhere 12/Assembly/v2/iAnywhere.MobiLink.dll" into Domain "DefaultMobiLinkDNetScriptingDomain" I. 2012-11-12 13:57:35. <Main> Loaded Assembly "ErrorReporting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" from "file:///b:/Workspace/MobiLink/ErrorReporting/ErrorReporting/bin/Debug/ErrorReporting.DLL" into Domain "DefaultMobiLinkDNetScriptingDomain" I. 2012-11-12 13:57:35. <Main> This software is using security technology from Certicom Corp. I. 2012-11-12 13:57:35. <Main> MobiLink server started I. 2012-11-12 13:57:35. <Main> Started RTNotifier 'RTNotifier1'
The assembly looks like this (compiled for .net framework 2, Any CPU)
// Type: ErrorReporting.MailReporting // Assembly: ErrorReporting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null // Assembly location: B:\\Workspace\\MobiLink\\ErrorReporting\\ErrorReporting\\bin\\Debug\\ErrorReporting.dll using System; using System.Net; using System.Net.Mail; namespace ErrorReporting { public class MailReporting { public void ReportError(ref int actionCode, int errorCode, string errorMessage, string user, string table) { //Do stuff...
Still, I get this error from MobiLink server when I syncrhonize:
E. 2012-11-12 14:02:23. <1> [-10179] No Assembly in domain 'DefaultMobiLinkDNetScriptingDomain' contains type ' ErrorReporting.MailReporting' E. 2012-11-12 14:02:23. <1> [-10018] Error fetching connection script begin_connection_autocommit E. 2012-11-12 14:02:23. <1> [-10179] No Assembly in domain 'DefaultMobiLinkDNetScriptingDomain' contains type ' ErrorReporting.MailReporting' E. 2012-11-12 14:02:23. <1> [-10018] Error fetching connection script begin_connection
The ".Net" value in the ml_add_lang_conn_script_chk() call really seems wrong, cf. the definition of ml_add_dnet_connection_script in script syncsa.sql in the MobiLink\\Setup directory, which clearly uses "dnet":
create procedure ml_add_dnet_connection_script( in @version varchar( 128 ), in @event varchar( 128 ), in @script text ) begin call ml_add_lang_connection_script( @version, @event, 'dnet', @script ) end
(No, I surely ain't saying the error is on your side...)
I could ask if MobiLink 11 used '.Net' as definition since this is a database upgraded from MobiLink 11 and SA 11 to ML 12 and SA12. However, I'm not sure if that is relevant as my ml_add_dnet_connection_script() procedure is identical to yours, the errors come from the synchronization model and appears in new syncrhonization models as well
Enter the script type as "dnet" instead of ".net"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
66 | |
10 | |
10 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.