uncaught exception: [Exception… “Not enough arguments” (NS_ERROR_XPC_NOT_ENOUGH_ARGS)

I was testing my web application on FireFox5 , I faced “not enough arguments” issue. During investigation what I found is while opening the page we are hitting actual issues inside ‘addEventListener’ function. I searched web around behavior of ‘addEventListener’ in firefox and found that it expect third argument as well so I replaced below code locally and it worked for me =)

addEventListener(“load”, function(event) {
      _init();
);

with Continue reading “uncaught exception: [Exception… “Not enough arguments” (NS_ERROR_XPC_NOT_ENOUGH_ARGS)”

jQuery : firefox and chrome onchange textarea update issue

Today I was doing some code in which I need to update the TextArea text onclick of a list option. I noticed It was working fine in IE all the time but inside Firefox and Chrome it works for first time but next time don’t update the content.

I was using below code

function callMe(){
        var optionValue=$(‘#serviceNm :selected’).attr(‘nits’);
        $(“#serviceRqstNm”).text(”);
        $(“#serviceRqstNm”).text(optionValue);
    }

Continue reading “jQuery : firefox and chrome onchange textarea update issue”

How to read Blue Dump’s (BSOD) Minidump file

From couple of weeks in my brother’s machine he was getting Blue Dump screen with message “DRIVER_IRQL_NOT_LESS_OR_EQUAL”. Today to investigate I asked him to pass me the minidump files. Minidump are file that windows write for debugging purpose at below location:

%SystemRoot%\Minidump

in the above folder you will find files with ext .dmp
if you open this file with notepad or any other editor you will not be able to read it’s content.

Continue reading “How to read Blue Dump’s (BSOD) Minidump file”

How To get ServletContext inside Filter

I was coding last night and I have to get some information from Manifest file in filters. In order to read the Manifest I need the ServletContext. Using below code you can get the ServletContext inside Filter.

public class SomeFilter implements Filter {
FilterConfig config;

public void setFilterConfig(FilterConfig config) {
this.config = config;
}

public FilterConfig getFilterConfig() {
return config;
}

public void init(FilterConfig config) throws ServletException {
setFilterConfig(config);
}

// doFilter and destroy methods…
public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException {

ServletContext context = getFilterConfig().getServletContext();
Manifest mManifest=new Manifest();
System.out.println(“Manifest “+mManifest.getBuildInfo(context));

}
}

XStream: Cannot parse date

I was sending date “06-14-2011” in XML request, during it’s processing i got this parse error

Cannot parse date 06-14-2011 com.thoughtworks.xstream.converters.basic.DateConverter.fromString(DateConverter.java:97)

this is because Xstream by default don’t handle MM-dd-yyyy format. So we need to add one in order to make our format working.

String[] formats ={“MM-dd-yyyy”}; XStream xstream = new XStream(); xstream.registerConverter(new DateConverter(“MM-dd-yyyy”,formats)); Object obj=xstream.fromXML(inputXML)

This will resolve the issue. =)

Mainframe CICS DB2 : Security mechanism not supported

I was writing a code to access DB2 in CICS where I encountered this error. This error encounters when you are trying to access a secured Db with default options. In order to get this working, you have to specify ‘securityMechanism’ property in your connection string with value as supported by server, see below:

jdbc:db2://SERVERNAME:3700/DB:securityMechanism=7;

Continue reading “Mainframe CICS DB2 : Security mechanism not supported”

Mainframe CICS DB2 : java.lang.NoClassDefFoundError: com/ibm/crypto/provider/IBMJCE

I was trying to access Mainframe () DB2 using standalone application with “com.ibm.db2.jcc.DB2Driver” driver where I encountered the below error

java.lang.NoClassDefFoundError: com/ibm/crypto/provider/IBMJCE

Problem was that ibmjceprovider.jar was missing from my classpath and java.security file I added the jar file and then added below line in security file..it works.

security.provider.10=com.ibm.crypto.provider.IBMJCE

Java Return Value to Unix Shell Script

Today I faced a situation where I need to verify something though Java class in database . My problem was I have to do this inside unix shell script. I created the below solution to achieve that, I am posting here sample working code:

JAVA CLASS

public class Sample
{

public static void main(String args[])
{
//Do the complete logic and print the result using system out
System.out.println(“Sample Testing”);    
}
}

Shell Script

Continue reading “Java Return Value to Unix Shell Script”

How to send an email from UNIX using mailx.


#!/bin/sh
#
# Purpose: Demonstrate how to send an email from UNIX using mailx.
############################################################

# Example 1 – Simple:
echo “This is the body.”| mailx -s “mailx Test1” sample@sample.com

# Example 2 – Using Variables:
SUBJECT=”mailx Test2″
EMAIL_ADDRESS=”sample@sample.com
BODY=”This is the body of the message.”

echo “$BODY” | mailx -s “$SUBJECT” “$EMAIL_ADDRESS”

Continue reading “How to send an email from UNIX using mailx.”