Sunday Jun 15, 2008
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.
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
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