Tuesday, March 12, 2013

JBoss startup time with Spring and Struts

After migrating to JBoss 6.1.0, Spring 3.0.6 (were are using Struts 2) our application server started slowing down on strut-up. Before the migration if I am correct it used to take about around less then a minute and after migration it was taking around 3 mins.
 Recently I got new lappy at work, with new configuration the boot up was good but not so good, now it took me around 1min 30secs to boot.
 To know the startup issue, I profile the jvm with jvisualvm and profile data showed that time was taken by spring to initialize itself. Then to make things to initialize lazily, changed the xml configuration of spring and set default-lazy-init to true for every "beans" tag.
 Now I started JBOSS expecting it to start in secs, but then it again had the same story, it took same amount of time. Then again I profiled the jvm and saw there was no difference, then to trace down I noticed that even if beans were marked as lazy there were being initialized by struts by method
 com.opensymphony.xwork2.spring.SpringObjectFactory.getClassInstance(String) [This is found in xwork jar we have 2.0.4 version]

By looking at the method it suppose to get the class instance only and not create bean, but the code does have a call like below

clazz = appContext.getBean(className).getClass();

The above code is actual culprit, to get class instance the call is creating bean and then getting the class, the code should have been as

clazz = appContext.getType(className);

As our is web application I create a copy of this class with same package name and placed it in our WEB-INF\Classes dir (as this would be first to get loaded and then *.jar) this made sure that our customized class (SpringObjectFactory) would be loaded first by jboss server and not SpringObjectFactory from xwork.jar (other way's we can do is add agents to manipulate the class method using BCEL or Javassist)

After this changes, I started JBOSS, now it takes me about 37 to 39 secs too boot (still slow but its ok for now).
Wanted to give a patch for above fix in SpringObjectFactory, but found that xwork site is in RIP state, and I could not find any other version system to give above fix.

Saturday, February 16, 2013

OpenJDK 8 Build Ubuntu

Just done with OpenJDK 8 Build Ubuntu, it was easiest of all builds then done on Windows system. Had to run "configure" and it gave all the required commands to install required software for build....

Friday, February 15, 2013

Exporting and Importing Oracle Dump into XE

Today I was struggrlnig with exporting and importing Oracle dump into Oracle XE, at the end the site which came handy was stackoverflow-howto-import-an-oracle-dump-in-an-different-tablespace

Thursday, January 31, 2013

Daily activities Day 1 ;)

Will try to post my daily activities technically, as it would brush up things for me once I revist what I had done and it would give me to rethink on furture of wat I should do...

So as of now I was goin through parrallel classloading, acutaly was goin through openJDK 8 mail list and saw its being drop-off from Jdk 8.

6.37 Am
Parallel classloading

8:42 Am
A nice blog Now vs. 5 Years ago

NPE issue (my stupidity)
Was working on something and when I deployed the changes and started jboss it was ending up in NPE, I had this code change made as below


Properties props = new Properties();
props.put("mail.smtp.auth", "true");
System.setProperties(props); // this is the bug....we are overriding every thing :(


And when I was starting jboss, jboss server was ending up with NPE and was not able to user.dir.

Sum of two or more independent count querries

I got a situation where I needed sum of two independent table counts, had too search and got a querry as below.


Select count1 + count2 as total from
(Select count(*) as count1 from TABLE1 an where ....),
(Select count(*) as count2 from TABLE2 atf where ....)

Monday, June 4, 2012

my current interests/readings/pending-items

I got interested in knowing assembly, so I have started reading "Assembly Language Step By Step: Programming With Linux by Jeff Duntemann".

Its too good book and as I never done assemblly this book gave me the path to go unknown world (which I should have been mastered by now, but at-least I have started on it now) and I have written my first "Hello World!" programming that prints "Hello World!" for 10 times :) ya sounds simple...but for me its a great step :)

I started looking into openJDK last year some where around Jan-11, but I am not able to give time for it and I am still struggling with debugging the code and still getting to know the code flows, its like I am still a kid wondering in the forest, I hope I will reach top of the mountain in that forest.

I got so much to learn which are pending :(.....,like still need to be good in algo's, concurrency, Lambda's in java (1.8), NIO (this I never touched, not even theory of it), NLP (using java and phyton).

I hope I will be mastering this all...one day....but ya soon...

Sunday, April 15, 2012

New build system of openJDK (jdk8 master forest) rocks!

Just tried with new build system in OpenJDK (jdk8 master forest) on Windows, now there is no pain as it was with the old build. Just start the build and relax....

If any one interested to try out just check this link "http://openjdk.java.net/projects/build-infra/guide.html"

PS: if you end up with "Defs-utils.gmk: No such file or directory", just go and create a dummy file named "Defs-utils.gmk" in "jdk/makefiles/common/shared"