Thursday, May 25, 2006

Migrated to Windows

Hi all. Now I'm using Windows as my development environment. Why? Next time I will tell why :)

Wednesday, March 29, 2006

Debugging JNLP WebStart application

I have finally succeed in debugging my webstarted app using IDEA. It is the JAVAWS_VM_ARGS which save lot of my time.

Basically, IDEA can remote debug virtually any app as long as it is started with some special arguments. The bad news is that not all of those arguments are allowed to be specified in the JNLP file. Finally I found this forum thread which gave some enlightment.
http://forum.java.sun.com/thread.jspa?threadID=569693&messageID=4039981

I added this entry to my ~/.bash_profile.

export JAVAWS_VM_ARGS="-Xdebug -Xnoagent -Djava.compiler=NONE \
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"

Saturday, December 17, 2005

Ghostscript and Java

I recently experienced problem printing from my java app using ghostscript. The error message is here:
 D [17/Dec/2005:14:25:48 +0700] [Job 54] Error: /configurationerror in --setpagedevice-- D [17/Dec/2005:14:25:48 +0700] [Job 54] Additional information: [/ManualFeed false]  
After hours searching, I finally found the solution.
It is in /usr/share/ghostscript/8.15/lib/gs_setpd.ps
Here is the diff
 --- gs_setpd.ps.bak     2005-12-17 14:30:23.000000000 +0700 +++ gs_setpd.ps 2005-12-17 14:31:49.000000000 +0700 @@ -171,10 +171,10 @@    % the default policy to "7" (impose) to avoid numerous problems with    % printing within CUPS...    % -  % /PolicyNotFound 1 -  % /PageSize 0 -  /PolicyNotFound 7 -  /PageSize 7 +  /PolicyNotFound 1 +  /PageSize 0 +  % /PolicyNotFound 7 +  % /PageSize 7    /PolicyReport {      dup /.LockSafetyParams known {         % Only possible error is invalidaccess  

Monday, November 7, 2005

Mandriva 2006

I upgraded my and my clients PCs to Mandriva 2006 PowerPack. It is
fantastic. Shorter boot time, look and feel, and the list grows. I
copied the CDs' contents to my harddisk then invoked urpmi.addmedia
--distrib, and then urpmi --auto-select. It worked like charm.

But...

There is one disappointment. There is no postgresql-server package. I
was forced to download it manually.

Friday, November 4, 2005

FasterFox Break

Recently I discovered that FasterFox extension located in mozilla break
WebWork's token mechanism.
It appears that FasterFox caused the lines

public static String setToken(String tokenName, HttpServletRequest
request) {
HttpSession session = request.getSession(true);
String token = GUID.generateGUID();
session.setAttribute(tokenName, token);

return token;
}

in TokenHelper to be executed twice. This make the token saved in the
session differs to those rendered in the page. As a result,
invalid.token is always returned thus disabling user from using forms.

Thursday, November 3, 2005

Found Resin Xml Bug Revisited

After I wrote my blog titled Found Resin Xml Bug (http://tew.blogspot.com/2005/09/found-resin-xml-bug.html), I discovered that it only applies to JDK 1.4. Things are different in 1.5.
Here it is:
 	<system-property javax.xml.parsers.DocumentBuilderFactory= 				 "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl"/> 	<system-property javax.xml.parsers.SAXParserFactory= 				 "com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl"/> 

Solitaire is Deadlock-Prone

Solitaire is one of my favorite games. Recently, I discovered that it is
deadlock-prone. Why? I think you who have ever played it have noticed
it. Sometimes I cannot make any progress and is forced to give up the
game session because one or more important cards are buried.

I think this is interesting because people tend to use Philosopher to
explain deadlock.

PS: I use PySol in Linux for playing. PySol contains several games. The
game I play is Klondike.

Wednesday, September 21, 2005

Samsung CD Writer and K3B

I experienced weird things when writing CD using K3B. The verification
always fails when I use cdrecord in DAO mode. I tried RAW mode and
suprprisingly it succeeded.

Tuesday, September 6, 2005

Found Resin Xml Bug

I've finally fixed bug which plagued my project for some time. The bug causes FileSystemPreferences to throw warning messages like this:
Couldn't flush user prefs: java.util.prefs.BackingStoreException: java.lang.NullPointerException
every 30 seconds.
This is happened on Resin 3.0.13. I fixed this by adding the following lines into my resin-web.xml.
<system-property
javax.xml.parsers.DocumentBuilderFactory=
"org.apache.crimson.jaxp.DocumentBuilderFactoryImpl"/>
<system-property
javax.xml.parsers.SAXParserFactory=
"org.apache.crimson.jaxp.SAXParserFactoryImpl"/>

The NPE is thrown on the line 321 of java.util.prefs.XmlSupport

319 | Element xmlMap = (Element) doc.getChildNodes().item(1);
returns null ^^^
320 | // check version
321 | String mapVersion = xmlMap.getAttribute("MAP_XML_VERSION");

Resin xml implementation would behave correctly if item(1) was modified to item(0). After several considerations I decide to stop using resin xml implementation in favor of default JDK 1.4 xml instead of creating my own implementation of Preferences.

Thursday, August 25, 2005

Hard Time Working with Webwork's altSyntax

Actually I have hard time working with Webwork's altSyntax. It is %{} that caused me headache. I have to check whether the getValueClassType() return String or not. To me it's inconsistent. I'm more willing to put %{} every where when I need OGNL than checking individual tag;s value class type.