Open the file using the JD-GUI utility
http://java.decompiler.free.fr/?q=jdgui
Click on a particular .class file , after this go to the menu option
Navigate -> Go to Line option
If this option is not grayed out then that particular jar file has the debug info included.
To find the line info you can also use the following
javap -l SearchJars
This will display LineNumberTable
LineNumberTable:
line 13: 0
line 14: 16
line 15: 27
If this comes up then that means the debugging info is included in to the class file.
Search This Blog
Friday, December 04, 2009
How do you find whether a Java file is compiled with the debugging info or not
Wednesday, November 11, 2009
Windows Mobile Programming Tips
How to start the Windows Mobile Emulators from the command line.
"C:\Program Files\Microsoft Device Emulator\1.0\DeviceEmulator.exe" "C:\Program Files\Windows Mobile 6 SDK\PocketPC\Deviceemulation\0409\PPC_USA.BIN" /memsize 128 /s "d:\EmulatorState_prof.dess"
"C:\Program Files\Microsoft Device Emulator\1.0\DeviceEmulator.exe" "C:\Program Files\Windows Mobile 6 SDK\Smartphone\Deviceemulation\0409\SP_USA_GSM_QVGA_LS_VR.bin" /memsize 128 /s "d:\EmulatorState_std.dess"
Monday, November 02, 2009
How to use the same server session with the Terminal Server's
1. First try to run the command mstsc /v:fmwbde
(If you are lucky you will be connected to the same session)
2. If you are not able to connect to the same session then run the command mstsc /v:fmwbde /admin
This will connect to the admin server console.
3. Open the terminal service manager and select a particulr session and try to connect to this session.
Monday, October 05, 2009
Deployment Management Links are not working On Weblogic 10. 3.1.0
When trying to access the Deployment Management Links Export and Import are not working with the Weblogic 10.3.1.0 version. This fails with the following error
Either Your Session timed out or you are trying to access a page without logging in.
How ever this works fine on WebLogic 10.3.0.0 version.
There is some change in the functionality due to cross-site scripting vulnerability reasons. Please refer to the Note 866405.1 Applet/Javascript does not have access to JSESSIONID (httponly) cookie for more details on this.
For the Deployment Management Links to work you need to edit the file
C:\oim_server\xellerate\OIMApplications\WLXellerateFull.ear\xlWebApp.war\WEB-INF\weblogic.xml
and add the following entries
<session-descriptor>
<cookie-http-only>false</cookie-http-only>
</session-descriptor>
After the changes the weblogic.xml should look like this ,
<?xml version='1.0' encoding='UTF-8'?>
<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-web-app http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd">
<security-role-assignment>
<role-name>User</role-name>
<principal-name>User</principal-name>
</security-role-assignment>
<jsp-descriptor>
<encoding>UTF-8</encoding>
</jsp-descriptor>
<container-descriptor>
<filter-dispatched-requests-enabled>false</filter-dispatched-requests-enabled>
</container-descriptor>
<session-descriptor>
<cookie-http-only>false</cookie-http-only>
</session-descriptor>
</weblogic-web-app>
Restart the weblogic server after the above changes.
Friday, September 04, 2009
Friday, August 14, 2009
Sorting the files on the drive (USB Drive)
Sony music system in my car reads files in the order they are stored on the flash drive , which is very stupid in my opinion. Ideally it
should read the file in some alphabetical order or based on the last modified date. I found a program call DriveSort which reorganizes the files on a drive so they are in alphabetical order.
Download this program from the location http://www.anerty.net/software/file/DriveSort.php
and open the drive. After this sort the files and save the directory.
Please also refer to this URL for more details on this
Monday, July 27, 2009
Vncviewer clipboard operations like copy/cut+paste suddenly stops on linux
Many times you must have observed that clipboard operations like copy/cut and paste suddenly stops workings with the vncviewer. The main reason for this there is a program called as vncconfig responsible for these clipboard transfers. Some times the program may get closed because of some bug in vnc or some other reasons like you closed that window.
To get those clipboard operations back you need to run the program "vncconfig &".
After this your clipboard actions should work fine with out any problems.
Friday, July 24, 2009
Set up environment for linux to install Oracle Software
// Change sysctl.conf file to add the kernel parmeters
cat >> /etc/sysctl.conf << EOF
#This sets SEMMSL, SEMMNS, SEMOPM, SEMMNI
kernel.sem = 256 32000 100 142
kernel.shmmax = 4294967295
kernel.shmmni = 4096
kernel.shmall = 2097152
kernel.msgmnb = 65535
kernel.msgmni = 2878
fs.file-max = 206173
EOF
// Persist the sysctl.conf entries
sysctl –p
// Change the ulimit values
cat >> /etc/security/limits.conf << EOF
# Oracle Application Server settings
* soft nofile 2048
* hard nofile 65536
* soft nproc 2047
* hard nproc 16384
EOF
cat >> /etc/pam.d/login << EOF
session required /lib/security/pam_limits.so
EOF
cat >> /etc/profile << EOF
ulimit -u 16384 -n 65536
EOF
#### Oracle requirements for 11gR2 database ########
kernel.sem = 256 32000 100 142
kernel.shmmax = 4294967295
kernel.shmmni = 4096
kernel.shmall = 2097152
kernel.msgmnb = 65535
kernel.msgmni = 2878
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default=4194304
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048576
fs.aio-max-nr = 1048576
RPMs needed for 11gR2 Database
libaio-devel-0.3.106-3.2.i386.rpm
sysstat-7.0.2-3.SEL5_2.i386.rpm
unixODBC-devel-2.2.11-7.1.i386.rpm
local copy at \\disco1bdeapac\home\oracle\softwares\RPM112DB (oracle/oracle) windows browseable
Saturday, July 18, 2009
How to Use Jmeter to do the LDAP/OID Load Testing
How to use Jmeter to load test Portal Application
1. Download the latest Jmeter version from http://jakarta.apache.org/jmeter/
2. Set the JDK 1.5 or JDK 1.6 in your path and run jmeter.bat batch file
3. Create a Thread Group with the following values
Set the number of Threads to 50 and the Loop Count to 10. This will send 500 requests to the server
4. Under the ThreadGroup create HTTP Cookie Manager with the following values
The CookieManager is required to pass the cookie values across the different page requests. Otherwise Jmeter ignores the cookie value.
In the cookie manager select the Check Bog Clear Cookies each iteration and set the Cookie Policy to Default.
5. Under the Thread group create a Loop Controller
Right Click on the Thread Group and Add Logical Controller –> Loop Controller
6. Under the Loop Controller Add Sampler –> HTTP Request HTTP Client
Set the Server Name as say xxx.xxx.oracle.com and Port as 7784 enter the Path as /portal/page?_pageid=33,1&_dad=portal&_schema=PORTAL&_mode=16 Select the CheckBox “Follow Redirects”
7. Under HTTP Request HTTP Client add the HTTP Authorization Manager
Add the Portal username and password in this example I used orcladmin and welcome1.
8. Add another Portal Page for testing
Under the Loop Controller Add Sampler –> HTTP Request HTTP Client
9. Add another SSO Protected Page for testing
Under the Loop Controller Add Sampler –> HTTP Request HTTP Client
Use the following values shown below
10. This is how the JMeter project looks like after doing the above steps
11. Now run the Jmeter project by Pressing Control+R or the Menu option Control+R
12. Check the access_log file for the requests from the Jmeter load test
Wednesday, June 10, 2009
SSH Setup for RAC
On the incq128ad machine(linux#1)
mkdir -p ~/.ssh
chmod 700 ~/.ssh
/usr/bin/ssh-keygen -t rsa
/usr/bin/ssh-keygen -t dsa
touch ~/.ssh/authorized_keys
On the ipbde machine(linux#2)
mkdir -p ~/.ssh
chmod 700 ~/.ssh
/usr/bin/ssh-keygen -t rsa
/usr/bin/ssh-keygen -t dsa
touch ~/.ssh/authorized_keys
On the incq128ad machine(linux#1)
ssh incq128ad cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh incq128ad cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
ssh ipbde cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh ipbde cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
scp ~/.ssh/authorized_keys ipbde:.ssh/authorized_keys
On the incq128ad machine(linux#1)
cd $HOME
chmod 755 .
chmod 700 .ssh
cd $HOME/.ssh
chmod 600 authorized_keys
On the ipbde machine(linux#2)
cd $HOME
chmod 755 .
chmod 700 .ssh
cd $HOME/.ssh
chmod 600 authorized_keys
On both the machines run the following
ssh incq128ad hostname
ssh ipbde hostname
Wednesday, May 13, 2009
How to read a SSO protected page
You can use wget to get the SSO protected page using the following command
wget --debug --http-user=oc4jadmin --http-password=welcome1 -O dd.txt http://xxx.xxx.oracle.com:7777/private/dd.txt"
You can use the following code to get the SSO protected page. Download the following jar files
commons-logging.jar , httpcore-4.0.jar , commons-codec-1.3.jar , httpclient-4.0-beta2.jar and
httpmime-4.0-beta2.jar
Run the java program with the following options
d:\jdev10gmin\jdk\bin\javaw.exe -client -classpath D:\jdev10gmin\jdev\mywork\Testing\HTTPClient\classes;E:\ias10134\webservices\lib\commons-logging.jar;D:\httpcomponents-core-4.0\lib\httpcore-4.0.jar;D:\commons-codec-1.3\commons-codec-1.3.jar;D:\httpcomponents-client-4.0-beta2\lib\httpclient-4.0-beta2.jar;D:\httpcomponents-client-4.0-beta2\lib\httpmime-4.0-beta2.jar httpclient.ClientAuthentication1
package httpclient;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.List;
import org.apache.http.Header;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.cookie.Cookie;
import org.apache.http.impl.client.DefaultHttpClient;
/**
* A simple example that uses HttpClient to execute an HTTP request against
* a target site that requires user authentication.
*/
public class ClientAuthentication1 {
public static void main(String[] args) throws Exception {
DefaultHttpClient httpclient = new DefaultHttpClient();
httpclient.getCredentialsProvider().setCredentials(
new AuthScope("xxx.xxx.oracle.com", 7777),
new UsernamePasswordCredentials("orcladmin", "welcome1"));
HttpGet httpget = new HttpGet("http://xxx.xxx.oracle.com:7777/private/dd.txt");
System.out.println("executing request \n" + httpget.getRequestLine());
HttpResponse response = httpclient.execute(httpget);
HttpEntity entity = response.getEntity();
List<Cookie> cookies = httpclient.getCookieStore().getCookies();
if (cookies.isEmpty()) {
System.out.println("None");
} else {
for (int i = 0; i < cookies.size(); i++) {
System.out.println("- " + cookies.get(i).toString());
}
}
System.out.println("----------------------------------------");
System.out.println(response.getStatusLine());
InputStream in = entity.getContent();
InputStreamReader inputstreamreader =
new InputStreamReader(in);
BufferedReader bufferedreader =
new BufferedReader(inputstreamreader);
System.out.println("--------- URL Contents -----------------");
String line;
while ((line = bufferedreader.readLine())
!= null) {
System.out.println(line);
}
bufferedreader.close();
inputstreamreader.close();
in.close();
System.out.println("----------------------------------------");
if (entity != null) {
System.out.println("Response content length: " + entity.getContentLength());
}
if (entity != null) {
entity.consumeContent();
}
// When HttpClient instance is no longer needed,
// shut down the connection manager to ensure
// immediate deallocation of all system resources
httpclient.getConnectionManager().shutdown();
}
}
Monday, April 13, 2009
How to move the domains across the machines in WebLogic
I have a domain with the name test_domain on my Windows machine , here I have one managed server with some applications deployed.
I would like to move this domain from this machine to the other machine.
On Windows machine use the command pack.cmd to create the domain template
pack.cmd -domain=E:\bea\user_projects\domains\test_domain -template=C:\bea\user_templates\test_domain.jar -template_name="My WebLogic Test Domain"
Now move the test_domain.jar to the linux machine.
On the linux machine run the unpack.sh command to create the domain
unpack.sh -template=/home/ias/test_domain.jar -domain=/home/ias/bea/user_projects/domains/test_domain
After this go to the directory and run the command ,
cd /home/ias/bea/user_projects/domains/test_domain/bin
startWebLogic.sh
startManagedWebLogic.sh test http://localhost:7001
How to print the folder list that are available on a USB Drive
I am using the Sony MP3 player that can play from a USB drive, I have a difficulty in printing the folder list that are sorted on a last modifed date. This is how I generated the list
1. Use the program filelist ,
Download this from http://www.jam-software.com/filelist/filelist_readme_en.txt
2. filelist g:\ > dd.txt
3. type dd.txt | cut --delimiter=, --fields=2 > dd1.txt
4. After this generate the line numbers
type dd1.txt | uniq | nl > dd2.txt
3. Remove the characters like g:\ and “ etc
5. Now open the file in Excel or Word and Print the file
Monday, April 06, 2009
Wednesday, March 25, 2009
My OWSM Notes
1. The login username password is : admin/oracle
The URL is http://localhost:7779/ccore/
UN/PW : admin/oracle
2. The log file's you can find under the directory
E:\soa\j2ee\oc4j_soa\log
The important log file is "ccore.log"
3. For the OWSM Log levels check the note
Note 726219.1 How To Change Log Level for Oracle Web Services Manager (OWSM) ?
4. How to install OWSM on Windows/Unix
First run the irca.bat or irca.sh on the existing database
E:\10.1.3.1.0\install\soa_schemas\irca
For the upgrade you need to run upgrade_10131_10134_oracle.sql in the orabpel schema
and run the script upgrade_10133_10134_oracle.sql in oraesb schema.
Thursday, March 19, 2009
Printing Problems from IE7
I was having the small font problem printing from in IE7
Please see KB article http://support.microsoft.com/kb/932538/en-us
Scroll down to the section "More Information" edit registry as specified. But you manually have to add the key. It worked for me without installing any hotfix.
Or;
Copy paste and save the following text to a .reg file and run it.
---
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_STF_Scale_Min]
"iexplore.exe"=dword:00000064
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_STF_Scale_Min]
"outlook.exe"=dword:00000064
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_STF_Scale_Min]
"WinMail.exe"=dword:00000064
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_STF_Scale_Min]
"Msimn.exe"=dword:00000064
Wednesday, March 11, 2009
How to Configure network card (Nvidia Palit MB ) on Linux
1. Download version 1.25 of Linux nForce Drivers (http://www.nvidia.com/object/linux_nforce_archive.html) from archive (I don't know why they have version 1.23 in Unix drivers page)
2. Unzip and install RPM for RHEL5_U1
3. Copy and replace forcedeth.ko from /lib/modules/2.6.18-53.el5/kernel/drivers/net to /lib/modules/2.6.18-92.1.18.el5/kernel/drivers/net/ (make a backup just in case)
4. Add the following lines to /etc/modprobe.conf (replace eth0 for whatever is yours)
alias eth0 forcedeth
options forcedeth msi=0 msix=0 dma_64bit=0
5. Remove module if loaded
rmmod forcedeth
6. Install module
insmod /lib/modules/2.6.18-92.1.18.el5/kernel/drivers/net/forcedeth.ko msi=0 msix=0 dma_64bit=0
(you may reboot as well but this is faster for testing)
you should get something like this by dmesg
eth0: forcedeth.c: subsystem: 01019:2145 bound to 0000:00:0f.0
7. Configure ifcfg-eth0 (or whatever)
TYPE=Ethernet
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=00:XX:XX:XX:XX:XX
If you don't know your MAC then forget about that line and do ifconfig eth0 up
Thursday, February 19, 2009
How to Find out whether you are using 64 bit JDK or 32 bit JDK
Write this sample java program
import java.util.Enumeration;
import java.util.Properties;
public class Class1 {
public Class1() {
}
public static void main(String[] args) {
Class1 class1 = new Class1();
Properties p = System.getProperties();
Enumeration keys = p.keys();
while (keys.hasMoreElements()) {
String key = (String)keys.nextElement();
String value = (String)p.get(key);
System.out.println(key + ": " + value);
}
}
}
Run the program
and check for the propert sun.arch.data.model if this shows 32 then you are running in a 32 bit JVM. If this shows 64 bit then you are in 64 bit JVM.
For the 64 bit you run the java using the following option $ORACLE_HOME/jdk/bin/java –d64
This shows sun.arch.data.model: 64
Resolving ClassNotFound Exceptions
When you are running a Java program or compiling a java program you got a class not found error, going through all the JAR files for finding this particular class file is quite tedious.
The program given below can help you to search inside the jar and/or zip files and tells you whether the file you are looking for is present or not.
Code Example
Below you will find the code example, how you use it and what result you can expect out of it.
SearchJars.java
package mypackage7;
import java.util.zip.*;
import java.io.*;
import java.util.*;
public class SearchJars {
static String s3;
static String s4 ="";
static int i1 = 0;
static int i2 = 0;
public static void main(String args[]) {
if (args.length != 2) throw new IllegalArgumentException("Wrong Number of Args !! java SearchJars Direcory_Name filename ");
File f1 = new File(args[0]);
s3 = args[1];
traverse(f1);
System.out.println("\n\n============== Results ============================");
System.out.println("Searced "+ i1 +" Files in "+ args[0] +" And Found "+i2 +" Entries. ");
System.out.println(s4);
}
public static void traverse(File f) {
String s1 = f.getAbsolutePath();
if (s1.toUpperCase().indexOf(".JAR") != -1 || s1.toUpperCase().indexOf(".ZIP") != -1 ) {
System.out.println("Searching "+ s1 +" .....");
i1++;
try {
ZipFile zf = new ZipFile(s1);
for (Enumeration entries = zf.entries(); entries.hasMoreElements();) {
String s2 = ((ZipEntry)entries.nextElement()).getName();
if (s2.indexOf(s3) != -1 ) {
System.out.println("Found "+s2 + " In " +s1);
i2++;
s4 = s4 + "Found "+s2 + " In " +s1 + "\n";
}
}
} catch (IOException e) {}
}
if (f.isDirectory()) {
String[] children = f.list();
for (int i=0; i<children.length; i++) {
traverse(new File(f, children[i]));
}
}
}
}
Program Usage
java.exe mypackage7.SearchJars D:\oracle\jdev1012\BC4J\jlib DateConvertor
Program Output
Searching D:\oracle\jdev1012\BC4J\jlib\adfjclient.jar .....
Found oracle/jbo/uicli/jui/DateConvertor.class In D:\oracle\jdev1012\BC4J\jlib\adfjclient.jar
Searching D:\oracle\jdev1012\BC4J\jlib\adfmejb.jar .....
Searching D:\oracle\jdev1012\BC4J\jlib\adftags.jar .....
Searching D:\oracle\jdev1012\BC4J\jlib\bc4jdatum.jar .....
============== Results ============================
Searced 4 Files in D:\oracle\jdev1012\BC4J\jlib And Found 1 Entries.
Found oracle/jbo/uicli/jui/DateConvertor.class In D:\oracle\jdev1012\BC4J\jlib\adfjclient.jar