My Quotes


When U were born , you cried and the world rejoiced
Live U'r life in such a way that when you go
THE WORLD SHOULD CRY






Tuesday, June 22, 2010

How to start JRMC with production applications

I always had the doubt whether you can attach JRMC with an running production application without re-starting the weblogic instances.

Here are the certain things you can do.
1) Check your license agreement with Oracle.
2) If not try downloading from http://licensecodes.oracle.com/bea.html. Look for the text "LIC-WLRT20" in this page.
3) Download the zip file named "LIC-WLRT20.zip".
4) Extract the file named LIC-WLRT20.txt  and copy the same to %JROCKIT_HOME%/jre/
5) Rename the older license.bea file. In certain cases JRMC client will work with the existing version of the license.bea file itself. In that case you do not these above steps and you can proceed to download the JRMC client. If you swap the license file then you need to re-start the instances.
6) Download JRMC from the location http://www.oracle.com/technology/software/products/jrockit/index.html and install it (preferably jrmc-3.1.2-1.5.0) in your local machine say c:/jrmc
7) Ensure that the appropriate port number preferably 5 digit port numbers are allowed from your application servers.
8) run the following command %JROCKIT_HOME%/bin/jrcmd <process ID of the weblogic instance> start_management_server ssl=false authenticate=false port=<port number>.
9) Do a netstat -an | grep <port number>
10) You should see that the port number in LISTENING state.
11)   Open C:\jrmc-3.1.2-1.5.0\bin\jrmc.exe
12) Create the connection to the application server. JRMC client will ask you for a password . Enter a master password atleast 8 characters long. Remember this password.
13) Test the connection and everything goes fine, you should be able to get to the console and start memory leak recordings.
 

Thursday, June 10, 2010

Test SMTP from command Line

Sample Steps in a nutshell

  1. Telnet to the mail server on the correct port (by default port 25) e.g. telnet mailhost 25
  2. Type EHLO <domain name> and press enter e.g. EHLO test.com
  3. Type MAIL FROM:<valid sending email address> e.g. MAIL FROM:tester1@test.com
  4. Type RCPT TO:<valid receiving mailbox to which you have access> e.g. RCPT TO:tester2@test.com
  5. Type DATA and press enter
  6. (Optional) Type Subject: <subject of the test email> e.g. Subject:This is a test email via telnet to port 25 on mailhost 
  7. Enter the text of the message e.g. This is a test message sent at 10:33 on 12/08/2009. 
  8. Press Enter, then a full-stop/period, then Enter again to end the message. 
  9. Type QUIT to disconnect from the mail server. 
  10. Exit Telnet as normal.

http://support.microsoft.com/kb/153119

Detailed description of the steps
This article only outlines information for a connectivity test for messaging with Exchange Server, if you are not able to connect to the Exchange Server, please search the KB for other symptoms or error messages you are experiencing. For additional information on troubleshooting Exchange transport issues, please refer to the following article in the Microsoft knowledgebase:
(http://support.microsoft.com/kb/257265/ ) General troubleshooting for transport issues in Exchange 2000 Server and in Exchange Server.
Before you start the Telnet session, you must have the full SMTP e-mail address of the destination user who you want to send this test message to. This e-mail address must be in the following format:
User@Site.Domain.com
You must also have the fully qualified domain name (FQDN) or the IP address of the server computer that is running the SMTP services (for example, 10.120.159.1). If the servers are in your organization, you may already have this information. If the servers are external, the easiest way to find this information is to use Nslookup.exe to find the DNS records that contain this information. 
  • Some Telnet applications require you to turn on local echoing to see the commands that you are typing. To do this while in a Microsoft Telnet session, type set local_echo at the command prompt.
  • In Microsoft Windows XP, type set localecho instead of set local_echo.  
Step-1
In the following steps, you run Telnet from the command line. To open a command line, Click Start, click Run, type cmd in the Open box, and then click OK.You can start a Telnet session by using the Telnet command in the following format:

Note Press ENTER after you type each line.
telnet servername portnumber
For example, type:
telnet mail.contoso.com 25
Note You can replace servername with the IP address or the FQDN of the SMTP server that you want to connect to. Remember to press ENTER after each command.

If the command works, you receive a response from the SMTP server that is similar to the following: 
220 site.contoso.com Microsoft Exchange Internet Mail Connector <version number of the IMC>
 
Step-2
Start communication by typing the following command:
EHLO test.com
Note You can use the HELO command, but EHLO is a verb that exists in the Extended SMTP verb set that is supported in all current Microsoft implementations of SMTP. It is a good idea to use EHLO, unless you believe that there is a problem with the Extended SMTP Verbs.

If the command is successful, you receive the following response:
250 OK

Step-3
 Type the following command to tell the receiving SMTP server who the message is from:
MAIL FROM:Admin@test.com
Note This address can be any SMTP address that you want, but it is a good idea to consider the following issues:
  1. Some SMTP mail systems filter messages based on the MAIL FROM: address and may not permit certain IP addresses to connect or may not permit the IP address to send e-mail to the SMTP mail system if the connecting IP address does not match the domain where the SMTP mail system resides. In this example, that domain is test.com.
  2. If you do not use a valid e-mail address when you send a message, you cannot determine if the message had a delivery problem, because the non-delivery report (NDR) cannot reach an IP address that is not valid. If you use a valid e-mail address, you receive the following response from the SMTP server:
    250 OK - MAIL FROM Admin@test.com
      
Step-4
Type the following command to tell the receiving SMTP server whom the message is to.

Note It is a good idea to always use a valid recipient SMTP address in the domain that you are sending to. For example, if you are sending to john@domain.com, you must be certain that john@domain.com exists in the domain. Otherwise, you will receive an NDR.

Type the following command with the SMTP address of the person you want to send to:
RCPT TO: User@Domain.Com
You receive the following response:
250 OK - Recipient User@ Domain.Com
 
Step-5 
Type the following command to tell the SMTP server that you are ready to
 send data: 
DATA
You receive the following response:

354 Send data. End with CRLF.CRLF


Step-6

You are now ready to start typing the 822/2822 section of the message. 
The user will see this part of the message in their inbox. Type the 
following command to add a subject line: 
Subject: test message
Press ENTER two times. You do not receive a response from this command.

Note The two ENTER commands comply with Request for Comments (RFC) 822 and 2822. 822 commands must be followed by a blank line.

Step-7
Type the following command to add message body text: 
This is a test message you will not see a response from this command.

Step-8
 
Type a period (.) at the next blank line, and then press ENTER. 

 You receive the following response:
250 OK

Step-9
Close the connection by typing the following command: 
QUIT
You receive the following response:
221 closing connection
 
Step-10
Verify that the recipient received the message that you sent.
If any error event messages appear in the application event log, or if 
there are problems receiving the message, check the configuration or the
 communication to the host 
 

Advanced Testing

In addition to the basic testing steps that are listed in this article, you can use a delivery receipt to test mail in both directions. You can use this method to verify that the SMTP server can accept an inbound connection and generate a delivery receipt back to the sender to test outbound connectivity of the SMTP server.

To request a delivery receipt for the test message, see step 4 in the "Basic Testing" section of this article to make sure that the information provided is a valid e-mail address that can receive the delivery receipt. Then in step 5 in the "Basic Testing" section of this article, type the following command in the Telnet session:
RCPT TO:User@Site.Domain.Com notify=success,failure.
  

Friday, June 4, 2010

Quartz and WLS 10.3 driver problems

This will be the exception to be seen when integrating WLS10.3 and Quartz.
org.quartz.JobPersistenceException: Couldn't store job: Driver's Blob representation is of an unsupported type:
  weblogic.jdbc.wrapper.Blob_oracle_sql_BLOB [See nested exception: java.sql.SQLException: Driver's Blob representation is of an unsupported type: weblogic.jdbc.wrapper.Blob_oracle_sql_BLOB]

Solution
Use the WeblogicOracleDelegate driver delegate in your config
org.quartz.jobStore.driverDelegateClass =org.quartz.impl.jdbcjobstore.oracle.WebLogicOracleDelegate (for Oracle drivers used within Weblogic)

Problem solved.

Tuesday, June 1, 2010

web sites to test network traces to your hosted application

How do you monitor your web site by logging in and doing a trace route / ping without the need for network team (or) typical end users

https://www.sprint.net/lg/lg_start.php

http://traceroute.org/#Looking%20Glass

Enable DEBUG bind parameters in hibernate

Of late we had issues when using Hibernate and not able to identify the bind parameters when using PreparedStatement.

I am giving this for JBOSS server at this point of time, but will try to capture it for WLS also.

It would be pretty good if we have a stack trace like the following

Binding the following parameter to the SQL statement.

Here are the 2 ways to do it.



Change the jboss-4.2.2.GA\server\default\conf\jboss-log4j.xml

Add the following lines of code

<!-- Limit Hibernate categories --> 
   <category name="org.hibernate.type"> 
        <priority value="TRACE"/> 
        <appender-ref ref="CONSOLE"/>
   </category>
  
   <category name="org.hibernate.SQL"> 
           <priority value="TRACE"/> 
           <appender-ref ref="CONSOLE"/>
   </category>
  
Apart from this, in your hibernate configuration set the SHOW_SQL = true

Also on the sidelines, add these to your log4j property file.


log4j.category.org.hibernate.SQL=TRACE, STDOUT
log4j.category.org.hibernate.type=TRACE, STDOUT
log4j.category.net.sf.hibernate.type=TRACE, STDOUT
log4j.category.net.sf.ps.PreparedStatementCache=TRACE, STDOUT
### direct log messages to stdout ###
og4j.appender.STDOUT=org.apache.log4j.RollingFileAppender
log4j.appender.STDOUT.Threshold = TRACE
log4j.appender.STDOUT.File=C:\\hibernate.log
log4j.appender.STDOUT.MaxFileSize=10MB
log4j.appender.STDOUT.MaxBackupIndex=5
log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout
log4j.appender.STDOUT.layout.ConversionPattern=%d{ISO8601} %-5p [%F:%L] : %m%n