Posts

Showing posts from 2012

Configuring static resources for use within the application in JBoss AS 7

In previous versions of JBoss, you could link an external directory into the classpath and load static resources like images/CSS/JS into the application using the WEB-INF/context.xml <Context allowLinking="true" cookies="true" crossContext="true" override="true">  <Resources allowLinking="true" homeDir="/mydomain/staticfiles" />  </Context> In Weblogic servers, there is the virtual-directory-mapping to achieve this. In Jboss 7 this no longer works, and you need to bundle the static files within the EAR or War. Note: If you need to serve these over the browser like a public web server as static files then you need a servlet method like this http://balusc.blogspot.com/2007/04/imageservlet.html But if you want to load a static property file or other content into your webapp, the solution provided by Jboss is what this post is about. You can define a “module” within JBOSS_HOME and store the files...

A Brief Encounter with Cyanogenmod 9 on the HTC Wildfire

I’ve been using CyanogenMod 7.2 quite happily since the last few months on Wildfire A3333. I recently tried to connect the stock Email application to a Microsoft Exchange 2010 server for my corporate Email. When setting up the mailbox and accepting all SSL certificates and seting up a Password/PIN I still get the error "This server requires security features your phone does not have" This primarily seems to be because Android 2.x does not have this flavour of encryption – “full Storage card encryption” This has been provided in Android 3.0 and in ICS 4.0 onwards for handsets The relevant documentation is at http://code.google.com/p/cyanogenmod/issues/detail?id=3172 So I decided to upgrade to CM 9 for Wildfire and see where it takes me. First and most importantly – do a Nandroid back up of the existing ROM and settings. You’ll revert to the backup many times. Also export phone contacts to a file which you will need to re-import later. The version of CM 9 I...

Solution for Win XP 0xc0000218 {Registry File Failure} The registry cannot load the hive

Image
So my 9 year old Dell Inspiron 510m laptop running Windows XP Service Pack 2 crashed last week with a Blue Screen of Death (BSOD) message. Stop: 0xc0000218 {Registry File Failure} The registry cannot load the hive (file): \SystemRoot\System32\Config\ System or its log or alternate. It is corrupt, absent, or not writable. Rebooting in safe mode doesn’t work. Rebooting after running Full Diagnostics doesn’t work, the laptop is always stuck with this failure. The Microsoft link http://support.microsoft.com/kb/822705 is a good starting point but I tried many things to finally get it working, so actually this article is also a Solution (rather a Workaround) for the following other errors that you may face: Windows XP not accepting the Administrator password in Recovery Console Windows XP Setup stuck at License Agreement – F8 key not working So the sequence of events, trials and failures are as follows – these may help you in the future.   Trial 1: ...

How to check if HTC Wildfire is rooted

I noticed some posts asking to know if HTC A3333 is already rooted. 2 easy ways: 1. Presence of the Superuser app Superuser comes pre-installed on any rooted ROM. In fact, without it, you don’t have a rooted device at all. You cannot uninstall it, it lives on the system partition with other apps that came pre-installed on your device. 2. Open the Terminal Emulator and type "su" This will request for root access IF you are rooted Another option is to download Root Checker from the market it will tell you if you have root

Identifying memory leaks using Eclipse MAT - Part 3

Image
Part 1 and 2 recounted how we found a memory leak using Eclipse MAT So back to finding out what this class weblogic.xml.query.xdbc.Context   was and how we could solve the memory leak. A quick search in Eclipse showed this class gets loaded from com.bea.core.xquery_1.3.0.0.jar and the Eclipse calling trace showed a call to org.apache.xmlbeans.impl.store.XqrlImpl$CompiledQuery .   We knew we are using apache xmlbeans in our application and checked our Weblogic start classpath to see this jar had been added to the classpath since we had some runtime issues without it.   / wls_domains/com.bea.core.xquery.xmlbeans-interop_1.3.0.0.jar:/wls_domains/com.bea.core.xquery_1.3.0.0.jar   But we did not want to use the weblogic version of xmlbeans, so only tried with the Apache one instead. So the changes made were to remove the above jars from start classpath and add saxon jars instead. We also edited weblogic-applic...

Identifying memory leaks using Eclipse MAT - Part 2

Image
As I wrote in Part 1 , we identified that there was some sort of memory leak happening within our Java JEE application – so the next steps were to obtain a Heap Dump and run it through Eclipse MAT. So what is a Heap Dump? From the Eclipse docs A heap dump is a snapshot of the memory of a Java process at a certain point of time. There are different formats for persisting this data, and depending on the format it may contain different pieces of information, but in general the snapshot contains information about the java objects and classes in the heap at the moment the snapshot was triggered. The Memory Analyzer is able to work with HPROF binary heap dumps, IBM system dumps (after preprocessing them), and IBM portable heap dumps (PHD) from a variety of platforms. Typical information which can be found in heap dumps (once more - depending on the heap dump type) is: All Objects Class, fields, primitive values and references All Classes Classloader, name, super class...

JVM Heap analysis – Identifying memory leaks using Eclipse MAT

Image
As part of the regular pre-Production testing it is common to conduct Performance tests for load under Peak and Soak conditions. So we had this Weblogic platform on which all Peak tests were good and so also were the 12 hour Soak tests. The JVM memory usage graph plotted showed regular GC clearing up memory and no obvious leaks. A simple graph plotted in Excel showing JVM Used Heap over time is shown below. It shows the pattern fairly close to an ideal sawtooth. An additional test planned was an Extended Soak – mainly letting the system run as per expected normal volumes over 7 or 10 days to see if the JVM would throw up any unusual memory usage patterns or memory leaks. And we came across some interesting issues !! We did not have much of a problem for the first 24 and 48 hours – but after 48 hours (2 whole days) of continuous load, the graph showed that the JVM was unable to clear up any memory even after GC. As the graphs above show the Weblogic server...

Installing multiple external jars into a local maven repository.

Suppose you have a variety of dependency jars you need to install into your local repository - Note: These arent artefacts produced by your build but external jars. Well, no shortcuts here. From a recent reply I gave on Stackoverflow - You'll have to do it via a script, the long and boring way. This is what we use - modifying the values in each of the `set` statements set GROUP_ID=someNamespace set ARTIFACT_ID=myartifact set VERSION=1 set COMPONENT=%ARTIFACT_ID%-%VERSION% set FILEPATH=D:\my.jar call mvn install:install-file ^ -DgroupId=%GROUP_ID% ^ -DartifactId=%ARTIFACT_ID% ^ -Dversion=%VERSION% ^ -Dfile=%FILEPATH% ^ -Dpackaging=jar ^ -DgeneratePom=true set GROUP_ID=someNamespace2 set ARTIFACT_ID=myartifact2 set VERSION=1 set COMPONENT=%ARTIFACT_ID%-%VERSION% set FILEPATH=D:\my2.jar call mvn install:install-file ^ -DgroupId=%GROUP_ID% ^ -DartifactId=%ARTIFACT_ID% ^ ...

Rooting HTC Wildfire and installing Cyanogenmod

Image
There are many guides out there, this is a diary of events and some errors you might run into and resolutions which worked for me. Phone Model HTC Wildfire A3333 running on Android 2.2.1 (Froyo) Began with HBOOT 1.01.0002 Note: To find your HBOOT version - Switch the phone off, then hold the volume down button and while holding press the power button. At the top of the screen it will show the HBOOT version. To exit this screen, press the power button to select fastboot and then use the volume down to select reboot. The One-click guide given at http://www.brighthub.com/mobile/htc/articles/100819.aspx did not work initially. It ran successfully up to step 11 out of 11, when running Revolutionary it gets to a screen on the tool with the message stuck at " Waiting for device " So I had to do this the older way downgrading to HBOOT 1.01.0001 followed by switching the phone to S-OFF mode The complete guide which works for me is this one http://www.aritrasen.com/20...

Weblogic - Accessing Server Runtime details using JMX

We had a requirement to access certain runtime info on the Weblogic server to carry out some admin tasks. One way to do this is via the JMX API, which in Weblogic is available as an extensive set of MBeans There are plenty of tutorials and examples of using these on the net. Now within your Weblogic domain, if you run as part of a Cluster then you would access Domain information on the Admin server if you need to identify the running servers in the cluster. This uses weblogic.management.mbeanservers.domainruntime.DomainRuntimeServiceMBean object which is bound only on the Admin server . One full example of this is at http://middlewaremagic.com/weblogic/?p=210 If you try this on a managed server directly, you will get this error java.io.IOException: Unable to resolve 'weblogic.management.mbeanservers.domainruntime'. Resolved 'weblogic.management.mbeanservers' at weblogic.management.remote.common.ClientProviderBase.makeConnection(ClientProviderBas...