Wednesday, October 17, 2012

Monday, June 20, 2011

The dreaded Unspecified Error '80004005'. IIS7, OleDB and MS Access

Today it happened again. We were testing an ASP.NET website running under IIS 7 on W2K8 64bit. The website uses Windows authentication. The OleDB driver could connect happily to the MSAccess using the Microsoft.ACE.OLEDB.12 driver when using the browser from an account on the server, however connecting from a different client using Windows credentials failed with the dreaded Unspecified Error '80004005' OleDBException. This terrible unspecific error could mean anything.
After checking all kinds of settings and coding errors I decided to start a Coder's best friend, PROCMON (Process Monitor). I am always somewhat overwhelmed by the hundreds of thousands messages that show up. After filtering on process name (w3wp.exe) became obvious what was the problem. Just before the exception is thrown it shows ACCESS DENIED on directory c:\windows\ServiceProfiles\NetworkService\AppData\Local\Temp. Giving all users read/write access to this directory solved the problem.
I never saw this behaviour in IIS6. The reason is that in IIS6 the driver writes in c:\windows\temp and by default all users have write access on this directory. In IIS7 the temp directory for the NETWORK SERVICE account is no longer c:\windows\temp but c:\windows\ServiceProfiles\NetworkService\AppData\Local\Temp and only NETWORK SERVICE has access to this directory. When using windows authentication impersonation is used and an other user than NETWORK SERVICE tries to write in the directory and an exception is thrown.

Sunday, June 12, 2011

Geoserver and CADRG RPFTOC support

I always wanted to start a blog, but always thought that the things I am doing, learning or discovering are trivial. I am interested in many things. One of the things I like is Geoserver. It is easy to setup and adding new data stores and layers is easy. For me the biggest lack in functionality is the support for the RPF TOC format. GDAL supports this format, however the software layers between GDAL and Geoserver do not have the required functionality. The documentation claims it is is easy to add the missing functionality by implementing a few classes and actually it is really not that hard. I managed to do this in a couple of hours. The patches are submitted to the imageio-ext project (patch 1) and the Geotools project (patch 2), so I expect this functionality to end up in Geoserver in the near future. To my surprise no changes where necessary to Geoserver and the functionality was available after deploying the jar files to the right locations. My compliments to the Geoserver team.
Update: The patch has been committed to imageio-ext and will appear in geoserver. My guess is that is will be in the next version of geoserver (2.2). If you want to try out this new functionality in version 2.1.0 then you can download unsupported patched jar files (download). Install your geoserver 2.1.0 with GDAL support and install the jar files in webapps/geoserver/WEB-INF/lib. Make sure you replace gt-imageio-ext-gdal-2.7.1.jar with gt-imageio-ext-gdal-2.7.1.modified.jar.