Tuesday, April 13, 2010

Adding Security Certificate to JVM to handle SecurityCertificateError

Handling SecurityCertificateError exception in JAVA by adding security certificate using Keytools

To add the security certificate for https URL the following steps needs to be followed

  • Take a backup of cacerts file in the following directory (This can be your default JRE directory also) C:\Program Files\IBM\SDP70\runtimes\base_v6\java\jre\lib\security\
  • Save the security certificate in some location for ex c:\certificate.cer
  • Go to Run type cmd
  • Execute CD C:\Program Files\IBM\SDP70\runtimes\base_v6\java\jre\bin (This is the location of the JRE WebSphere uses, in other environments please navigate to the JRE BIN the application uses)
  • Then execute the following command
(SYNTAX Keytool –keystore – import – file -alias<> )

Command
keytool -keystore "C:\Program Files\IBM\SDP70\runtimes\base_v6\java\jre \lib\security\cacerts" -import -file c:\certificate.cer -alias https://your-url.net

  • It will ask for a password , enter changeit
  • The security certificate will be added for the JRE

Now you can access the URL or access the webservice in the URL.

Friday, April 2, 2010

Fire bug - An invaluble tool for debugging

If you have been into web programming, you will know its hard to develop front screens than to write the backend business classes. Also debugging Java Script is also a head headache. Fire Bug is a plugin for firefox that saves valuble time in web application development. It has nice features like inspecting the html elements, it shows the CSS applied. You can also see the Java Script.

You can also view POST headers that are sent to the server. One more interesting feature is you can edit the HTML in the browser and see it work.




The above picture is a snap shot of the Firebug tool. You cant use it in IE , one close too that is a substitue for it in IE is Fiddler , but it no where comes close to Firebug in terms of the richness of features.

Setting JAVA HOME through Command Line in Windows

Hi all,
If you are working on some old windows machines and want to set JAVA_HOME and PATH environment variables follow the steps.

Start --> Run-->CMD .. In the command prompt first type


echo %JAVA_HOME% , if the JAVA_HOME variable is already set the path will be printed.
eg: c:/Program Files/java1.6

else %JAVA_HOME% will be printed.

You can set JAVA_HOME by typing

SET JAVA_HOME = c:/Program Files/Java (The path where your JRE or JDK is installed)

Then you can set the bin path by typing

SET PATH = %PATH%;%JAVA_HOME%\bin what you are doing here is appending the existing set PATH's with JAVA_HOME/bin.

You can also directly set the path to the JAVA Bin directory instead of the above steps like
SET PATH = %PATH%;c:/Program Files/JAVA/bin

Then if you want to view the set path you can type echo %PATH% ..

Wednesday, March 31, 2010

Beachfront Vacation Living for Non-Millionaires

Fractional ownership is gaining popularity these days . The National News Today has covered the scenario. They have discussed the knick knacks of this type of ownership. The three main rules that they emphasize is

A) Understand the rules of occupancy and the usage schedule-
B) Review the rules for selling your fractional sale-
C) Understand how the property is to be managed-

Though Emerald Isle, NC is not a place for an ideal Beachfront vacation home. If Water Everywhere, Plentiful Beaches, Family Atmosphere and affordability are important to you, this is your kind of place. Most vacation destinations along the East Coast are very commercial.

The Emerald Island vacation home is ideally suited for people to buy vacation homes with fractional ownership without ever having to take the risk for investing the whole lot of your hard earned money. The fractional ownership real estate is really a boon for the middle class people to fulfill the dream of owning a vacation home in the beachside. Considering all the points and a great place like NC its a good deal overall.

There is one more thing you should consider. The Green Revolution is here, whether we like it or not. Yes, we all know deep down that we need to do our part to make the planet a better place and to make sure that future generations have the same opportunities as we have had. So which is better for our planet………. 10 vacation houses that are built and sit empty for 47 weeks a year, or 1 perfect vacation house that is used for 50 weeks a year?

LoudLaunch - Compensating bloggers for their unbiased opinions, reviews, and analysis.

Everything you need to know about organic apples

The coming fall its apple harvest season . These days agriculture is taken over by artificial fertilizers, insecticides and pesticides. The National News Today has featured a farmer who does organic farming using natural methods.The farm direct organic apples are sold by them in person in Seattle. They give away free samples of their farm grown harvest. The farmer Paul Madden is obviously a lover of apples. This is evident from this article organic fruit of the month. He cares so much about them he says "I just want you to understand how much I care about the apples I feed to my children and your children."

He has a large 50 acre farm where he produces Washington organic apples . Washington takes advantage of the arid climate and plentiful sunshine needed for the best organic apples. The arid climate results in fewer insect and disease issues. They are on the banks of the Columbia River and the cool, clear water of the mid-Columbia is used for the irrigation of my orchard. His orchard has been organic since 1990 and has been in my family for 99 years. So he obviously produces the best apples in USA .

LoudLaunch - Compensating bloggers for their unbiased opinions, reviews, and analysis.

Tuesday, March 30, 2010

New Adventures and Favorite Destinations

Breezes Resorts is one of the exclusive resorts in Jamaica . Perhaps its the best place to enjoy the warm summer weather. If you have been frozen by last years harsh winter and looking for a nice package to get some sun tan and warm yourself, you should consider all inclusive vacation packages given by them.

The Runaway Bay Jamaica conveniently located just about an hour away from the city of Montego Bay, Breezes Runaway Bay Resort & Golf Club is one of the world’s truly great escapes. You can go for a Carmaran ride in the crystal blue Caribbean sea. They also have video assisted golf and tennis court where you can enhance your skills

The Negril Jamaica is located between rugged mountains and sun drenched beaches, emrald jungles and blue Caribbean waters, the island of Jamaica is both a study in contrasts and a living lesson in geography. You should definitely take a vacation here to chill off from your hectic schedule this summer.

This is really the finest place to enjoy your honeymoon. The beaches are creating more romantic mood to you and your partner. Breezes.com offers all inclusive vacation packages for you. So you can enjoy a lot in lowest cost. These all inclusive vacation packages from breezes.com included deluxe accommodations, all meals & snacks, unlimited premium beverages, land & water sports and many more. These are available in your budget. You can enjoy and play at Runaway Bay Jamaica. Surely you will get more entertaining moment in Breezes Resorts. Everything from Breezes.com is fantastic a fabulous. If you looking for wedding in Breezes resort, they can arrange everything for you. You will get new experience in breezes resorts. So simply book the breezes resorts for your vacation in Negril Jamaica. And enjoy a lot.


LoudLaunch - Compensating bloggers for their unbiased opinions, reviews, and analysis.

Online Disclosure Policy

This blog is a personal blog written and edited by me without bias or influence from others. While this blog accepts forms of cash advertising, sponsorship, paid insertions or other forms of compensation, it does not publish in a way that is contrary to my personal integrity. The compensation received will never influence the content, topics or posts made in this blog. I am free to reject posts that I do not agree with or approve. My writing represents the truth and I do not write about items that I do not personally support. This blog does not contain any content that might present a conflict of interest but it does follow international ethical guidelines and best practices for the internet and online advertising.

Sunday, February 28, 2010

JAVA Jokes - The fun side of JAVA

Too much of JAVA technical stuff , now here is a collection of some JAVA jokes that caught my eye..

---------
9:00 AM
Project manager: ” Where is Joe?”
Java programmer A: ” You know he is always lazy loadded.”

1:00 PM:
Project manager: ” Where is Joe??”
Java programmer B: ” He is in passive mode.”

5:30 PM:
Project manager: ” Could I see Joe in rest of my life ?????”
Java programmer C: “Never, he has been garbage collected.”

————

Why did the Integer drown?
Cos he couldn’t Float!

————

Q: Why did the Java Chicken cross the road?
A: He didn’t, he was just referred to on the other side.

————

yo mama’s so fat… she get an ArrayOutOfBoundException!
yo mama’s so poor… she does garbage collection for a living!
yo mama’s so ugly… her java.lang.reflect took down the mirror site!

————

Two ints and a Float in a bar. They spot an attractive Double on her own. The first int walks up to her. “Hey, baby”, he says, “my VM or yours”. She slaps him and he walks back dejected.

The second int walks over. “Hey, cute-stuff, can I cook you Beans for breakfast”. After a quick slapping, he too walks back.

The Float then ambles over casually. “Were those two primitive types bothering you?”, he remarks.

“Yes. I’m so glad you’re here”, she says. “They just had no Class!”

Monday, February 15, 2010

Buy and Sell Ipod to become richer!!

Australia’s Commonwealth bank uses the comparative price of iPod Nano’s, as an index, to compare global currencies and purchasing power across countries. In the results of their latest survey, Brazil is the costliest place to buy an iPod and India comes second. The cheapest iPod can be bought in Canada followed by Hong-Kong.

Suddenly, iPod arbitrage sounds like a good business plan. Buy them in Hong-Kong and sell them in Brazil ;-)

Tuesday, February 2, 2010

YAHOO Pipes

Yahoo has come up with yet another Web 2.0 gizmo. This one is called Yahoo Pipes. Its like Unix pipes applied to the web!

It goes like this .. anybody with a Yahoo ID can define a “pipe”. A pipe at its most basic form, picks data from “X” source and applies “Y” transform over it and finally provides “Z” output. Here, X could be anything ranging from an RSS/ATOM feed, any URL emiting JSON or XML content (even plain HTML works, I think ..), or it could be user input. Y implies a transform like applying a filter on the data, searching on Yahoo, Google or Flickr etc and Z is the final output you get. The best part is you can do all this “piping” using Yahoo’s web-visual editor (see the pic below), without knowing a thing about XML,HTML,RSS,whatever …

I created a Pipe just for kicks .. its at href="http://pipes.yahoo.com/pipes/pipe.info?_id=jnZ0iPYa3BGXuH3I6kjTQA"

This pipe consumes the RSS feed from digg.com’s technology section and extracts all posts that have the keyword “Google” in it. Simple, but cute ! ;-)


Thursday, January 28, 2010

Accessing Webservices from PHP

Normally, most of the current windows products provides webservice for many of its functionalities. Particularly the sharepoint 2007 server, has lot of webservice that external applications can use it.

Again, accessing those webservices through .NET is pretty easy with its built in function. But, to access it through languages like PHP, requires some analysis, particularly for those who are doing it for first time.
The nusoap.php is a populat choice to access the webservice via Php.

It can be downloaded from the following sourceforge URL.

href="http://sourceforge.net/project/showfiles.php?group_id=57663

Here is the code snippet to access it

require_once( '/nusoap.php');

$client = new soapclient('http://ctsgvcchannel1/_vti_bin/SearchWebService.asmx',false,$proxyhost, $proxyport, $proxyusername, $proxypassword);

$client->setcredentials($username,$password);

$err = $client->getError();

if ($err) {

echo '

Constructor error

' . $err . '
';

}

// Doc/lit parameters get wrapped

$param = array('strKeyWord' => 'java','pageLength'=>(int)'5');

$result = $client->call('SimpleSearch', $param, '', 'http://tempuri.org/SimpleSearch', false, true);

// Check for a fault

if ($client->fault) {

echo '

Fault

';

print_r($result);

echo '
';


} else {

// Check for errors

$err = $client->getError();

if ($err) {

// Display the error

echo '

Error

' . $err . '
';


} else {

// Display the result

echo '

Result

';

print_r($result);

echo '
';


}

}

echo '

Request

' . htmlspecialchars($client->request, ENT_QUOTES) . '
';


echo '

Response

' . htmlspecialchars($client->response, ENT_QUOTES) . '
';

Saturday, January 23, 2010

Web Services - How does it work and where to use ?

Web Service has been the new buzz word in the past few years. In this post we will explore the basic elements of it and where it can be applied.

Consider this scenario a JAVA application running in a server and has an access to a stock price data base, where the recent stock prices are updated and you have a stand alone .NET stand alone application running in your computer from which you want to access the stock prices and display it in your computer. Remember you cannot be provided access to their database. So what is the solution ???

You face 2 problems

  • You dont have access to their database
  • The application that has access to the database is totally a different platform
How do you overcome such a situation? .. The answer is webservice.
If the a JAVA method that could fetch the data is exposed to the outside world that listens to the incoming requests and sends back the requested data that would be perfect isn't it?..

WebService uses HTTP protocol to send the request and response in SOAP (Simple Object Access Protocol) format.

There should be a contract to access the webservice this is provided by WSDL -Web Services Definition Language, it is also a XML file containing the method names and their return types and lot more. To learn more about webservice visit this page.

Friday, January 15, 2010

Know the core libraries in Java

Java differs from other languages in that the number of classes and interfaces in its standard libraries is very large.Beginners to Java should take note that very many common tasks have already been implemented in the libraries. The most widely used packages are probably java.lang, java.util, java.sql, and java.io.

As well, the libraries

* are built by experts
* generally improve their performance over time
* are widely used, and form defacto standards

Implementing something which already exists in the libraries is probably wasted effort.Significant changes and additions to the standard libraries occur in each major release, and it pays to keep current. For example, the 1.4 release of the JDK includes regular expressions, assertions, logging services, and more, in its list of new features. The Java 5 release has several major new features, including generics, an enhanced for loop, enums, autoboxing, and metdata. The Java 6 release has no new language features, and is not as dramatic as the 1.5, but it still has some interesting new features, such as scripting, the JConsole monitoring tool, and various Swing improvements.

Sunday, January 10, 2010

You can compare String objects in a variety of ways, and the results are often different. The correctness of your result depends largely on what type of comparison you need. Common comparison techniques include the following:

  • Compare with the == operator.
  • Compare with a String object’s equals method.
  • Compare with a String object’s compareTo method.
  • Compare with a Collator object.
  • Comparing with the == Operator
The == operator works on String object references. If two String variables point to the same object in memory, the comparison returns a true result. Otherwise, the comparison returns false, regardless whether the text has the same character values. The == operator does not compare actual char data. Without this clarification, you might be surprised that the following code snippet prints The strings are unequal.

String name1 = “Michèle”;
String name2 = new String(”Michèle”);
if (name1 == name2) {
System.out.println(”The strings are equal.”);
} else {
System.out.println(”The strings are unequal.”);
}

The Java platform creates an internal pool for string literals and constants. String literals and constants that have the exact same char values and length will exist exactly once in the pool. Comparisons of String literals and constants with the same char values will always be equal.

Comparing with the equals Method
The equals method compares the actual char content of two strings. This method returns true when two String objects hold char data with the same values. This code sample prints The strings are equal.

String name1 = “Michèle”;
String name2 = new String(”Michèle”);
if (name1.equals(name2) {
System.out.println(”The strings are equal.”);
} else {
System.out.println(”The strings are unequal.”);
}

Comparing with the compareTo Method
The compareTo method compares char values similarly to the equals method. Additionally, the method returns a negative integer if its own String object precedes the argument string. It returns zero if the strings are equal. It returns a positive integer if the object follows the argument string. The compareTo, method says that cat precedes hat. The most important information to understand about this comparison is that the method compares the char values literally. It determines that the value of ‘c’ in cat has a numeric value less than the ‘h’ in hat.
String w1 = “cat”;
String w2 = “hat”;
int comparison = w1.compareTo(w2);

Tuesday, January 5, 2010

How to get time information in java.sql.Date?

The answser is you cannot.
java.sql.Date does not store/retrieve any information related to time.

So, how do you solve the problem of saving the date with time in your database?

Simple… use java.sql.Timestamp. There are methods in java.sql.PreparedStatement and java.sql.Statement to set the timestamp.

Sunday, January 3, 2010

PIC Microcontroller Programming Tutorials - Part 1

See the basics of using MikroC compiler and Oshonsoft PIC simulator.



Proceed to the next part >>

Thursday, December 10, 2009

Disclosure Policy

This blog is a personal blog written and edited by me. This blog accepts forms of cash advertising, sponsorship, paid insertions or other forms of compensation.

This blog abides by word of mouth marketing standards. We believe in honesty of relationship, opinion and identity. The compensation received may influence the advertising content, topics or posts made in this blog. That content, advertising space or post will be clearly identified as paid or sponsored content.

The owner(s) of this blog is compensated to provide opinion on products, services, websites and various other topics. Even though the owner(s) of this blog receives compensation for our posts or advertisements, we always give our honest opinions, findings, beliefs, or experiences on those topics or products. The views and opinions expressed on this blog are purely the bloggers' own. Any product claim, statistic, quote or other representation about a product or service should be verified with the manufacturer, provider or party in question.

This blog does not contain any content which might present a conflict of interest.