Connection to Domino crashes - c#

I'm trying to send an email using a Domino server from C#/VB.NET. (Having Lotus Notes client 8.5.3FP6)
The code looks like
using Domino;
...
try
{
NotesSession ns = new NotesSession();
NotesDatabase db = default(NotesDatabase);
NotesDocument doc = default(NotesDocument);
if (ns != null)
{
ns.Initialize(password); // Crashes here
...
I've looked at several example like
http://www.ibm.com/developerworks/lotus/library/domino-msnet/
http://www.codeproject.com/Articles/29442/Send-Lotus-Notes-Email-Using-C
http://www.codeproject.com/Tips/628681/Sending-mail-from-LotusNotes-using-Csharp
Lotus Notes Sending email with options
but they all crash in the Initialize call, without coming to the catch statement so I can see any error message.
What can be wrong? I have tried InitializeUsingNotesUserName as well as not sending in the password to Initialize, with same results.
I've also tried to import the reference to Domino if there was any problem with the interop file.
Thanks!

Try the following setting and see if it helps, can be found in File -> Security - User Security in Notes client

Not sure what your "DB" where you try to create a mail, but when I try to send a mail directly via Lotus Notes I use a selfmade function which directly create the mail into the server based mail.box
The reason why I do that is, that I have seen issues, when multiple users shared the same PC (and where they have only read access to the names.nsf or a local mail.box). I never saw that a client crash, but the issue with missing rights often caused similar error messages (Please not that IBM didn´t really support using the same profile for multiple users, so this is more the users fault because they didn´t the time it takes to relogin via windows). Since using the mail.box I haven´t seen such issues.

I had crashes when calling 'new NotesSession()', and solved it by registering nlsxbe.dll (run as administrator):
> regsvr32 "c:\program files(x86)\ibm\notes\nlsxbe.dll"

Related

Access Denied when calling mc_login()

I stumbled upon MantisBT recently and got it set up at my workplace for future bug tracking. I wanted to make a neat little library we can use in our applications so that users can report bugs to us directly from the application in question.
Currently in a sandbox application I made to try and understand MantisConnect. I consumed the webservice successfully and I can make a client. But if I try and do this:
MantisConnectPortTypeClient client = new MantisConnectPortTypeClient();
UserData usrData = client.mc_login("omitted", "omitted");
I get a FaultException and the message "Access Denied"
Currently running Mantis 1.3.rc-dev.02
Any ideas on why this simple call is denied? It doesn't matter what user I use. It gets denied regardless.
Okay I figured it out.
The WSDL file on the server was still pointing to mantisbt.org instead of our local server. Changed it to our local server address and it worked fine.

printserver throwing "Win32 error: The printer name is invalid." exception despite the server path provided is correct

I am out of idea why this is NOT working:
PrintServer printServer = new PrintServer("\\\\servername");
I am having issue with the PrintServer initialization. The above mentioned exception keep appearing even the printerServer path provided is a valid path. This is being said so as I am able to enumerate all the printers using printerServer.GetPrintQueues and foreach the printQueue to get the corresponding HostingPrintServer name.
EnumeratedPrintQueueTypes[] queueTypesArray = new EnumeratedPrintQueueTypes[]
{
EnumeratedPrintQueueTypes.Connections,
EnumeratedPrintQueueTypes.Local,
};
PrintQueueIndexedProperty[] indexPropertyArray = new PrintQueueIndexedProperty[]
{
PrintQueueIndexedProperty.Name
};
PrintServer printServer = new PrintServer();
PrintQueueCollection queueCollection = printServer.GetPrintQueues(indexPropertyArray, queueTypesArray);
foreach (PrintQueue pq in queueCollection)
{
if (pq.FullName == printerName)
{
this.printServerName = pq.HostingPrintServer.Name;
this.printerName = pq.Name;
}
}
I have also tried using the way this post suggested to get the DNS hostEntry but without any luck.
PrintServerException - "...name is invalid" even though I can access the path from windows
For your information, I am using Visual Studio 2010 running on Windows XP with two network printers connected. The printers are able to perform printing without any issue using PrintDocument and the printers are displayed on the PrintDialog as well.
Does anyone faced this issue before? If yes, may I know how do you resolve the issue?
Million thanks in advance.
EDIT:
Just tested with another "real" server printer, the above mentioned method is working fine. It is believed that Novell iPrint service which I am not sure how is the behaviour of it causing the issue. If anyone know more about the way to access Novell iPrint print server using C#, please feel free to share. I am currently still searching for the
solution.
hey i was facing similar issue, this is what i observed and made following changes, just try and let me know.
This issue was occuring due to windows feature/role "Print and Document service" is missing on the system. This role is required for managing multiple printers or print servers and migrating printers to and from other windows servers.
To add the role Go To Control Panel->Turn windows feature on or off->click on check box "Print and Document Service"->install.
See with network administrator for installing this rule if you unable to add it.
After adding the role you can able to create print server object and get the all the printqueues on respective server.

Lotus notes sends emails in debug mode

I use Lotus notes to send emails in my ASP.NET and C# web application. It sends emails when its in debug mode however if I publish in my local IIS server it does not send any emails.
Domino.NotesSession oNotesSession = null; ;
Domino.NotesDatabase oNotesDatabase = null;
Domino.NotesDocument oNotesDocument = null;
Domino.NotesDocument oNotesDocumentForOther = null;
object oItemValue = null;
bool flag = false;
try
{
String UserName = "";
try
{
oNotesSession = new Domino.NotesSession();
}
}
I get below error in the above line
{System.OutOfMemoryException: Retrieving the COM class factory for
component with CLSID {29131539-2EED-1069-BF5D-00DD011186B7} failed due
to the following error: 8007000e.
It sounds like the Lotus Notes COM DLLs or notes.ini file are not available to the account under which IIS is running. Can you change your IIS app pool to run under your account (the same account you use to access Lotus Notes?)
Alternatively, if you're just sending emails, is there any chance you can take the Lotus Notes client out of the picture entirely and just send via SMTP to the Lotus Notes server (or any other SMTP server in your domain?)
Ken is almost certainly correct, however there's another thing to consider. If you are intending to deploy your ASP project on a 64 bit server, you should be aware that the Domino Interop COM classes are not available as 64 bit code and the 32 bit version is not supported by IBM on Win64. It is possible to make it work for some purposes by installing Domino and manually registering the DLL for the classes, but there are known problems with some of the methods in the classes, and IBM is not planning on fixing them.
So I agree that you would be much better off writing your code to send SMTP messages.

PasswordEncoderNotFoundException using Jira SOAP API

I am working on integrating my company's product with Jira so users can log bug reports directly from the application. Everything was wqorking smoothly so i decided to import the data from our live Jira system into my development system so that i had some real world data to play with. Since then when i try to get an authtication token it throws the following exception "com.atlassian.crowd.exception.PasswordEncoderNotFoundException: The PasswordEncoder 'atlassian-security' was not found in the Internal Encoders list by the PasswordEncoderFactory". I have checked and the Atlassian Security Password Encoder is enabled in the Crown Password Encoders plugin.
My code is super simple just an ASP.net based text based issues search with the results wired to a grid view code as below:
JiraSoapServiceService service = new JiraSoapServiceService();
string token = service.login("integration", "test");
if (!string.IsNullOrEmpty(txtSearch.Text))
{
RemoteIssue[] issues = service.getIssuesFromTextSearchWithLimit(token, txtSearch.Text, 0, 100);
gvwIssues.DataSource = issues;
gvwIssues.DataBind();
}
I get the error on the call to service.login, it worked fine before I imported the live data. And yes i did add the integration user again after i had imported the data.
Anyone any ideas on this.
No idea what was causing this but rebooting the PC that the dev Jira was installed on fixed it.
EDIT
I have had this a few times now. It tends to happen when you do something like restart the SQL server, restore the jira database via SQL server, restore jira via the inbuilt XML file import method or similar. You don't have to restart the machine just the jira windows service. No idea if this is a problem with other DBs or server types.

Exchange WS 'The specified object was not found in the store.' error

We're using Exchange 2007 WS to process mail folders and are hitting various problems if we try and forward a message we've already received. Our process is:
Windows Service monitors mailbox folder, on finding a new mail we process the information and move the item to a 'Processed folder' and store the Exchange Message Id.
Users may opt to forward the mail externally. We use the Exchange API to find the item using the Message Id we stored earlier, and then again use the API to forward.
Except finding the mail again is proving rather flaky. We regularly get the following error:
The specified object was not found in the store.
Is there a better/more reliable way we can achieve the same? The documentation for Exchange WS is rather sparse.
This is a bug in microsoft exchange manage API. here is a link for more information
http://maheshde.blogspot.com/2010/09/exchange-web-service-specified-object.html
Are you saving the Message ID of the newly found message or the message once it has been moved to the 'Processed' folder? The id will change when it moves to a new folder.
The method recommended in the book Inside Microsoft Exchange Server 2007 Web Services is to grab the PR_SEARCH_KEY (0x300B, Binary) of the newly discovered item, then move it to the 'Processed' folder. You can then search for it in the new folder based on the PR_SEARCH_KEY and get it's new Message id to forward it.
I have come to the conclusion that this happens to me is because while my app is processing the emails, someone else is fiddling with an email at the same time.
So to cure the problem, I put it the code in a try catch and see if the exception is == the that object not found in store, if so I just skip it and move on to the next item. So for has no issues.
I wrote a program that reads the emails in inbox downloads attachments to the specified folder, wrote the email info and the saved path to the database, and finally deletes the email. I run this program as a windows service. After all tests are finished I run this program to the main server and run it. Program runs successfully but sometimes I got this error. I checked everything and finally I found that I forgot to stop service on my computer. 2 programs that runs on my computer and on real server checking the same mailbox at the same time. If you get this error make sure that only one program can process at the same mailbox.

Categories

Resources