I was trying to learn about OpenESB following a tutorial. When I was running the test for the composite application in Part 3, the test often took tens of seconds before it could complete. It seemed that the test needed to wait due to the error below:
java.lang.RuntimeException: MBeanServerConnection is null. Make sure the App Server is running.
After some investigation, I found that the error could be fixed by entering a correct password to the GlassFish server, where the default password was "adminadmin". With this fix, the test could be completed in two seconds on my computer.
Showing posts with label computer. Show all posts
Showing posts with label computer. Show all posts
Monday, September 02, 2013
Thursday, October 25, 2012
Using USB thumb drive on Windows XP Guest with VirtualBox on Mac OS X Host
According to this post, to use a USB thumb drive on Windows XP guest in a VirtualBox machine on a Mac OS X host, one needs to use only one processor in the VirtualBox setting. What a surprising setting!
Tuesday, October 09, 2012
NullPointerException When Creating New LibreOffice Database File
When I tried to create a new database file in LibreOffice (version 3.6.2 on Mac), I encountered the following error:
SQL State: S1000
Error code: -27
file input/output error java.lang.NullPointerException.properties
The reason was that I had added a newer version of hsqldb file in the classpath. The one I added was hsqldb-2.2.6. It seemed that LibreOffice expected a version of 1.8.0.
After removing those hsqldb files from the classpath, I could create a new database file again.
SQL State: S1000
Error code: -27
file input/output error java.lang.NullPointerException.properties
The reason was that I had added a newer version of hsqldb file in the classpath. The one I added was hsqldb-2.2.6. It seemed that LibreOffice expected a version of 1.8.0.
After removing those hsqldb files from the classpath, I could create a new database file again.
Wednesday, June 20, 2012
Calibre Recipes for 每日日課 & 每日聖言
I have written two Calibre recipes for downloading daily Mass readings and breviary from the HK Catholic Diocesan Liturgy Commission webpage. They can be useful for reading offline on a e-reader like Kindle. To use them, copy each recipe to a text file, and then "load recipe from file" in Calibre.
They download content for 60 days starting from today. So one may ask Calibre to download these sources every 30 or 60 days.
Writing recipes are relatively easy tasks. The difficult task is to read them daily!
from datetime import date, timedelta
class MeiRiShengYan(AutomaticNewsRecipe):
title = u'\u6bcf\u65e5\u8056\u8a00'
oldest_article = 35
max_articles_per_feed = 100
auto_cleanup = True
no_stylesheets = True
encoding = 'big5-hkscs'
cover_url = 'http://liturgy.catholic.org.hk/dlcgif.gif'
def parse_index(self):
today = date.today()
current = today
feeds = []
articles = []
while (current - today < timedelta(60)):
url = 'http://catholic-dlc.org.hk/mk' + current.strftime('%y%m%d') + '.htm'
title = current.isoformat()
articles.append({'title':title, 'url':url,
'description':None, 'date':current})
current += timedelta(1)
feeds.append((u'\u6bcf\u65e5\u8056\u8a00', articles))
return feeds
def populate_article_metadata(self, article, soup, first):
title = soup.find('p', attrs={'class':['MsoNormal','MsoPlainText'], 'align':'center'})
if title:
article.summary = self.tag_to_string(title)
article.text_summary = article.summary
------------------------------------- recipe ends above ------------------------------------
from datetime import date, timedelta
class MeiRiRiKe(AutomaticNewsRecipe):
title = '每日日課'
oldest_article = 35
max_articles_per_feed = 300
auto_cleanup = True
feeds = []
no_stylesheets = True
encoding = 'big5-hkscs'
cover_url = 'http://liturgy.catholic.org.hk/dlcgif.gif'
map = {'LH1': '晨', 'LH2': '日', 'LH3': '晚', 'LH4': '誦', 'LH5': '夜'}
pages = list(map.keys())
pages.sort()
def parse_index(self):
today = date.today()
current = today
feeds = []
articles = []
while (current - today < timedelta(60)):
for page in self.pages:
url = "http://catholic-dlc.org.hk/%s_%s.htm" % (page, current.strftime('%Y%m%d'))
title = current.isoformat() + self.map[page]
articles.append({'title':title, 'url':url, 'description':None, 'date':current})
current += timedelta(1)
feeds.append(('每日日課', articles))
return feeds
def populate_article_metadata(self, article, soup, first):
title = soup.find('p', attrs={'class':['MsoNormal','MsoPlainText'], 'align':'center'})
if title:
article.summary = self.tag_to_string(title)
article.text_summary = article.summary
They download content for 60 days starting from today. So one may ask Calibre to download these sources every 30 or 60 days.
Writing recipes are relatively easy tasks. The difficult task is to read them daily!
每日聖言
------------------------------------- recipe starts below ------------------------------------from datetime import date, timedelta
class MeiRiShengYan(AutomaticNewsRecipe):
title = u'\u6bcf\u65e5\u8056\u8a00'
oldest_article = 35
max_articles_per_feed = 100
auto_cleanup = True
no_stylesheets = True
encoding = 'big5-hkscs'
cover_url = 'http://liturgy.catholic.org.hk/dlcgif.gif'
def parse_index(self):
today = date.today()
current = today
feeds = []
articles = []
while (current - today < timedelta(60)):
url = 'http://catholic-dlc.org.hk/mk' + current.strftime('%y%m%d') + '.htm'
title = current.isoformat()
articles.append({'title':title, 'url':url,
'description':None, 'date':current})
current += timedelta(1)
feeds.append((u'\u6bcf\u65e5\u8056\u8a00', articles))
return feeds
def populate_article_metadata(self, article, soup, first):
title = soup.find('p', attrs={'class':['MsoNormal','MsoPlainText'], 'align':'center'})
if title:
article.summary = self.tag_to_string(title)
article.text_summary = article.summary
------------------------------------- recipe ends above ------------------------------------
每日日課
------------------------------------- recipe starts below ------------------------------------from datetime import date, timedelta
class MeiRiRiKe(AutomaticNewsRecipe):
title = '每日日課'
oldest_article = 35
max_articles_per_feed = 300
auto_cleanup = True
feeds = []
no_stylesheets = True
encoding = 'big5-hkscs'
cover_url = 'http://liturgy.catholic.org.hk/dlcgif.gif'
map = {'LH1': '晨', 'LH2': '日', 'LH3': '晚', 'LH4': '誦', 'LH5': '夜'}
pages = list(map.keys())
pages.sort()
def parse_index(self):
today = date.today()
current = today
feeds = []
articles = []
while (current - today < timedelta(60)):
for page in self.pages:
url = "http://catholic-dlc.org.hk/%s_%s.htm" % (page, current.strftime('%Y%m%d'))
title = current.isoformat() + self.map[page]
articles.append({'title':title, 'url':url, 'description':None, 'date':current})
current += timedelta(1)
feeds.append(('每日日課', articles))
return feeds
def populate_article_metadata(self, article, soup, first):
title = soup.find('p', attrs={'class':['MsoNormal','MsoPlainText'], 'align':'center'})
if title:
article.summary = self.tag_to_string(title)
article.text_summary = article.summary
------------------------------------- recipe ends above ------------------------------------
Saturday, May 02, 2009
Jailbreak iPod Touch?
I know programming, though I don't know Cocoa programming and Objective-C. But I still want to try to develop some programs on a iPod Touch. Good news is that the iPhone SDK is free to download. The bad news is, I found that if I want to use/test my application on iPod Touch, I need to join the standard iPhone Developer Program for US$99. It seems that the only way for me to deploy an application to the iPod Touch for free is to jailbreak it. Yet doing so may lose the warranty by Apple.
Perhaps I have been spoiled by many open-source software for some time. For example, the GNU/Linux is a free OS, along with many free applications like OpenOffice, GIMP, Firefox, etc, and the programming tools of Eclipse and Java. Now I have moved to a Mac OS X, perhaps I should accept that fact that I will soon become a slave to Apple. For example, if I want to sync my calendar to any handheld devices, the likely choice is a iPhone/iPod Touch. And then if I want to write any real iPhone applications, I have to pay Apple for distributing it through Apple store.
Well, I don't mind using Apple products. The MacBook, iPod Touch, OS X are great. They have some very nice features. In particular, I like the Spotlight and the Spotlight comment feature from Leopard, along with the backup functionality.
But Apple products also have some weakness. One is that the it has to pay for the software. And there is a major weakness of Leopard that it is slow, compared with Ubuntu, I believe. The startup time is ok, but when I launch a few applications like Mail, Calendar, Firefox just after startup, it can take a few minutes until the computer has proper response again! It didn't happen when I use Ubuntu on a much older notebook. Fortunately, the MacBook sleeps properly most of the time, so that I don't have to launch these applications everyday, except that after one or two weeks it may require a reboot due to some non-responding process (e.g. Finder!).
In short, I hope I can find a way to better utilize the Apple hardwares without paying extra money. And now I have to consider whether to jailbreak the iPod Touch......
Perhaps I have been spoiled by many open-source software for some time. For example, the GNU/Linux is a free OS, along with many free applications like OpenOffice, GIMP, Firefox, etc, and the programming tools of Eclipse and Java. Now I have moved to a Mac OS X, perhaps I should accept that fact that I will soon become a slave to Apple. For example, if I want to sync my calendar to any handheld devices, the likely choice is a iPhone/iPod Touch. And then if I want to write any real iPhone applications, I have to pay Apple for distributing it through Apple store.
Well, I don't mind using Apple products. The MacBook, iPod Touch, OS X are great. They have some very nice features. In particular, I like the Spotlight and the Spotlight comment feature from Leopard, along with the backup functionality.
But Apple products also have some weakness. One is that the it has to pay for the software. And there is a major weakness of Leopard that it is slow, compared with Ubuntu, I believe. The startup time is ok, but when I launch a few applications like Mail, Calendar, Firefox just after startup, it can take a few minutes until the computer has proper response again! It didn't happen when I use Ubuntu on a much older notebook. Fortunately, the MacBook sleeps properly most of the time, so that I don't have to launch these applications everyday, except that after one or two weeks it may require a reboot due to some non-responding process (e.g. Finder!).
In short, I hope I can find a way to better utilize the Apple hardwares without paying extra money. And now I have to consider whether to jailbreak the iPod Touch......
Monday, January 29, 2007
中毒
近來聽到有個朋友電腦常常中毒,令到上網等也變得很慢,問我怎解決。我也不知怎好,雖然我讀計算機科學,但我讀的東西真的是幾科學,而不是一般應用的層面。要修理電腦,還是街邊的電腦鋪專業一點。
尤其中毒這問題,還是重裝Windows是最易解決的方去。當然,要是我的電腦中毒,我並不會即刻重裝,而要先試其他方法。但好幾年來,我好像也未試過中毒。或許因為我懂得小心使用我的電腦,這包括:
尤其中毒這問題,還是重裝Windows是最易解決的方去。當然,要是我的電腦中毒,我並不會即刻重裝,而要先試其他方法。但好幾年來,我好像也未試過中毒。或許因為我懂得小心使用我的電腦,這包括:
- 要經常更新Windows。
- 不要亂開其他人傳來可執行的檔案,即通常是.exe尾的。
- 使用Firefox來瀏覽網頁。IE與Windows太緊密連繫,容易受攻擊。有時甚至用舊版本的IE來瀏覽某些網站亦會中招。
- 到Ubuntu 下載網站找一個近自己的mirror,再下載供PC用的CD Image,如這裏。
- 用這個CD Image 燒錄到一個光碟上。(不是將這檔案抄到CD上)
- 將這CD放入電腦,再重新開機。如果你的電腦容許用CD開機的話,你便會看到Ubuntu了。可以用Firefox 來瀏覽網頁,Gaim來MSN/ICQ,OpenOffice來修改MS Office的文件。但小心,修改了的文件要儲進自己的硬碟或傳到自己的電郵。
Linux on FreeBSD 6.2
As I mentioned before, I love FreeBSD, without any particular reason. I want to migrate from Ubuntu to FreeBSD, but two Linux applications are holding me back. They are Flash 9 and Gnucash2.
The Flash 9 is required to see some NBA highlights video clips on ESPN.com, but Adobe haven't released version 9 for FreeBSD. It released one for Linux but I heard that (and found that) it crashes often on FreeBSD even it is available in the "port".
Another application is Gnucash. Gnucash 2 is a significant upgrade from version 1.8, since it uses version 2 of Gtk/Gnome instead of version 1. I think it is more user-friendly than the old version and I have been using it for some time on Ubuntu. However, I didn't find Gnucash 2 in the port. There is a unofficial port in the mailing list, as noted by the Wiki on Gnucash site, but I couldn't get it to run.
So I tried to use run the Linux version of Gnucash 2 on FreeBSD. The Linux base availabe on FreeBSD is Fedora Core 4. I have installed it for some time, since it is needed for the acroread7. So I downloaded the Gnucash2 RPM from the Fedora Core 6 site. When I installed using RPM, it failed, saying that the dependencies failed. However, I did find those depended files under /compat/linux (e.g. /bin/sh was reported as missing but I could find it at /compat/linux/bin/sh). After trying for some time, I found that there is a nodeps option for RPM. And later, I found that when the linux_base-fc4 installs the Fedora Core 4 on my FreeBSD, it just extracted the files to /compat/linux using rpm2cpio, but didn't register the installed RPM on the RPM database under /compat/linux/var/lib/rpm. So I tried to install the RPM for the Fedora Core again. But it was tedious due to the dependencies, and I needed to download many other RPM like glibc2, ORBit, etc. finally, when I tried to install the glibc2 or something similar on the system, it says it requires a Linux 2.6 kernel! But I read that FreeBSD is only compatible for the kernel 2.4. So the whole RPM experiment failed. Nevertheless, I have learned how to use the RPM system, and here are some tips for using it on FreeBSD:
The Flash 9 is required to see some NBA highlights video clips on ESPN.com, but Adobe haven't released version 9 for FreeBSD. It released one for Linux but I heard that (and found that) it crashes often on FreeBSD even it is available in the "port".
Another application is Gnucash. Gnucash 2 is a significant upgrade from version 1.8, since it uses version 2 of Gtk/Gnome instead of version 1. I think it is more user-friendly than the old version and I have been using it for some time on Ubuntu. However, I didn't find Gnucash 2 in the port. There is a unofficial port in the mailing list, as noted by the Wiki on Gnucash site, but I couldn't get it to run.
So I tried to use run the Linux version of Gnucash 2 on FreeBSD. The Linux base availabe on FreeBSD is Fedora Core 4. I have installed it for some time, since it is needed for the acroread7. So I downloaded the Gnucash2 RPM from the Fedora Core 6 site. When I installed using RPM, it failed, saying that the dependencies failed. However, I did find those depended files under /compat/linux (e.g. /bin/sh was reported as missing but I could find it at /compat/linux/bin/sh). After trying for some time, I found that there is a nodeps option for RPM. And later, I found that when the linux_base-fc4 installs the Fedora Core 4 on my FreeBSD, it just extracted the files to /compat/linux using rpm2cpio, but didn't register the installed RPM on the RPM database under /compat/linux/var/lib/rpm. So I tried to install the RPM for the Fedora Core again. But it was tedious due to the dependencies, and I needed to download many other RPM like glibc2, ORBit, etc. finally, when I tried to install the glibc2 or something similar on the system, it says it requires a Linux 2.6 kernel! But I read that FreeBSD is only compatible for the kernel 2.4. So the whole RPM experiment failed. Nevertheless, I have learned how to use the RPM system, and here are some tips for using it on FreeBSD:
- It is better to set an alias for rpm with a root option to /compat/linux, so that it won't accidentally modified the files on the FreeBSD system. It can be set in .cshrc as
alias rpm rpm --root /compat/linux
I once didn't set it and accidentally modified a system lib. So I have to go to "make installworld" to restore it.
- I tried to install the RPM for the FC4 base system. But I think it is better to just register the RPM without modifying the file system. There is a --justdb option which modifies only the DB without touching the file system. So something like this can be used (with the --root /compat/linux set as alias already):
rpm -Uhv --justdb --nodeps /usr/ports/distfiles/rpm/i386/fedora/4/*.rpm
Friday, December 22, 2006
openoffice + fglrx + scim Problem Solved
When I first upgraded to Ubuntu Edgy, as written in this post, I tried the ATI proprietary driver fglrx. However, when I started openoffice, it failed with this error:
Unknown error forking main binary / abnormal early exit
(Update for openoffice-2.0.4-ubuntu4: it just hangs when I start it.)
After several weeks, I finally found a solution to this problem, due to this post in Ubuntu forum by cnbiz850. The problem was due to incompatibility of scim + fglrx + openoffice. The solution suggested is to use "scim-bridge" instead of "scim" for the GTK_IM_MODULE. So what I did to solve it is:
Unknown error forking main binary / abnormal early exit
(Update for openoffice-2.0.4-ubuntu4: it just hangs when I start it.)
After several weeks, I finally found a solution to this problem, due to this post in Ubuntu forum by cnbiz850. The problem was due to incompatibility of scim + fglrx + openoffice. The solution suggested is to use "scim-bridge" instead of "scim" for the GTK_IM_MODULE. So what I did to solve it is:
- Install scim-bridge
- Modify /etc/X11/Xsession.d/95xinput and changed it to something like: GTK_IM_MODULE="scim-bridge"
Monday, November 20, 2006
FreeBSD Love
Don't know why, I have installed FreeBSD on many machines. I am a primarily GNU/Linux user. I use mainly Ubuntu GNU/Linux on my laptop. But still, I hope one day, I would find FreeBSD better and switch to it, while I haven't noticed any performance differences between them, nor I have understood the architecture/design/implementation differences between them.
One noticeable difference is, that the arguments accepted by FreeBSD commands are less flexible. For example, "ls * -l" is acceptable on GNU/Linux, but not on FreeBSD, which only allows argument before the file names such as "ls -l *". But perhaps due to this, I think FreeBSD is more Unix like. It is more traditional, and maybe more powerful. Perhaps this is due to its image - "The Power to Serve". Its advertisement may have won my heart. It is often said that Yahoo uses FreeBSD for its web servers. It shows that it is very powerful. And perhaps I have fallen in love with FreeBSD, so I have installed it on three desktop machines other than my laptop.
Same to some other products. I have started to believe that:
One noticeable difference is, that the arguments accepted by FreeBSD commands are less flexible. For example, "ls * -l" is acceptable on GNU/Linux, but not on FreeBSD, which only allows argument before the file names such as "ls -l *". But perhaps due to this, I think FreeBSD is more Unix like. It is more traditional, and maybe more powerful. Perhaps this is due to its image - "The Power to Serve". Its advertisement may have won my heart. It is often said that Yahoo uses FreeBSD for its web servers. It shows that it is very powerful. And perhaps I have fallen in love with FreeBSD, so I have installed it on three desktop machines other than my laptop.
Same to some other products. I have started to believe that:
- I wanted a Core 2 Duo from Intel.
- Apple Mac OS X is 'younger', more energetic, and more innovative than Windows from that 'fat' old guy Bill.
Saturday, November 04, 2006
Samba over SSH
Last night I tried to connect a Windows XP machine to a Samba server on FreeBSD. I follow a nicely written webpage by Edwin Olson but failed for many trials. At last, I found that I missed out some important steps from that webpage and after I followed also those steps, it succeeded! A lesson for reading instructions carefully.
There are two reasons for using Samba over SSH:
There are two reasons for using Samba over SSH:
- The port 139 is blocked for the outside connection to Samba server machine.
- SSH can encrypt the packets transferred, so that it gives better security for Windows file sharing.
- Install a loopback network adapter for SSH port fowarding (or follow the steps from Microsoft):
- Go to Control Panel -> Classic View -> Add Hardware
- Choose "Yes, I have already connected the hardware"
- Choose "Add hardware device" from the bottom of the list
- Choose "Install the hardware that I manually select from a list"
- Choose "Network adapters"
- Choose Microsoft -> Microsoft Loopback Adapter
- Configure the loopback adapter:
- Go to Control Panel -> Classic View -> Network connections
- The new loopback adapter should be called Local Area Connection 2
- Right click on it and choose Properties.
- Enable "Client for Microsoft Networks"
- Disable "File and Printer Sharing for Microsoft Networks"
- Click Properties of Internet Protocol (TCP/IP)
- Enter an IP address such as 10.0.0.1, subnet mask 255.255.255.0
- Click Advanced -> WINS
- "Enable LMHOSTS lookup" and "Disable NetBIOS over TCP/IP"
- Connect to the Samba machine through SSH:
- Download and install PuTTY from PuTTY webpage.
- Start PuTTY.
- Go to Connection -> SSH -> Tunnels.
- In source port, enter 10.0.0.1:139
- In destination, enter 127.0.0.1:139
- Click Add
- Then enter your host name as usual for SSH connection and click Open
- After you have connected successfully to the Samba machine through SSH, the port forwarding should be OK.
- The connection should be ready and you can access the files on Samba machine by:
- Click Start -> Run
- Enter \\10.0.0.1
- You should see the files shared by the Samba machine
- You may need to enable port forwarding of SSH on the server machine.
- A page by Edwin Olson, from which the instructions on this page follow
- A page suggesting using loopback adapter so that the file sharing doesn't have to be disabled on the client machine.
- A mini-HOWTO for GNU/Linux client machine
- Another page for Samba over SSH, which shows how you may test the connection when something has gone wrong
Friday, October 27, 2006
Blog
近來發現很多朋友都BLOG,讓我也BLOG多點。
今日發現原來blogger.com多左個新版本,叫beta版。我睇一睇有咩新功能,發現左可以label post,於是即刻轉左去。其實我想有這個功能好耐,因為我想寫一些不同種類的BLOG,但又不想搞到太亂。原本想開多個BLOG寫關於電腦的野,但而家不用了,因為有了這個label的功能,將post分類就易好多。於是乎我而家不睡,亦都將我以前的post分左類。遲些可以貼多一些書評和關於電腦的文。
今日發現原來blogger.com多左個新版本,叫beta版。我睇一睇有咩新功能,發現左可以label post,於是即刻轉左去。其實我想有這個功能好耐,因為我想寫一些不同種類的BLOG,但又不想搞到太亂。原本想開多個BLOG寫關於電腦的野,但而家不用了,因為有了這個label的功能,將post分類就易好多。於是乎我而家不睡,亦都將我以前的post分左類。遲些可以貼多一些書評和關於電腦的文。
Upgrade to Ubuntu Edgy
Ubuntu 6.10 (Edgy) was scheduled to release on October 26. I was too eager to update to the new release and so I upgraded to release candidate version before the official release. And here is my experience on this upgrade.
After the update, I don't notice any significant improvement. However, my X server couldn't start, since the ati driver was used in /etc/X11/xorg.conf but the package xserver-xorg-video-ati had not been installed. I switched to the fglrx driver and successfully started X, and hoped that I could have better hardware support using the proprietary driver. Everything looks good until I tried to start the openoffice! It gave me this error when I started it in a terminal:
Unknown error forking main binary / abnormal early exit
After googling for a while and looking at the Ubuntu forum, I found that it is related to ATI driver. So I switched back to the open-source ati driver, restarted the computer, and then the openoffice could run again! After this, I still tried to get my proprietary driver to work, trying different versions (8.26.18, 8.29.6) in addition to the one given in Edgy repository. Without luck, all trials failed. So instead of spending extra hours (in addition to the many hours I have spent!) on this, I decided to use the open-source ati driver. By the way, the display card I am using is RV350 [Mobility Radeon 9600 M10].
Other changes that I have noticed (or feel useful) after the upgrade include:
After the update, I don't notice any significant improvement. However, my X server couldn't start, since the ati driver was used in /etc/X11/xorg.conf but the package xserver-xorg-video-ati had not been installed. I switched to the fglrx driver and successfully started X, and hoped that I could have better hardware support using the proprietary driver. Everything looks good until I tried to start the openoffice! It gave me this error when I started it in a terminal:
Unknown error forking main binary / abnormal early exit
After googling for a while and looking at the Ubuntu forum, I found that it is related to ATI driver. So I switched back to the open-source ati driver, restarted the computer, and then the openoffice could run again! After this, I still tried to get my proprietary driver to work, trying different versions (8.26.18, 8.29.6) in addition to the one given in Edgy repository. Without luck, all trials failed. So instead of spending extra hours (in addition to the many hours I have spent!) on this, I decided to use the open-source ati driver. By the way, the display card I am using is RV350 [Mobility Radeon 9600 M10].
Other changes that I have noticed (or feel useful) after the upgrade include:
- Gaim 2.0 can now display the custom smiley in msn. But actually I hate this custom smiley, since I always can't understand what those custom smiley means!
- Evolution 2.8 supports a vertical preview message pane for mails.
- Tomboy seems to be an large improvement for note taking.
- It has GnuCash 2.0 now.
- Firefox 2.0 is available, but I don't see many (useful) improvements with it except the tab handling.
- The default Ubuntu Human theme is quite ugly.
Subscribe to:
Posts (Atom)