GURFL data

GURFL file is a list of operators and their associated IP address ranges. This is a good way to find out from which mobile carrier (ie. which country) does a request come from.

Earlier it was available at:http://www.whirlymobile.com/resources/gurfl/operator.csv 

But now days it is down. So I am attaching the last GURFL updated operators.csv file here

Posted in Mobile | 2 Comments

Log4j errors : log4j:WARN No appenders could be found for logger, log4j:WARN Please initialize the log4j system properly

This is a very common problem, it occurs when log4j.properties not found in classpath.

Create a file called log4j.properties. Place it in the root folder where your java classes are found. When log4j initializes, it will look for a file named EXACTLY log4j.properties (if you are using a properties file).

Another alternate way is to put the path to the log4j.properties file in your classpath.

Hope this will help you :)  

Posted in Java, log4j | Leave a comment

org.h2.jdbc.JdbcSQLException: The object is already closed [90007-113]

While running junit using in memory database H2 I was hitting this error. I was testing my spring DAO classes that are using JDBCTemplate. In a single Junit testing, to test various scenario  I was calling a single DAO method with different parameters . It start giving the error "The object is already closed" as it finishes testing the DAO method with first parameter.

Then I investigated in JDBCTemplate and found that it closes connection after every execution of query using Finally statement.

finally {
            JdbcUtils.closeStatement(stmt);
            DataSourceUtils.releaseConnection(con, getDataSource());
        }

To solve this issue I override the JDBCTemplate and created my own JDBCTemplate in which I have removed the Finally statement.

Posted in Database, h2, hsqldb | Leave a comment

Javascript: Make independent copy of array using slice() method

Sometime it happens that we need to make copy of an array but in javascript when we assign an array to new it assign it with reference means if you delete anything from new array it will delete it from the main array as well :(

To create a copy of an array that is independent of another array:
Use the Array object’s slice() method.

For example, the following statements create an array and then use slice() to make an independent copy of the array.

 // JavaScript syntax

var oldArray = ["1", "b", "3"];

var newArray = oldArray.slice();

Posted in javascript | Leave a comment

HSQLDB : java.sql.SQLException: Access is denied in statement [SELECT * FROM TBALE]

This error appears when you have not specified required privileges to user in SCRIPT file for running the statements. Use the commands as follows just after user creation grant access as DBA like below:

CREATE USER SA PASSWORD ""
GRANT DBA TO SA

Posted in Database, hsqldb, Java, Troubleshoot | Leave a comment

HSQLDB : java.sql.SQLException: User not found: SA

While running HSQLDB in standalone mode you may face the error

  java.sql.SQLException: User not found: SA

This is because while creating the DB using script file you are not creating the user

CREATE USER SA PASSWORD ""

The above command you have to include in your db.script file db is your database name) this will creates a user by name SA with blank password.

Posted in Database, hsqldb, Java, Troubleshoot | Leave a comment

Nokia E71 Memory card not detected as disconnects from PC Suite

Few days back I purchased a New E71. I face a weired issue with the phone when ever I connect to PC Suite via USB and after work  disconnects it from USB
It stop reading Memory card. After restart the phone it again start reading it , in gallery it says corrupt library repairing.

I saw many forums and read many articles about this issue and people suggested following solutions:
-try reset by *#7370#
-hard reset '*' '3' 'Call Key' and Power button
-Replace simm card
-Format memory card
-Replace memory card  etc

But nothing of the above method seems to me working for me.

I noticed whenever after closing PC Suite, I try to disconnect it using USB "Safely Remove Hardware" Option in taskbar, it says "The device '…..Nokia…..' cannot be stopped right now. Try stopping the device again later." Then I saw in the task list there are following services are running:
NclUSBSrv.exe
NclRSSrv.exe
MclMSBTSrv.exe

All of the above services are related to E71 Nokia PC Suite .
Now I have end task the NclUSBSrv.exe service after that I again tried removing USB using "Safely Remove Hardware" Option. And this time it works Perfectly.

My issue got resolved :)

Suggestion: Always connect in PC Suite Mode

2/7/2009 Updates – Update to latest PC Suite  this will also resolve the issue. No need to kill the services

Posted in Mobile, Troubleshoot | 2 Comments

Remove element from Array

What if you want to delete an element from Array ??

Mostly people use delete command  but it leaves undefined behind it

>>> var list = [1,2,3];

>>> delete list[1];

>>> list

[1, undefined, 3]

Now try splice instead of delete

>>> var list = [1,2,3];
>>> list.splice(1, 1); // Remove one element, returns the removed ones.
[5]
>>> list[4, 6]
And it's done... 

Posted in javascript | Leave a comment

IE – Expected identifier, string or number

If you're getting this error, chances are you have an extra comma after a curly brace:

  a = {
            b: function() { },
            c: function() { }, }  

Get rid of the trailing comma and your JS error woes will disappear!

Posted in ExtJs, javascript, Troubleshoot | Leave a comment

org.apache.jasper.JasperException: Failed to load or instantiate TagLibraryValidator class: org.apache.taglibs.standard.tlv.JstlCoreTLV

Today while running following  JSP

<%@ page session="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:redirect url="/index.htm"/>

I was hitting a error 

org.apache.jasper.JasperException: Failed to load or instantiate TagLibraryValidator class: org.apache.taglibs.standard.tlv.JstlCoreTLV 

I checked my classpath and found that standard.jar was missing in my WEB-INF/lib.

I added the same and all set..it works fine :)

Posted in Java, Troubleshoot | Leave a comment