Tuesday, July 27, 2004

OpenSource OverWhelming OverPowering : 3 O's: Free Software, Pay For Services.

  • Day by day open source is becoming overwhelming, why is that ??. 'cauz indeed it is.
    Everytime you have some need for small utility, which you are quite sure exists out there on the web, you "google" and land up in some open source repository. initially you were intended to spend 5 mins in grabbing your utility and get the hell out of there, but now by the time you are out of this website you must spend hours in it, reason, its too "Overwhelming", there is tons of information out there, too hard to resist.
  • Traditional product based companies in a pre-Open source era (early to mid 90's ) wrote the dazzling products and sold it for millions. Today you go and look for similar products you will find atleast 3-5 products on an average all for "FREE" (Sounds so good!!). So what is the conclusion.

"Did all those customers wasted millions of $$ ??", probably not for their time, but todays time, yes its what "Software" should be open source and free, and what customers should pay is for "Services". So Open source is "OverPowering" over traditional/commercial sofware products.

Its all about justification of Customer's "Artha" (Money in Sanskrit) and making them happy for what they pay.

more to come soon.. on this subject. its endless.!!

Monday, July 26, 2004

MySQL / Windows XP dilemma ; Check your version


Windows XP / MySQL 4.1 (beta release) / Connection problem via MySQL Connector/J
Error like : java.sql.SQLException: Server connection failure during transaction...Attempted reconnect 3 times...

My Blah! Blah!
I learned this hard way (real hard way!!) , I wish someone would have told me this, so much for not reading product documentation. I'm not even sure whether its documentated somewhere. Well "Googling" works all the times.  I'm doing something with Apache Torque and MySQL under struts/tomcat. recently moved to Windows XP from NT for some secret business reasons (;)) . So on NT my whole setup is works like charm, as soon as i started setting up everything on XP machine, I downloaded (unstable small little beast!!) and what i see the behavior which is very frustrating and painfull search for the problem, but no clue at all what could be the problem.
  •  Downloaded & Installed MySQL 4.1 (beta release) , running Torque with this version what i see is no error, all Torque says "Connection is null...." doesnt make sense when all the parameters are right
  • Went down to much lower level, wrote my jdbc calls, connection, statement whole nine yard, what i get is following java.sql.SQLException: Server connection failure during transaction...Attempted reconnect 3 times...  absolutely ridiculous, MySQL works fine with Control center, all permissions seems to be fine, With GRANTS/ACCESS on the user.

Guessed this could be nasty version issue, uninstalled MySQL 4.1  and installed MySQL 4.0. Daeeeeeemmmnnn! it worked like a charm again.


Roll back on Old version MySQL 4.0 still rocks. They Say  for new developement use MySQL 4.1 ; Think twice before wasting 4-5 days on this and later discovering that its a version issue.  MySQL 5.0 ; Hell No!! , Dont even go there yet!. till things stabalize.!!..



Quick and Dirty Apache 2.0.48 –SSL-mod_ssl

• Download compile mod_ssl source distribution from http://rab.members.easyspace.com/apache-ssl/apache-ssl-2.0.48-(openssl-0.9.7d).zip• Unzip it and place file in following manner
o openssl.exe, libeay32.dll, ssleay32.dll in /bin directory
o mod_ssl.so in /modules directory
o ssl.conf in /conf directory
o openssl.cnf in /bin directory (this one is only needed if you want to create test site certificate; if you are buying certificate from CA then you will not need this. )
• Open /conf httpd.conf file and add following
o LoadModule ssl_module modules/mod_ssl.so
(Sometimes it’s already present in httpd.conf, in that case just uncomment the line)
• Make sure following block is present in httpd.conf
o Include conf/ssl.conf

(This will load ssl.conf when mod_ssl module is loaded, above block is usually present in default httpd.conf)
• Open ssl.conf and make sure server paths are correct in the file, especially
o DocumentRoot
o Server name
o Server admin
• Go to /bin and execute following to create self-signed server certificate. Answer questions accordingly, “Common name” will be the site name e.g. www.myworld.com
o openssl.exe req -config openssl.cnf -new -nodes -out server.csr -keyout server.key
o openssl.exe x509 -in server.csr -out server.crt -req -signkey server.key -days 365 -set_serial 1
(Increment the serial number each time you create a certificate.)
• Move files "server.key" and "server.crt" to your apache2\conf folder. Delete files ".rnd" and "server.csr".
• Start Apache. Assuming it starts ok; test it with your preferred web browser.
• Point to https://localhost/myworld
• Now you are SSL enabled.

Quick and Dirty Apache 2.0.48 –Jk2-Tomcat 4.1.29X

• Install Tomcat, do not start tomcat
• Download compiled Jk2 Connector from Apache site which has jk2 dll/shm files also.
• Before installing Apache make sure system is not running any Web server on Port 80, like Microsoft IIS, if yes stop the web server and then Install Apache. Once Apache is installed it starts the web server on port 80
• Go and Stop Apache web server
• Go to /conf/jk2.properties
• Add following ; text in < shouldn’t be added>
o handler.list=channelSocket,request
o channelSocket.port=8009
o channelSocket.address=
• Go to /conf
• Open httpd.conf and add following
o LoadModule jk2_module tomcat-connector/mod_jk2-2.0.43.dll
(We will create tomcat-connector directory in next step)
• Create file called workers2.properties in /conf and following should be the content
o [shm:]
o file=C:\Program Files\Apache Group\Apache2\logs\jk2.shm
o size=1000000
o [channel.socket:localhost:8009]
o [uri:/examples/*]
o [uri:/myworld/*]
o [uri:/tomcat-docs/*]
• Copy jk2.shm to /logs directory
• Create tomcat-connector directory under and copy mod_jk2-2.0.43.dll file in there
• Start Tomcat first and then Apache
• Go to http://localhost/myworld , you should be able to get into your application without Application server port now.
• You are all set.

Jakarta Ant and Reflection Conflict: Power of FORK!!

Have you ever seen java.lang.NoClassDefFoundError: sun.reflect.SerializationConstructorAccessorImpl while running from your application via Ant target.???. ever wondered how come this error when you run an application, but never conflicted while compiling with current set of jar files??..
  You must have speculated reasons like
  •  Java version might be a problem , Hey jdk_14XX is not right lets switch to jdk_13..
  • May be my ant version is not rite or conflicting with jdk version.

The main reason is Ant and its Virtual machine. whenever we write (Compile task) or (Excecution task) we give control to Ant to determine and look for java in its own way,  Java is stringent in Non-Fork mode on classpaths. So in non-fork mode confusion raises for specific reflection classes above.


All you have to add  fork="true"  (some ppl do it "yes" option too..feel free to experiment:)), to your Ant and tasks,

From above tweak we say use another VM . which means it kicks in class execution in another VM.

tasks will look something like this

><javac srcdir="${src_dir}" fork="true" destdir="${deploy_dir}"><classpath refid="class.path"></javac><java classname="" fork="true"><classpath refid="class.path"></java>