Invalid handle attempting to load message from resource DLL - transactional

We are doing SQL Server Transactional Publication through C# code between SQL Server 2005 and SQL Express 2005. It is working in couple of laptops, but in some laptops it is giving error as:
Invalid handle attempting to load message from resource DLL
Can someone help me why we are getting this error and how can we solve it?

I came across this same issue while experimenting with RMO merge pull subscriptions. In my case the folder I had specified for the merge agent log didn't exists, or the current user didn't have permission to write to that folder.
subscription.SynchronizationAgent.Output = "C:\TEMP\mergeagent.log";

Related

Error in secure load of data source. An error occurred while decrypting data

I know a similar question already asked here but since given answer don't help me and my problem is kinda different I'm asking a new question.
I create data sources through admin panel -> Configure -> Datasources and it works fine. But if I restart server all created Datasources gonna missing from datasources list.
When I run ESB server I can see through logs that those datasources could not be loaded properly since ESB server is unable to decrypt sensitive data which it encrypted earlier:
DataSourceRepository Error in updating data source [remove:false] at path '/repository/components/org.wso2.carbon.ndatasource/myDatasource
Error in updating data source 'myDatasource' from registry
[remove:false]: Error in secure load of data source
meta info: An error occurred while decrypting data
Although myDatasource is missing from datasources list I can still see it in registry through admin panel -> Registry -> /_system/config/repository/components/org.wso2.carbon.ndatasource/myDatasource
I have the same issue. This seems to be some error introduced in 6.4.0.
6.3.0 does not exhibit this behaviour.
As a workaround, if you define the datasources in /conf/datasources/master-datasources.xml then the datasources load correctly at server startup. However this is not ideal solution as they cannot then be edited through the web console.
Alternatively you can download the registry entry , edit the password element to remove 'Encrypted=true' and change the password to be unencrypted. Then upload the edited file as a new registry entry alongside the old.
Both these methods are not feasible for production though as they leave the passwords unencrypted.
Out of interest are you running this on Windows? I discovered also on EI 6.4.0 that the Ciphertool utility will not run due to a malformed path. I suspect this might be related, but I cannot find where the malformed path is coming from it seems to be repeating the {carbon.home} element within the path :
C:\Program Files\WSO2\Enterprise Integrator\6.4.0\bin>ciphertool
Using CARBON_HOME: C:\Program Files\WSO2\Enterprise Integrator\6.4.0
Using JAVA_HOME: C:\WSO2\Enterprise Integrator\6.3.0\jdk\jdk1.8.0_192
Exception in thread "main" java.nio.file.InvalidPathException: Illegal char <:> at index 51: C:\Program Files\WSO2\Enterprise Integrator\6.4.0\C:\Program Files\WSO2\Enterprise Integrator\6.4.0\/repository/resources/security/wso2carbon.jks
at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
at java.nio.file.Paths.get(Paths.java:84)
at org.wso2.ciphertool.utils.Utils.getConfigFilePath(Utils.java:98)
at org.wso2.ciphertool.utils.Utils.setSystemProperties(Utils.java:289)
at org.wso2.ciphertool.CipherTool.initialize(CipherTool.java:93)
at org.wso2.ciphertool.CipherTool.main(CipherTool.java:52)

Xpages HTTP Web Server: Command Not Handled Exception HTTP Code: 500

Problem
I have an Xpage working properly on the test Domino server.
On production Domino server it can not be opened, Http 500 error displayed.
The two servers has different access control settings in the server document, but the signer of the application (production server) is listed in all programmability restrictions field except "Sign script libraries to run on behalf of someone else" field.
Server log
[25A4:0014-1604] 2012.11.07 14:06:30 HTTP JVM: SEVERE: CLFAD0141E: Error processing XPage request
[25A4:0014-1604] 2012.11.07 14:06:30 HTTP JVM: SEVERE: CLFAD0211E: Exception thrown
[25A4:0014-1604] 2012.11.07 14:06:30 HTTP JVM: SEVERE: CLFAD0246E: Exception occurred servicing request for: /applications/application.nsf/xpage.xsp - HTTP Code: 500
[25A4:0014-1604] 2012.11.07 14:06:30 HTTP Web Server: Command Not Handled Exception [/applications/application.nsf/xpage.xsp] CN=First Last/O=Company/C=Country Code
Question
I have searched the net including IBM pages and forums for possible fix this error, but I have not found useable solution. Does anyone now how to fix this error?
Have a look at the latest xpages_exc_*.log file in the data/IBM_TECHNICAL_SUPPORT folder on the server for a more detailed explanation of the error.
If you don't have access to the file system on the server, then install and use the XPages Log File Reader from OpenNTF for easy access to the server log files.
I also had this problem earlier this week on a production 8.5.1 server (without extlib) and it was resolved by restarting the Domino server.
Besides server security settings etc the issue can also be related to application specific settings. E. g. Fulltext index, database properties etc. It might be a good idea to compare these things too.
Furthermore I also recommend using the Log Reader for easy access to the XPages log files...
Here I found a fix for the same problem
"
The resolution was discovered! We had added some Crystal Reports jar files to the C:\Lotus\Domino\jvm\lib\ext directory. It appears as if Domino and XPages did not like that. Instead, we had to put them in a directory external to Domino and then needed to reference those jar files in the "JavaUserClassesExt" line of the notes.ini.
After this was completed, Xpages worked!
"
I got this same error when I included the extlib.relational.library with the extlibx.library in the page generations property section of the Xpage property window. If I uncheck the relational library it works fine.

Creating Membership DB (ASPNETDB) on remote server?

I'm building a web application which soon I'll be promoting to production. This application has a login screen, as you know I used the integrated DB for developing. Now I want to move this database to a full SQL Server 2005. I'm using the aspnet_regsql.exe to create my membership tables and stored procedures in the SQL Server 2005 but I'm getting an error:
An error occurred during the execution of the SQL file 'InstallMembership.sql'. The SQL error number is 207 and the SqlException message is: Invalid column name 'FailedPasswordAnswerAttemptWindowStart'.
I google this for half of the day already and I can't seem to fine what's wrong, does anybody have ANY ideas on what am I doing wrong here? Any help will be really appreciate it.
The easiest way to deploy a brand new database to a remote server is to just publish the database from within Visual Studio. Once you do that you have the scheme and data all in one script. You then access your server either via a local SQL manager connection or a remote manager and run the script on your remote database.
The site 4GuysFromRolla has a nice little walk through with graphics which describe how to accomplish the publishing of your local database to your hosted one.
Good luck, and hope this helps you out some.
Go through the *.sql script file and see where that column reference is. Then you'll be able to see what exactly the script is doing to cause this error. My guess would be that it is getting caught up on referential integrity. If it is trying to create a foreign key constraint that that table/column does not exist then you'll see that error.
But back to the original question at hand. You don't need to recreate your whole database. That script file is to lay down the Membership for an empty database. If you have a working dev database you can just back it up and restore it to a production instance. No need to rebuild the membership database objects.

Unable to connect to SQL database in AppData when deployed to web server

I have a ASP.Net program written in C# that uses a database stored in the AppData directory, the program works perfectly on my development (Win7\SQL 2008R2) when I deploy to a Win2008R2\SQl 2008 R2 server the program is unable to connect to the database. I'm using the connection string below. Several sites suggest I set the Application Pool to use 'Network Service' as this has Modify permission to the AppData directory, I have done this but it still won't work, another site suggested I Application Pool to "Load User Profile = True" but still no joy.
I'm pulling my hair out with what else to try, can anyone help?
data source=.\SQLEXPRESS;Integrated
Security=SSPI;AttachDBFilename=|DataDirectory|\DB.mdf;User
Instance=true
I get "Object reference not set to an instance of an object." in my app and "An attempt to attach an auto-named database for file C:\inetpub\wwwroot\ADPhonebook\App_Data\DB.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share." in the Application Event Log
I really appreciate any advice, thanks.
Steven
As Martin points out in the comments, it would be interesting if you posted the exact error message (and maybe the full exception detail) you are getting.
But problems like this have mostly to do with rights at the OS level.
So make sure that the user (identity) of the Application Pool has full access (ntfs) rights to the .mdf file, and try again.
Edit (after you posted the exact message):
Ok, I guess this means that on the server you're deploying to, there is already a database called DB on that Sql Server instance. So you will have to remove or rename that one in order to be able to attach a database with that name.
I think the user rights problem is also still possible though.

SQL Express & IIS - A database won't attach if you manually detached it?

Since the answers did not really cover the problem, I posted this on ASP.Net and completly rephrased it. I will post the edited question here:
I have been using the attachDB connection string and I usually deploy to IIS. The site works fine, however, I made some changes to the database and the newest version would not copy as it said file in use.
I opened up SQL management studio and saw that it was mounted so I did a dettach.
I was then able to copy the new version without problem, however, when I next run the site, I get:
Unable to open the physical file "C:\inetpub\wwwroot\vs\App_Data\aspnetdb.mdf". Operating system error 5: "5(failed to retrieve text for this error. Reason: 15105)".
An attempt to attach an auto-named database for file C:\inetpub\wwwroot\vs\App_Data\aspnetdb.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
And, if I try to access .Net users or the other few options within IIS Manager, I get the following error:
.NET Users
There was an error while performing this operation.
Details:
A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.)
OK
I have tried recycling the application pool, restarting the SQL instance and even restarting the computer.
Nothing helps and I cannot figure out what is wrong... Where does it remember where previous databases are connected and why doesn't it automatically reattach the database?... Someone said that they auto detach after 2 1/2 hours, however I waited 5 hours when a database wasn't in use and SQL Manager showed it was still attached.
When I manually reattach the database, everything works fine.
When you ask a database to be attached on-the-fly to a SQL Express instance using the AttachDBFileName connections string the application will not connect to the SQL Expres sinstance at all, but instead it will connect to a child instance, which is an new instance created specificaly for the user requesting the attach operation. See SQL Server 2005 Express Edition User Instances. This child instance will attach the database and will continue to run for up two one hour, after which it will shut itself down.
When you try to connect from 'enterprise manager' you will not be able to connect to the child instance (is realy complicated to connect explicitly to one, so you cannot accidentaly do it), you are connecting to the parent instance and messing with the database.
To summarize, either stick with the RANU model and use AttachDBFileName, or use a normal database operations mode and manage the database from the SSMS. Don't mix the two.
Are you certain there isn't already a database with the same name attached to the SQL Express instance you are pointing your site at?
Also, does the identity the site is running under when it attempts to attach the database have admin rights in SQL Express? If not, this command won't work (I'm not sure what error it gives in that situation, but "Access Denied" would sound reasonable).
The page "SQL Server 2005 Express Edition User Instances" seems to give a good overview of the issues and workarounds.
Edit to add
Could this be the issue:
An error will be generated if a log file exists in the same directory as the data file and the 'database' keyword is used when attaching the primary data file. In this case, remove the log file. Once the database is attached, a new log file will be automatically generated based on the physical path.
Taken from the documentation for SqlConnectionStringBuilder.AttachDBFileName Property
You'll need to delete the log file before you can re-attach the database through this method.

Resources