Feeds:
Posts
Comments

Archive for the ‘Weird Errors’ Category

Open Office and Plain Text Files

Keywords: Open Office, MSDOS line endings, a .txt file opens in Open Office Calc

I noted the following odd peculiarity recently. When opening a plain text file with the .txt extension using Open Office either on Windows with the MSDOS \r\n “CRLF” line endings or on Unix with Unix \n “LF” line endings, Open Office Writer correctly opens the file without complaint. However, when opening a plain text file with MSDOS “CRLF” line endings on Unix, Open Office tries to import the text file into a spreadsheet and pops a dialog. I don’t know if that is intended behavior or not, but it is useful to know if you’re processing text files in a Unix envoronment. This was observed in Open Office 2.4.

Update June 3, 2008 I reported this to Open Office with some extra details. Again I don’t know if it is a bug, but you should probably be aware of text file line endings, and have tools ready to change them if necessary.
(more…)

Read Full Post »

Keywords: .Net, Email, Attachments, Where are all the open file handles coming from?

Sending an Email message in .Net is easy using the System.Net.Mail namespace. Just make sure that if you use attachments, you dispose of them when you’re done. The reason is that creating and adding an attachment from a filename silently opens a file on your system and holds it open either until the attachment is disposed or until the entire message is disposed. The timing of opening/closing the attachment file has nothing to do with when you actually send the message. Given that the garbage collector is usually configured for best response time, that could very well be long after your message has gone out of scope; ie- until your process dies or is bounced by a web server.

(more…)

Read Full Post »

Topics: Servlets, Open Office Development

Recently I worked on incorporating an existing, working Open Office 2.3 based solution into a Java servlet, Tomcat 6.0.1.4. Everything worked fine until I dropped the bootstrapping code into a session bean, and then I got the dreaded “No office executable found” error. It happened when I tried to start up Open Office in the servlet using the com.sun.star.comp.helper.Bootstrap.bootstrap() method. Evidently I’m not alone, as there are any number of threads on this error at the Open Office community forums. Most of these threads are very helpful to read, but one of the frequent responders recently did a great job of distilling the knowledge there into a jar file solution that can be included right in your web-app’s classpath. It fixed the problem I was having right away.

An excellent solution to “No office executable found”

If you find it useful, please go there and leave a thank-you!

Read Full Post »

Mail Authentication

Keywords: Exchange Authentication, SMTP Authentication, Network Credentials

This is turning into a blog about weird errors.

So we have a .Net web application at work that takes orders for services internally. It has the feature that for authenticated users, an email will be generated to the service provider notifying them that a service has been ordered. Meanwhile the Email inbox of the service provider has a rule set up to generate a confirmation Email to the user when this Email from the web application has been received. This gives the users confidence enough not to generate a lot of phone calls, “Did you get my order?”, etc. However, we had the particular problem that while the service provider was getting all of the order Emails, the confirmation emails were only being generated sometimes. “All the time” or “none of the time” is OK. “Sometimes” is pure evil.
(more…)

Read Full Post »

Keywords: Excel COM Error, 8008005

As a follow on to my amusing misadventures with Excel COM running server side, I did some more digging and found out more interesting details on this situation. For starters, it’s not supported:KB257757. That doesn’t really bother me so much, it’s stable enough to run a few reports. And I firmly believe that if you’re not getting outside of your safe zone from time to time, then you’re probably not accomplishing very much. (That’s a corollary of Toback’s Law: If you never miss any flights, then you’re spending too much time in airports.)

(more…)

Read Full Post »

Keywords: Excel in C#, COM Interop, Primary Interop Assemblies (PIA), Errors

I don’t even know where to begin.

I recently had a report project that called for reports to be generated in an Excel spreadsheet. To figure out how to write Excel from C#, I drew on plenty of resources on the web, for example here, here and here. Any of these can get you started, and especially the last one by Bromberg needs attention for how to clean up COM objects accessed from inside a .Net managed application. So here’s the 5 minute synopsis good enough for my bug story.
(more…)

Read Full Post »

Project Name Too Long

Keywords: Microsoft.Net, Visual Studio, -1073741819, file path name length

While developing a simple console application recently in Visual Studio, I encountered the error

The program '[3952] LongNamedApplicationRpt.vshost.exe:

             Managed' has exited with code -1073741819 (0xc0000005).

The application builds fine, but when trying to run the application within the Visual Studio debugger (“F5”), it fails immediately and produces the above cryptic error. I am using Visual Studio 2005 (8.0) and the .Net Framework 2.0.50727, and the project output was for a Console Application in the Active(Debug) configuration. However, the application runs just fine from a command line.
(more…)

Read Full Post »