Archive for April, 2012
Install a JDBC driver in SpagoBI
For those who don’t know what is SpagoBI, please read the following (copied from Wikipedia):
SpagoBI is the only entirely Open Source Business Intelligence suite, belonging to the free/open source SpagoWorld initiative, founded and supported by Engineering Group.
SpagoBI supports day-to-day and strategic business, both at the decision-making and operational levels. SpagoBI is a BI suite because it covers the whole range of analytical needs, supporting developers, testers and administrators in their daily activities.
SpagoBI is not very difficult to install but it is a bit more complicated to configure.
One of the problem I had was the following one:
GRAVE: Cannot open connection. org.eclipse.birt.report.data.oda.jdbc.JDBCException: Cannot load JDBC Driver class: com.microsoft.sqlserver.jdbc.SQLServerDriver
This exception is quite clear, it means that SpagoBI cannot load the JDBC driver for SQL Server. Indeed, I was connecting to a SQL Server database from one of my BIRT report.
What you have to do to fix this problem is:
- Download the driver JAR file from the Microsoft website: http://www.microsoft.com/download/en/details.aspx?id=2505
- Copy the JAR file into the following folder under the SpagoBI installation folder:
webapps/SpagoBIBirtReportEngine/WEB-INF/platform/plugins/org.eclipse.birt.report.data.oda.jdbc_2.6.1.v20100909/drivers
Note that the path might differ a little bit depending on the version of SpagoBI. - Restart SpagoBI
Check if field is displayed with JavaScript
When you have dynamic content on your webpage, it is sometimes useful to check if an HTML element is displayed on the screen.
For example, it could be handy to move the focus on a specific field after validation. But what if this field is actually hidden? Does your browser like to move the focus on an hidden field? Well, I can tell you that IE doesn’t like it very much! 😉
There are a lot of solutions on the web to check if a field is displayed or not. However, the solution I propose is probably the simplest:
function isDisplay(obj) { return obj.offsetTop > 0; }
Note that this code has been tested on Google Chrome 18.0, Firefox 3.6, Safari 5.1.5 and IE 7.
Install s3fs on Amazon Clouds
s3fs is a FUSE filesystem that allows you to mount an Amazon S3 bucket as a local filesystem. It stores files natively and transparently in S3 (i.e., you can use other programs to access the same files).
The following instructions detail the steps to install the program s3fs on an Amazon EC2 running Debian 5.0.5.
- Install libfuse
First, you need to install the package libfuse manually as the one provided via apt-get is too old (s3fs needs a version greater than or equal to 2.8.4).wget http://downloads.sourceforge.net/project/fuse/fuse-2.X/2.8.7/fuse-2.8.7.tar.gz tar xzf fuse-2.8.7.tar.gz cd fuse-2.8.7 ./configure --prefix=/usr make install
- Install libxml
You can simply install the package provided by apt-get:apt-get install libxml2-dev
- Upgrade mount
Because of a problem between fuse and mount, you need to upgrade the version of mount:wget http://www.kernel.org/pub/linux/utils/util-linux/v2.21/util-linux-2.21-rc1.tar.gz tar xzf util-linux-2.21-rc1.tar.gz ./configure --prefix=/usr --without-ncurses make install
For more information about this issue, please go to the following page: http://code.google.com/p/s3fs/issues/detail?id=228
- Install s3fs
You can now install s3fs using the following commands:wget http://s3fs.googlecode.com/files/s3fs-1.61.tar.gz tar xvzf s3fs-1.61.tar.gz cd s3fs-1.61/ ./configure --prefix=/usr make install
Note that I wanted to use s3fs to create incremental snapshot-style backups with rsync. Unfortunately, as mentioned on the following page, it didn’t work because s3fs doesn’t support hard links: http://code.google.com/p/s3fs/issues/detail?id=46