Monday Oct 27, 2008
Monday Oct 27, 2008
I couldn't let this one pass... A laptop that would not boot is a real frustration. I had pushed the limits on my 3 year old laptop with 4 G. The memory modules I bought were too hot. The fan was always running at full speed. I should have noticed. Well, it went on for 2 years and probably did some collateral damage to my H/W. Occasionally I used to get the bluescreen of death. After swapping memory modules, I noticed that one of them was a suspect. I got it out, bend it, threw it on the wall and dumped it in my trash can.
When it had the damaged memory, booting in safe mode would make my system get stuck at Mup.sys. It would not go past it. There are several reasons on why Windows XP could get stuck at Mup.sys. There are several articles out there, which explains about Mup.sys failures. Here is a good one. In my case, I assumed that my registry was probably corrupted. My Googling showed that it has been a frustrating experience for so many people.
Here comes my savior, the System Resuce CD. System Rescue CD is a Live CD based on Linux. You can download it here. You should be able to boot your system from CD to make it work.. The instructions fade into eternity, if you type too many commands. You may want remember the following commands.
For mapping your dead C drive from Windows XP : ntfs-3g /dev/sda1 /mnt/windows
In this case- I found my SATA drive was mapped as sda1 under /dev.
For networking : net-setup eth0. I used dhcp for easy setup.
For starting ssh : /etc/init.d/sshd start - It helps in transferring files to another system. Root users are configured for access in ssh. You can change your root user password, and use the new password for accessing the C drive from the outside world using scp or winscp.
At this point, you should have retrieved all your files. Well do the next steps at your own risk. Your Windows XP may not return to its full form after this. You might be able to get some functionality back. I found this Microsoft site on how to restore a system with corrupted registry. I could not follow all of the instructions listed here. But I did the equivalent of the following MS DOS commands on my System running on Artificial Respiration (System Rescue CD). I was not having a Windows XP restore disk, and hence could not follow all of the instructions listed at the MS site.
md tmp
copy c:\windows\system32\config\system c:\windows\tmp\system.bak
copy c:\windows\system32\config\software c:\windows\tmp\software.bak
copy c:\windows\system32\config\sam c:\windows\tmp\sam.bak
copy c:\windows\system32\config\security c:\windows\tmp\security.bak
copy c:\windows\system32\config\default c:\windows\tmp\default.bak
delete c:\windows\system32\config\system
delete c:\windows\system32\config\software
delete c:\windows\system32\config\sam
delete c:\windows\system32\config\security
delete c:\windows\system32\config\default
copy c:\windows\repair\system c:\windows\system32\config\system
copy c:\windows\repair\software c:\windows\system32\config\software
copy c:\windows\repair\sam c:\windows\system32\config\sam
copy c:\windows\repair\security c:\windows\system32\config\security
copy c:\windows\repair\default c:\windows\system32\config\default
Voila! I was able to boot. I first booted my system in Safe Mode to see if I was having the same problem with Mup.sys. It got past that point. In my setup, it created an Administrator.<bogus> user. I then rebooted back in normal fashion. For all the hard work and googling and this blog... my recovered OS is not going to stay. I will be replacing it with Solaris 10 x86 5/08. Solaris does not have Mup.sys.. I am hoping that it was only the Memory that was damaged. About my memory stick. I pushed it under my trash can, below the waster papers and peanut shells, like spend uranium.. I am getting a new laptop. Of course with Windows XP !
Sunday Jun 15, 2008
I had such a hard time with my Laptop sound for last 5 months, I almost gave up. This is a Toshiba Tecra M5 notebook on Windows XP SP2. It has SigmaTel HD Audio onboard sound card. Opening up service tickets with the producer of my lifeline did not help. There were several problems in different avatars. In the beginning it was this Auto Installed 'Microsoft Kernal Audio *' devices which were creating the problems. It could be any one of MS Kernel Audio devices - Mixer, Echo Canceler or Synthesizer. From the middle of nowhere it would appear and sit under my Device Manager for Sounds with an uncertain Yellow Tag. It means that the MS device drivers were not auto installed properly. When the sound disappears, I would remove the drivers (good, bad and ugly ones!) for sound under 'Device Managers' and reinstall just the driver (latest from Toshiba support site) for SigmaTel. Everything would be hunky dory for a few days. Again, like a Virus one of these MS Kernel Audio * would appear from nowhere and sit under the Device Manager for Sound, with an Yellow Tag. After a tinkering for few more months, alas!, all my sound disappeared (except for the system sounds). I almost gave up at this point. No amount of Tinkering helped.
Then one day, one of the internet forums throwed some light. It suggested a way to show the hidden non present device drivers. To get to it, add a System Variable (not User Variable) 'devmgr_show_nonpresent_devices' and set its value to '1'. You can get to System Variables from 'System Properties' and 'Advanced' Tab. Make sure to select 'View > Show hidden devices' from Device Manager. That showed some of the hidden Sound devices under Device Manager. But how to spook them out. It would not go away after uninstalling the devices. I then remembered one of old tricks I did for Windows 98 and 2000. Run Windows in Safe Mode and remove the Device Drivers. In fact, I removed all of the Sound Devices while running Windows XP in safe mode. This included all of the Microsoft Kernel Audio devices as well. I then reinstalled the SigmaTel HD Audio driver and restarted Win XP. Wow, I can listen to all my MP3s now !. All of Microsoft Kernel Audio * device drivers got installed automatically without any problems. I saw a lot of emails out there with the same sound issue, hence I thought to blog about it.
Saturday Mar 01, 2008
After a some struggle, I was able to get my newly build system with Solaris 10 U4 to connect with outside world.
I am building a Solaris 10 x86 box with Gigabyte M790X-DS4 motherboard. When loading Solaris 10 x86 U4 (8/07), the network driver was not getting loaded. The motherboard specifications said that I had a Realtek 8111B chip (10/100/1000 Mbit) onboard LAN with 1 GB speed.
My googling showed that some solaris drivers may be available at Masayuki Murayama's site
I downloaded the driver file gani-2.4.4.tar.gz for Realtek rtl8169 rtl8110 rtl8168 rtl8101 PCI/PCI-Express GbE chipset. I then built the drivers from scratch using gcc. I used option GLD version 2 to build the network drivers.
The Readme instructions were very good. After building, testing, sys-unconfig operations and reboot, I was connected to my router. Thanks to Masayuki Murayama.
You may check /var/adm/messages file to see if the device is getting loaded properly. If loaded, it will show up as RTL8168/811B in the messages file.
You can check this just after you boot. You may also use ifconfig -a command to see if the NIC was getting plumbed. During Solaris 10 install, network configurations options will not show up, if network device is not getting loaded.
To my horror, I was also facing system freeze and desktop freezes. I increased the chasis fan speed using its stepper switch to make it go away. It must be the CPU / system board temperature. I may have to install an additional fan.
I just put together this blog, after I made it to work. Otherwise it will all disappear down my memory lane. When I get time, I will write about my adventures in building this box. BTW it has AMD Phenom.
Saturday Nov 24, 2007
This black friday I bought a 22" widescreen LCD monitor. It was a Samsung 2232GW. I connected it using the DVI cable which came with it, to my laptop bay. I was hoping to get a high resolution display without any headaches. Well, these days none of the electronics work that way.
My laptop was a Toshiba Tecra M5 with Windows XP professional.
My problem was that the display on the new Samsung widescreen LCD monitor wasn't going up above the resolution of 1280x1024. In the display settings drop down list, there were no options beyond 1280x1024. I tried reinstalling the Monitor drivers, and it didn't work. The samsung driver installation confuses you with multiple options, and it is not very helpful. I found that my laptop was using a Mobile Intel 945 Express chipset. I had also downloaded and reinstalled the latest display driver for from the intel site. Na, na, it wasn't still working. I wouldn't get any listing above 1280, and also display looked odd. After 1 hour of Googling, I hit a page which talked about upgrading the BIOS. My Tecra bios version was 1.3. You can locate the BIOS version without rebooting by navigating to Start >All Programs>Accessories>System Tools>System Information. The Toshiba site for Tecra M5, lists Version 3.3 of BIOS. Mine was version 1.3. I downloaded and installed it using the windows option. One has to be careful about the BIOS version and see that it matches the laptop part no for tecra m5. The site lists two versions of BIOS 3.3, one starting with a part no of PTM51U and the other with PTM50U. The part no. identification is located on the back of the laptop. After upgrading the BIOS and rebooting the laptop, I was able to configure the Samsung display correctly. I also found a few things like extended displays.
I could not find any documentation on how to configure this, and hence the this blog..
After using the big screen for a few days, I could not help adding this... With me moving into my mid forties and refusing to accept a pair of glasses, this might be the one little toy which can push out your plans to decorate your face. The 22" display with its high resolution, brightness and clarity makes reading fine print more easy. Letters stand out more larger and clearer.


Wednesday Nov 07, 2007
One may find it little difficult to load a properties file values into the dropdown list component of Sun Studio Creator 2 update 1. Here I have outlined the steps I have used to create it.
1. Check if the Component Library Manager contains the Property Resource Provider Library. This library provides components in Creator for reading Properties file. This library is very useful for localization. Here is an article on how it can be done. If you do not have the library in Creator, you can download it from here and import it into your Creator.

2. Make sure that dropdown list have been added to the web application page. The dropdown component will be known by its default name dropDown1 in the application code.
3. Make sure that a properties file exist with all key value pairs required for the lookup.
4. Right click on DropDown List and select 'Bind to data'. Under 'Data Provider to Bind to Dropdown1', make sure to select 'PropertyResourceProvider1'. 'Under Tab 'Bind to Data Provider', make sure a single valid key and single value field are selected from the left panes and right panes. Under 'Bind to Object' make sure PropertyResourceProvider1 is selected. Click Close.
5. Right Click on DropDown List and select 'Property Bindings', select 'PropertyResourceProvider1' as the Binding Target. Click Close.
6. Add the following code to dropdown list Page1 java source. The code will only work if the source and target setting for the project are changed from Java 1.4 to Java 1.5. This is due to the use of Generics ( found in Java 1.5). One will have to manually edit the project.properties under nbproject directory of this project and change java.source and java.target to a value of 1.5. Rebuilding project with clean option will remove this file. Reediting will be required. One will also have to add option '-source 1.5' to Project properties > Compiling > Additional compiler options. You will not be able to see 'Design Page' after making this change. Your project should however work from this point onwards when deployed.
Use the prerender method for loading the properties values
public void prerender() {
FieldKey [] fldkys = getPropertyResourceProvider1().getFieldKeys();
ArrayList<Option> options = new ArrayList();
for (int i = 0; i<fldkys.length; i++) {
String str1 = getPropertyResourceProvider1().getValue(fldkys[i]).toString();
System.out.println(" Field Key String "+str1);
options.add(new Option(fldkys[i].getDisplayName(), str1));
}
if(options.size() > 0){
Option[] optionsArray = new Option[options.size()];
optionsArray = options.toArray(optionsArray);
dropDown1.setItems(optionsArray);
}
}
Tuesday Nov 06, 2007
I thought of adding the following unix shell script I used to reduce Log file sizes to zero for Access Manager.
The input to the script is '/var/opt/SUNWam', if it is a standard install.
#!/bin/sh
clear
echo ""
indir=$1
echo "Input variable : "$1
echo ""
cd $indir/debug
for filename in *
do
if [ -f $filename ] ; then
cat /dev/null > $filename
echo "File size "$filename "made 0";
fi
done
cd $indir/debug/amadmincli
echo ""
echo "In amadmincli directory ..."
echo ""
for filename1 in *
do
if [ -f $filename1 ] ; then
cat /dev/null > $filename1
echo "File size "$filename1 "made 0";
fi
done
cd $indir/logs
echo ""
echo "In logs directory ..."
echo ""
for filename2 in *
do
if [ -f $filename2 ] ; then
cat /dev/null > $filename2
echo "File size "$filename2 "made 0";
fi
done
cd /opt/utils
Friday Jan 12, 2007
Hi,
Today I had a hard time getting a mashup portlet to work with Google MAPs API. The first issue was that the body tag with onload event handler would not work inside a portlet when using IE 6.0 browser. It worked fine for the Firefox 2.0 browser. For example if you were to stick in a code like the following inside the view.jsp, the onload event would not be called and the load function will not be activated.
It is because, the IE browser rejects a second body tag appearing inside the portlet, when parsing the portal desktop page. The portal desktop page made up of multiple portlets will have its own portlets container 'body' tag. It took me sometime to figure this out.
After fixing that , I ran into another problem where the IE browser would throw an "Operation aborted" error message. A timeout has to be added to the function call, so that function call was made after a set time period. This ensured that the portlet page was parsed before bringing in map content from Google. Following reference helped - http://mapki.com/wiki/FAQs#Browser_Problems. Again this wasn't a problem with the Firefox browser.
setTimeout('load()',500);
Thursday Jan 11, 2007
Thanks to the article by Vihang Pathak and Satya Ranjan on Portlets under Technical Articles of Sun Developer Network page. I thought, I will post my version of the above notes, which I had published internally.
Netbeans 5.5 has a Portlet Plugin, which can be tested within a Portlet Container running on an Appserver. Once you have a framework, it will be very easy for you to add java code into the portlet - be it for JCAPs or any other application, and test it locally before deploying it (war file) to the server. Sun Java Enterprise Studio also provide a Portlet creation and Portlet container facility.
1. Download and Install Netbeans 5.5 enviorment http://www.netbeans.info/downloads/index.php
2. Upgrade the installation with the Netbeans 5.5 enterprise pack. It has the BPEL, Webservices, SOA and other latest add-ons packs
Download location - http://www.netbeans.info/downloads/index.php?rs=11&p=6
3. We need to install a Portlet Container into an Appserver environment for deploying and testing the portlets from Netbeans. For that you will need the Java Application Platform SDK Update 2. This can be downloaded and installed from here. This is an Enterprise development environment for Java EE 5, Access Manager, JBI, and the portlet container. The Sun Application server 9 PE update 1 will also get installed with the installation of the pack. After running the installer, the kit gets installed under C:\Sun\SDK. The appserver gets installed here. Make sure to select the Portlet container during the installation.
Download location for Application Platform SDK- http://java.sun.com/javaee/downloads/index.jsp. You can get more information on Portlet containers - (Portlet 1.0 Beta) from this PAGE.
4. Next you need to add the Netbeans Portlet Plugin. For this, you will be updating Netbeans 5.5 manually. The '.nbm' files required for the manual upgrade is available from the zip files that can be downloaded from this location. Instruction for adding the plugin is shown HERE.
5. After installing the Netbeans Plugin, you will see the Portlet Container - "Open Source Portlet Container" showing up as additional server in the list of Servers in Netbeans. ( May need to restart to the IDE). After creating the portlet project, make sure to change the server to "Open Source Portlet Container" by right clicking Project Properties page and going down to the run option.
The following article will help you develop and run a Netbeans HelloWorldPortlet. http://java.sun.com/developer/technicalArticles/J2EE/sdk_nbportletplugin/
Thursday Sep 07, 2006
After a long search I came across this sample Java code for sending email into an SMTP server which required authentication and secure (TLS) connection. Hence I thought, I will re-publish it. I found this piece of code from Java developer forums.....I could not trace back the link... Thanks to good soul who published it. I thought of re-publishing it due its rarity.
I have used Java Mail 1.4.
------------------------------- Java code ---------------------------
import javax.mail.*;
import javax.mail.internet.*;
import java.util.*;
public class Main
{
String d_email = "ADDRESS@gmail.com",
d_password = "PASSWORD",
d_host = "smtp.gmail.com",
d_port = "465",
m_to = "EMAIL ADDRESS",
m_subject = "Testing",
m_text = "Hey, this is the testing email.";
public Main()
{
Properties props = new Properties();
props.put("mail.smtp.user", d_email);
props.put("mail.smtp.host", d_host);
props.put("mail.smtp.port", d_port);
props.put("mail.smtp.starttls.enable","true");
props.put("mail.smtp.auth", "true");
//props.put("mail.smtp.debug", "true");
props.put("mail.smtp.socketFactory.port", d_port);
props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.socketFactory.fallback", "false");
SecurityManager security = System.getSecurityManager();
try
{
Authenticator auth = new SMTPAuthenticator();
Session session = Session.getInstance(props, auth);
//session.setDebug(true);
MimeMessage msg = new MimeMessage(session);
msg.setText(m_text);
msg.setSubject(m_subject);
msg.setFrom(new InternetAddress(d_email));
msg.addRecipient(Message.RecipientType.TO, new InternetAddress(m_to));
Transport.send(msg);
}
catch (Exception mex)
{
mex.printStackTrace();
}
}
public static void main(String[] args)
{
Main blah = new Main();
}
private class SMTPAuthenticator extends javax.mail.Authenticator
{
public PasswordAuthentication getPasswordAuthentication()
{
return new PasswordAuthentication(d_email, d_password);
}
}
}
Thursday Aug 17, 2006
Normally ISO data files are used for burning Software into CD-ROM discs and then install it directly from the CD.
Without a CD-ROM burn facility, it is possible to extract the ISO files. I used the following procedures in Solaris 10 OS to install Java Enterprise System 2005Q4 (JES4) from its ISO files.
These procedures may be used for extracting any ISO files.
-------
#Create a temporary JES4 directory and copy over JES 4 ISO files.
mkdir /opt/jes4
cp
cp
# Create logical filesystem for first ISO file
lofiadm -a /opt/jes4/java_es_05Q4-ga-solaris-sparc-1.iso /dev/lofi/1
# Create a temporary mount point for first ISO file
mkdir /opt/jes4/jes4install1
# Mount logical filesystem into temporary mount point
mount -F hsfs /dev/lofi/1 /opt/jes4/jes4install1
# Check the exploded files
cd /opt/jes4/jes4install1
ls
# Make a directory to copy over exploded files from temporary mount
mkdir /opt/jes4/java_ent_sys_2005Q4
cd /opt/jes4/jes4install1
cp -R * /opt/jes4/java_ent_sys_2005Q4
# Create another logical file system for the second ISO file
lofiadm -a /opt/jes4/java_es_05Q4-ga-solaris-sparc-2.iso /dev/lofi/2
# Repeat above procedures for the second ISO file
mkdir /opt/jes4/jes4install2
mount -F hsfs /dev/lofi/2 /opt/jes4/jes4install2
cd /opt/jes4/jes4install2
cp -R * /opt/jes4/java_ent_sys_2005Q4
# delete logical file system and temporary mount directories.
lofiadm -d /dev/lofi/1
lofiadm -d /dev/lofi/2
rm -r /opt/jes4/jes4install1
rm -r /opt/jes4/jes4install2
# When mounting logical files, if you see messges like
"lofiadm: size of /opt/jes4/java_es_05Q4-ga-solaris-sparc-1.iso is not a multiple of 512", then ISO files are corrupt.
Monday Aug 14, 2006
Sun Java System Portal 7 community features uses derby database on its backend to store community features in Portal. One may use an opensource client like Squirrel SQL Client from your desktop to connect to the Derby database. My main intention here is to identify the connection variables required to connect to the database.
Client : Squirrel SQL Client v 2.3.
Download site : http://squirrel-sql.sourceforge.net/
Install using -- java -jar squirrel-sql-
Add jdbc derby driver to squirrel client lib directory.
Driver : derbyclient.jar
Load location : C:\Program Files\SQuirreL SQL\Client\lib\derbyclient.jar.
If the jdbc driver is correctly loaded, then 'Drivers' window should show a 'Tick' mark against Apache Derby Client.
Click on '+' sign on Alias window to create a new connection configuration.
Enter an alias name - 'Portal Derby'
The driver selected should show Apache Derby Client
URL : use the JDBC connection string
Database port : communitymc_portal1 (communitymc_portal1 is the database name)
Database port : 1527
User name : portal
Password : portal
click on Test to test connectivity.
On the top left corner, select Connect to 'Portal Derby' from drop down.
Tables should show up Portal Derby > Portal > Table