July 2006 - Posts

Hmmmm... During deployment time to our Linux server, I encountered this error that said


MySQL java.net.SocketException: Broken pipe

It was really becoming frustrating since I couldn't determine where the error was coming. Checked the code, eliminated those finally blocks where I close the connection. It didn't solve the problem. Finally, when I was about to give up(or am I being real here?), I found this solution.

in mysql terminal:

mysql> SHOW VARIABLES;

Look a variable called connect_timeout, then set it to a higher value than you had before. Mine was from 10 to 60

mysql>SET GLOBAL connect_timeout=60;


voila! The error is gone!


Reference sites:

http://dev.mysql.com/doc/refman/4.1/en/server-system-variables.html
http://archives.neohapsis.com/archives/mysql/2006-q1/1047.html
http://forums.mysql.com/read.php?39,42763,96476#msg-96476
Posted by lamia | 3 comment(s)
Filed under: ,
Ok, this should have been posted yesterday, but since something went wrong after I typed a very lengthy blog, I'm just gonna post this again now and write everything from the top of my head. So, it would seem that having multiple message-resources in struts-config.xml is indeed legal. However, if you have multiple entries with a key attribute specified on each, this would cause your app to break if you have <html:javascript/> enabled. Why? Because the validation framework's client-side validation looks for the default key value.

<message-resources key="resource1"  parameter="errors.ErrorMessageResources"/>
<message-resources key="resource2"  parameter="language.LanguageResources"/>

again, the above entry would break your if you have the <html:javascript/> tag somewhere in your JSP. It seems to work ok though without it. Also, if you're going to use multiple bundles or resources in your JSP with the <bean:write/> tag, don't forget to specify the bundle attribute so it would point to the right bundle.

<bean:write bundle="resource1"  key="my.error.message"/>

and to use the <html:javascript/> tag freely, don't specify any key with the error message bundle.

<message-resources parameter="errors.ErrorMessageResources"/>
<message-resources key="languageResources"  parameter="language.LanguageResources"/>

Sorted! ;)
Posted by lamia | with no comments
Filed under: ,
I haven't totally succeeded in internationalizing everything yet. But it was quite a surpirse how easy it was to do this in Java with the help of Struts <bean:write/> tag. All my static contents can now be converted to arabic(and other languages). The problem right now are dynamic data or database driven content. How am I suppose to internationalize those...? After having done this, I feel so exhausted. It's really a pain to put up all these features they're asking and DOTA(Do Over Time Again). I left the office early today, I really needed some rest... I will cover a thourough sample of this once I get to recover... Here are some good links that could help on the subject...


http://www.allapplabs.com/struts/struts_internationalization.htm
http://www.devx.com/Java/Article/30071

Posted by lamia | 2 comment(s)
Filed under:

I had no problem migrating to MySQL from SQLServer 2000. SELECTing fields from the tables didn't give any problem except when I tried inserting. I must have misconfigured something in MySQL's migration toolkit and received the following errors while INSERTing to database.


java.sql.SQLException: Field 'user_id' doesn't have a default value


Well.. After speding a few hours searching google, and asking in the forums which I didn't get any answers at all... I figured out that My auto-increment keys are are not auto-incremented at all. I was too lazy typing in the command line, there was MySQL Admin for that. I checked the auto-increment box and everything was fine again. NOT! There was another problem, the MySQL datetime fields stores datetime fields in a different format than SQLServer 2000.

MySQL: yyyy-mm-dd (and various others)
SQLServer2k: yyyy/mm/dd (and various others)
sasd
perhaps the main difference is just the hyphen symbol(-) and the slash(/). I simple wrote a Java class to handle the parsing for me. Whew! It was a long day... I hope I could go to deployment phase next week! Happy weekends!


Posted by lamia | with no comments
Filed under:
Ok, apparently there was an easier way to install flash plugin for mozilla browser under Solaris 10. First, follow the link below...


http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash


save the file anywhere in your drive, I put it in /Documents/downloads/plugins, but that's just my preference.
Posted by lamia | with no comments
Filed under:
I'm really a fan of mono project. Too bad I don't have my Linux box here yet to try it out (on Linux of course). Perhaps when I get the time, I will get to try this very cool thing. I also stumbled two great articles, I haven't finished reading it but I will maybe sometime later, today...


http://www.codeproject.com/cpnet/introtomono1.asp
http://www.codeproject.com/cpnet/introtomono2.asp


I haven't heard of mono for Solaris(i386). There maybe need for me to compile it from source(which I'm not really good at). Somebody tell me if you have any info. ;)
Posted by lamia | with no comments
Filed under:
While having a quarrel with my sister on yahoo(using GAIM), I was searching again for the mozilla flash player plug-in. It's been pretty annoying since I always get the browser to ask me to install it everytime I visit a flash-enabled website. The directory is located in

/usr/sfw/lib/mozilla/plugins/

so basically, all you have to do is extract .gz file that can be downloaded
here.

If you want to make sure, the file is install_flash_player_7_solaris_sparc.tar.gz which has the following files in it...

    - libflashplayer.so

Installation instruction is given with the link I provided above. I haven't really tested this yet but I'm quite sure that it would work. LIke I said, I'm no opensource/Linux or MIcrosoft guy. I'm just a user and I stand in between, so don't blame me if you go wrong. I'm just sharing what I've come to encounter. Until next time, hopefully I could show some cool Solaris tricks and some cool screenshots. And before I forget, I found the info at John Gardner's Weblog. Laterz...
Posted by lamia | with no comments
Filed under:

Ok... So all these times I was developing a Java app for my company because I thought they could afford the Windows hosting with SQLServer 2000. I was confident to use opensource frameworks and other plug-ins because of that. But now I am having this nightmare because we had to switch to centOS Linux server. Few problems I am facing is...

1. Configuring Struts framework to our selected server(host)

2. Configuring JCaptcha(for captching). The X Server needs to be running...

3. Deploying using only SSH(I never had any experience before)

4. Migrating from SQLServer 2000 to MySQL 5(Migration toolkit solved this)

My company is obviously taking the cost-effective route. But surely, being the only developer in the company puts a lot of pressure in me. Especially now that the app is almost already finished. I think the app is well-engineered..

I was informed by my boss that next time, we'd be using PHP. I wouldn't mind if we used that... It would be nice to explore some of PHP 5's features and get exposed to its Object-Oriented programming style. But I wonder if I won't get bored in the long run... I've used PHP4 before and I can say that I didn't enjoy it as much as I enjoyed using Java... What a sad life...

Posted by lamia | with no comments
Filed under: