Saturday, October 6, 2012


//Connecting to DB2 database while reading properties from file
import java.beans.Statement;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileReader;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.*;


public class ConnectingDb {


//Establishing connection
Statement statement=null;
//Connection connection = getConnection();
public Connection  getConnection() throws ClassNotFoundException, SQLException
{
Properties prop = new Properties();
try{
prop.load(new FileInputStream("./conf/Db.properties"));
}
catch (Exception e){
}
Class.forName (prop.getProperty("DriverName"));
Connection  connection = DriverManager.getConnection(prop.getProperty("ConnectionURL"),prop.getProperty("Username"),prop.getProperty("Password"));
System. out .println( "From DAO, connection obtained " );
return connection;
//statement = connection.createStatement();
}

}




Tuesday, May 22, 2012

Connecting LoadRunner 11.0 Analysis to MS SQLServer 2008


Installing and configuring MSDE

Installing MS SQLServer 2008 Enterprise Edition
Make sure that below screens are followed while installing SQLServer 2008


Setting up MSDE database:
1. Reboot the machine after the install.
2. Share the data folder that is located in the MSDE installation folder (Example: C:\MSSQL2008\MSSQL10.MSSQLSERVER\MSSQL\DATA)
3. Launch the Analysis.
4. Go to Tool -> Options -> Database.
5. Select the "SQL server/MSDE" radio button and fill in the following information:


Server details
Server Name: Enter the machine name for the Server.
User Name: The default is sa. You can change this to a username/password that has Administrator privileges.
Password: There is no password by default. You can change this to a username/password that has Administrator privileges.
Use Windows Integrated Security: Select the check-box.


Shared Folder Details
Shared Folder Path: Enter the server name and shared folder name.
Example:
"\\PAC0223\Data\" where PAC0223 is a host name where the SQLServer is installed and "Data" is a folder under
C:\MSSQL2008\MSSQL10.MSSQLSERVER\MSSQL which is shared as per point 2 above.
Local Folder path: Enter the actual location of the "Data" folder mentioned in the above example.
Example: C:\MSSQL2008\MSSQL10.MSSQLSERVER\MSSQL\DATA

6. Click on "Test Parameters" and make sure that all the options have been selected without any error.
7. If you have problems connecting, select the "Use Windows Integrated Security" option and try again.

Issue with solution



Problem
While configuring LR Analysis to use MS SQL Server ( Tools > Options > Database ) the following error appears: : "Synchronizing shared and physical directoes" failed.

Cause

Incorrect path has been added to shared folder on MSQL Server

Fix
Physical path was missing at the end of share folder details
Example: C:\MSSQL\Data

Tuesday, September 6, 2011

LoadRunner

Quick Tip – Fixing A Locked LoadRunner Results Directory
Posted on March 9th 2011 by Joel Deutscher
Everynow and then, Vugen will have a little episode and decide that its default results directory is locked, and you will be presented with an friendly dialog box like the one below.
If you have ever wondered what is going on, it turns out the culprit is mmdrv.exe. This executable is the Multithreaded Driver Command Line application that is used to simulate virtual users, and killing all instances from the task manager will remove any locks on your results directory, and you can go back to normal vugenning.
While most of us don’t mind using multiple directories, it seems that even in Vugen 11, the replay log window will always show the log of the first results directory after playback. This can be very confusing when debugging scripts.
This exe can also be used manually to execute vuser scripts from the command line. This can be handy for environment smoke tests. I will write more about some alternate uses for mmdrv.exe in a later post

Friday, June 3, 2011

Eclipse

1. Eclipse workspace is not opening/ WorkSpace not opening/
First thing to try is "./eclipse -clean" for example @ eclipse-platform-3.4.1-win32\eclipse>eclipse -clean
Second option could be deleting “.snap” in the folder “org.eclipse.core.resources” at workspace\.metadata\.plugins\org.eclipse.core.resources\
The last and final solution is to remove ".metadata" folder from workspace. This has side effects you again need to set all the build paths and projects in the Preferences and build path of each project which could be tedious task.

DB2 Performance

Performance of Java Application

1. Issue and its resolution
ISSUE 1
Aug 19, 2013 3:14:36 PM org.apache.coyote.AbstractProtocol init
SEVERE: Failed to initialize end point associated with ProtocolHandler ["http-bio-8081"]
java.net.BindException: Address already in use <null>:8082    at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:406)
    at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:610)
    at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:429)
    at org.apache.coyote.http11.AbstractHttp11JsseProtocol.init(AbstractHttp11JsseProtocol.java:119)
    at org.apache.catalina.connector.Connector.initInternal(Connector.java:981)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:814)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:640)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:665)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
Caused by: java.net.BindException: Address already in use

Resolution:- Find the process running and then kill it. 
Command: ps -ef  | grep java or ps -ef  | grep tomcat
Sample out put: 
[root@XXXXXXXX ]# ps -ef|grep java

root 3429 1 0 Aug16 ? 00:11:06 /opt/jdk1.7/jdk1.7.0_25/bin/java -Djava.util.logging.config.file=/opt/tomcat-instance3/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/opt/apache-tomcat-7.0.42/endorsed -classpath /opt/apache-tomcat-7.0.42/bin/bootstrap.jar:/opt/apache-tomcat-7.0.42/bin/tomcat-juli.jar -Dcatalina.base=/opt/tomcat-instance3 -Dcatalina.home=/opt/apache-tomcat-7.0.42 -Djava.io.tmpdir=/opt/tomcat-instance3/temp org.apache.catalina.startup.Bootstrap start
root 3462 1 0 Aug16 ? 00:10:56 /opt/jdk1.7/jdk1.7.0_25/bin/java -Djava.util.logging.config.file=/opt/tomcat-instance4/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/opt/apache-tomcat-7.0.42/endorsed -classpath /opt/apache-tomcat-7.0.42/bin/bootstrap.jar:/opt/apache-tomcat-7.0.42/bin/tomcat-juli.jar -Dcatalina.base=/opt/tomcat-instance4 -Dcatalina.home=/opt/apache-tomcat-7.0.42 -Djava.io.tmpdir=/opt/tomcat-instance4/temp org.apache.catalina.startup.Bootstrap start
root 18158 1 1 15:14 pts/1 00:00:08 /opt/jdk1.7/jdk1.7.0_25/bin/java -Djava.util.logging.config.file=/opt/tomcat-instance1/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/opt/apache-tomcat-7.0.42/endorsed -classpath /opt/apache-tomcat-7.0.42/bin/bootstrap.jar:/opt/apache-tomcat-7.0.42/bin/tomcat-juli.jar -Dcatalina.base=/opt/tomcat-instance1 -Dcatalina.home=/opt/apache-tomcat-7.0.42 -Djava.io.tmpdir=/opt/tomcat-instance1/temp org.apache.catalina.startup.Bootstrap start
root 19470 1 28 15:23 pts/1 00:00:09 /opt/jdk1.7/jdk1.7.0_25/bin/java -Djava.util.logging.config.file=/opt/tomcat-instance2/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/opt/apache-tomcat-7.0.42/endorsed -classpath /opt/apache-tomcat-7.0.42/bin/bootstrap.jar:/opt/apache-tomcat-7.0.42/bin/tomcat-juli.jar -Dcatalina.base=/opt/tomcat-instance2 -Dcatalina.home=/opt/apache-tomcat-7.0.42 -Djava.io.tmpdir=/opt/tomcat-instance2/temp org.apache.catalina.startup.Bootstrap start
root 19524 7328 0 15:24 pts/1 00:00:00 grep java



Identify the process which is giving the above error Kill the process using it's PID
[root@blrpslliqperf1 jrconf]# kill -9 3429
 
Note:- I have 4 tomcats running and I am trying to kill the one which gave me bind error.

WebSphere 7.0.0.7/7.0.0.13

1. SystemOutLogs--- we can configure the log file size because it over writes the files at log location, to change conf go to Troubleshooting>>Logs and trace>>"Server">>JVM Log



2. Multi-JVM/Clustering-- The number of servers in the cluster = the numberof JVMs, unless you are using Z/OS. Sometime we use the term multi JVM for Clustering which is confusing.




3. Clustering is of two types.



a. Horizontal Clustering:-where we need seperate machines for each server/node in the clustering environment.



b. Verticle Clustering:- where in the same machine multiple servers/nodes are present, we don't need seperate machines. In websphere this can be done by having different profiles and in JBoss it can be achieved by making unique ports(RMIPort,RMIObjectPort,ServerBindPort,JBoss/Tomcat Http ports,ServerBindPort,WebService,Naming Port) in jboss-service.xml accross the cluster environment.



Note:- The advantage of Multiple JVM is applicable in both horizontal as well as Vertical clustering.


Note:- What is the meaning of 3 nodes 5 JVM? This is 3 machines in which 2 servers have 2 profiles each running in two seperate machine and 1 server with 1 profile running in the third machine, by this I have 5 servers running in 5 JVM and its 3 node 5 JVMs.