Thursday, November 22, 2012

Silent Installation of IBM Websphere Application Server 7

Before we start installation, there is this little subtlety that we need to address. If you execute the command “ls -al `which sh`” you will see that the /bin.sh is actually pointing to a binary called ‘dash’.
~# ls -al `which sh`
lrwxrwxrwx 1 root root 4 Jun  7 20:49 /bin/sh -> dash
We need to re-link the/bin/sh to /bin/bash as the default symbolic link of sh in Ubuntu is pointing to dash. There are numerous posts on the internet talked about this. Won’t worry about why it is so, just interested to install the IBM WAS. Fix the sh sym link issue.
cd /bin
unlink sh
ln -s /bin/bash sh
Installation Steps:
1) Go to directory containing WAS archive and then untar the IBM Websphere Application Server 7 archive using following commands:-
tar -xzvf was.cd.70011.trial.base.opt.linux.ia32.tar.gz
2)  we need to create a response file named “response.txt” for silent installation in directory in the WAS directory in the expanded installation archive.
vi response.txt
Add following entries in response.txt file.
-OPT silentInstallLicenseAcceptance=”true”
-OPT disableOSPrereqChecking=”true”
-OPT installType=”installNew”
-OPT profileType=”standAlone”
-OPT feature=”noFeature”
-OPT PROF_enableAdminSecurity=”true”
-OPT PROF_adminUserName=”wasadmin”
-OPT PROF_adminPassword=”password”
-OPT PROF_profileName=”appsvr01″
-OPT PROF_defaultPorts=”true”
-OPT installLocation=”/home/was_home”
-OPT traceLevel=”INFO”
-OPT allowNonRootSilentInstall=”true”
3) It is not necessary to pre-create the installation directory. As long as the installation process has the privilege to create the folder. Otherwise create a directory “was_home” in “/home/”
4) execute the install.sh  from “WAS” directory with the following arguments
./install -options response.txt -silent
5) Now You can start the default server ‘server1′ of our profile appsvr01.
cd /home/was_home/profiles/appsvr01/bin
./startServer.sh server1
The application server instance server1 is now started.
Before starting the server make sure no other instance of server is running.
6) To stop the server
cd /home/was_home/profiles/appsvr01/bin
./stopServer.sh server1
7) To check logs go to “was_home/profiles/appsvr01/logs/server1” location.

How to increase Websphere JVM memory size without using administrative console.

JVM memory size can be increased easily using Websphere administrative console. But if server gives “out of memory Error” error when we are trying to start the server, then we need to perform following steps :-
1)    Go to location “<WAS_Home>/profiles/appsvr01/config/cells/serverNode01Cell/nodes/serverNode01/servers/server1”.  Here WAS_Home is location where websphere application server is installed.
2)    Then look for server.xml file at above mentioned location.
3)    In server.xml file find “jvmEntries” xml element.
Change initialHeapSize=”512” and add maximumHeapSize=”1526” attribute.
initialHeapSize and maximumHeapSize attributes can be modified according to your system configuration.
Now you can save the file and try starting the server, you are all set to go.

Monday, November 19, 2012

Failed to connect to the DataSource in Websphere Application Server

 
I was trying to create a data source in websphere application server using administrative console and my db (mysql) was running on same server. But I was running into following exception when I hit the test connection button.
Normally this exception occurs when JAAS alias under J2C Authentication Data Entries is not set properly, however in this case I have set the Component managed authentication alias properly. But was still having following problem:-
Could not invoke an operation on object: WebSphere:name=DataSourceCfgHelper,process=server1,platform=dynamicproxy,node=ip123Node01,version=7.0.0.11,type=DataSourceCfgHelper,mbeanIdentifier=DataSourceCfgHelper,cell=ip123Node01Cell,spec=1.0 because of an mbean exception: java.sql.SQLException: java.lang.IllegalAccessError: com/mysql/jdbc/ConnectionImpl.getInstance(Ljava/lang/String;ILjava/util/Properties;Ljava/lang/String;Ljava/lang/String;)Lcom/mysql/jdbc/Connection;
[10/5/12 5:00:37:241 UTC] 00000013 DSConfigurati W DSRA0174W: Warning: GenericDataStoreHelper is being used.
[10/5/12 5:00:37:305 UTC] 00000013 DataSourceCon E DSRA8040I: Failed to connect to the DataSource. Encountered “”: java.lang.IllegalAccessError: com/mysql/jdbc/ConnectionImpl.getInstance(Ljava/lang/String;ILjava/util/Properties;Ljava/lang/String;Ljava/lang/String;)Lcom/mysql/jdbc/Connection;
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:334)
at com.mysql.jdbc.jdbc2.optional.MysqlDataSource.getConnection(MysqlDataSource.java:443)
at com.mysql.jdbc.jdbc2.optional.MysqlDataSource.getConnection(MysqlDataSource.java:141)
at com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource.getPooledConnection(MysqlConnectionPoolDataSource.java:83)
This problem was vanished after I restarted the Websphere Application Server.