When I try to add my site to the task repositories, I get a Java error that says SSL Handshake failed. What do I do?
This will happen if your site is using a self-signed certificate or a certificate that was otherwise signed by a CA that is not contained in the default trusted CA's by your JVM. To solve this problem, you need to add your server certificate to the your JVM certificate keystore. Java includes a command named "keytool" for this purpose. Here is what you need to do:
1. First, you need a copy of the server certificate. You can get this from your web browser. Just access your site using a web browser. In most browsers, you can double-click on the padlock icon to examine the server certificate. There is then usually an option somewhere in the resulting dialogs that lets you export the certificate to a file. Let's say you named the file MyServer.cert.
2. Next, you need to determine the JRE you are using when you run Eclipse. To do this, open the Eclipse Help > About dialog and click on Configuration Details. Then look through the list until you see the value "java.home=/some/path". Copy the entire path to your clipboard or write it down on a piece of paper.
3. The rest of the steps will happen in a command line/terminal session. First, you need to set an environment variable named JAVA_HOME to the value you picked up in Eclipse:
1. Windows: set JAVA_HOME=C:\some\path
2. OSX: export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
3. Linux: export JAVA_HOME=/some/path/to/java
4. Now, you can import the server certificate into your default trusted certificate for the JVM:
$ sudo keytool -import -trustcacerts -alias "some unique name" -file MyServer.cert -keystore
$JAVA_HOME/lib/security/cacerts
Enter keystore password: changeit
Owner: EMAILADDRESS=hostmaster@collab.net, CN=myserver.inst.collab.net,
O="CollabNet, Inc.", L=Brisbane, ST=California, C=US
Issuer: EMAILADDRESS=hostmaster@collab.net, CN=myserver.inst.collab.net,
O="CollabNet, Inc.", L=Brisbane, ST=California, C=US
Serial number: c3761cfe8305a126
Valid from: Fri Apr 04 05:43:33 EDT 2008 until: Thu Apr 09 05:43:33 EDT 2009
Certificate fingerprints:
MD5: EA:BA:9E:90:05:1E:84:7E:74:7E:20:2B:2D:6E:31:4A
SHA1: 89:78:82:8A:83:81:17:ED:E9:9F:74:16:95:81:6C:24:61:36:4C:21
Trust this certificate? [no]: yes
Certificate was added to keystore
The example command is for Linux or OSX and shows the usage of "sudo" if the JVM default requires root to update it. Windows users would not need "sudo" and would replace "$JAVA_HOME" with "%JAVA_HOME%".
The default password for the JVM certificate store is "changeit". Once the certificate is added to the keystore, you should just need to restart Eclipse and it should now work.
Source: http://eclipse.open.collab.net/servlets/ProjectProcess?pageID=3450
Friday, April 8, 2011
Tuesday, March 22, 2011
Jokes
1) mental hospital , paper leak, relase if pass thru the door key
2) Amitab vs Rajani pope john paul
3)Rajnikanth’s next project is the Titanic in Tamil. However, Rajni has twisted the climax. Both the lead actors survive. Rajni swims across the Atlantic Ocean with the heroine in one hand and… theTitanic in the other!
Recently China airports were closed due to heavy fog. Later it was discovered that Rajnikanth was smoking in India!
Rajnikanth did his KG from seven different schools. Today those institutions are known as IITs!
The Government of India pays tax to Rajnikanth for living here!
When Rajnikanth stares at the sun in anger, the sun hides behind the moon, and this phenomena is knows as a Solar Eclipse!
Rajnikanth woke up one day and decided he would share one per cent of his knowledge with the world. Thus, Google was born!
What would have happened if Rajnikanth was born 150 years ago? The British would have fought for independence!
Even Ghajini remembers Rajni!
When do earthquakes occur? When Rajnikanth’s mobile is on vibration mode!
Once Rajnikanth bunked a whole day in school. Since then, that day is known as Sunday!
The Pyramids of Egypt are actually Rajnikanth’s primary school craft projects!
ISRO does not exist anymore. Rajnikanth bought all the rockets for Diwali!
Why did Rajnikanth buy an acre of land with four wells on each corner? To play carrom!
Before Tom Cruise, Rajnikanth was approached to do Mission Impossible. He refused, because he found the title insulting!
When Rajinikanth enters a room, he doesn’t turn the lights on… he turns the dark off.
When Rajinikanth shows you the finger, he’s telling you how many seconds you have left to live.
There is no such thing as global warming. Rajinikanth was cold, so he turned the sun up
Rajinikanth once shot down a German fighter plane with his finger, by yelling, “Bang!”.
East India Company left India in 1947, Because Rajini was supposed to be born in 1949.
Rajinikanth was offered Aamir’s role in “Ghajini” but he denied. Because Rajanikanth can only give memory loss.
Genies rub Rajinikanth and he grants them three wishes.
The Delhi Rajdhani Express once missed Rajinikanth. It ran as fast as it could, but failed to catch him.
Source: http://www.onlinetelugumovies.com/2445/latest-rajnikanth-sms-jokes-doing-the-rounds/
2) Amitab vs Rajani pope john paul
3)Rajnikanth’s next project is the Titanic in Tamil. However, Rajni has twisted the climax. Both the lead actors survive. Rajni swims across the Atlantic Ocean with the heroine in one hand and… theTitanic in the other!
Recently China airports were closed due to heavy fog. Later it was discovered that Rajnikanth was smoking in India!
Rajnikanth did his KG from seven different schools. Today those institutions are known as IITs!
The Government of India pays tax to Rajnikanth for living here!
When Rajnikanth stares at the sun in anger, the sun hides behind the moon, and this phenomena is knows as a Solar Eclipse!
Rajnikanth woke up one day and decided he would share one per cent of his knowledge with the world. Thus, Google was born!
What would have happened if Rajnikanth was born 150 years ago? The British would have fought for independence!
Even Ghajini remembers Rajni!
When do earthquakes occur? When Rajnikanth’s mobile is on vibration mode!
Once Rajnikanth bunked a whole day in school. Since then, that day is known as Sunday!
The Pyramids of Egypt are actually Rajnikanth’s primary school craft projects!
ISRO does not exist anymore. Rajnikanth bought all the rockets for Diwali!
Why did Rajnikanth buy an acre of land with four wells on each corner? To play carrom!
Before Tom Cruise, Rajnikanth was approached to do Mission Impossible. He refused, because he found the title insulting!
When Rajinikanth enters a room, he doesn’t turn the lights on… he turns the dark off.
When Rajinikanth shows you the finger, he’s telling you how many seconds you have left to live.
There is no such thing as global warming. Rajinikanth was cold, so he turned the sun up
Rajinikanth once shot down a German fighter plane with his finger, by yelling, “Bang!”.
East India Company left India in 1947, Because Rajini was supposed to be born in 1949.
Rajinikanth was offered Aamir’s role in “Ghajini” but he denied. Because Rajanikanth can only give memory loss.
Genies rub Rajinikanth and he grants them three wishes.
The Delhi Rajdhani Express once missed Rajinikanth. It ran as fast as it could, but failed to catch him.
Source: http://www.onlinetelugumovies.com/2445/latest-rajnikanth-sms-jokes-doing-the-rounds/
Tuesday, November 30, 2010
Interview with JDA Hyderabad
1. Same class name in two different war files
2. Create own datastrucutre
3. Jsp usebeans
4. Servlet context implemetation
5. Log4j impl
6. Bottom 3 salaries
7. Spring why?
8. Sax vs Dom
======================================================
Q1. Same class name in two different war files
http://www.redbooks.ibm.com/redpapers/pdfs/redp4307.pdf
Q3. Jsp usebeans vs import
This checks if an object called "myBean" exists in the session
attributes, and if necessary creates and puts it there. It also adds a
variable called "myBean" that can be referenced later, in e.g.
<%=myBean.getFoo()%>.
When you develop a bean to be used in a JSP page, I recommend that you make it part of a named package. A Java class that does not use a package statement ends up in the so-called unnamed package. The servlet class generated from the JSP page is, however, typically assigned to a named package. If you try to refer to a class in the unnamed package from a class in a named package, Java cannot find the class unless you use an import statement to import it. In a JSP page that means you must use both a page directive to import the class, and the action to make it available:
<%@ page import="UserInfoBean" %>
If the bean is part of a named packed, the action is all you need:
class="com.mycompany.UserInfoBean" />
2. Create own datastrucutre
3. Jsp usebeans
4. Servlet context implemetation
5. Log4j impl
6. Bottom 3 salaries
7. Spring why?
8. Sax vs Dom
======================================================
Q1. Same class name in two different war files
http://www.redbooks.ibm.com/redpapers/pdfs/redp4307.pdf
Q3. Jsp usebeans vs import
This checks if an object called "myBean" exists in the session
attributes, and if necessary creates and puts it there. It also adds a
variable called "myBean" that can be referenced later, in e.g.
<%=myBean.getFoo()%>.
When you develop a bean to be used in a JSP page, I recommend that you make it part of a named package. A Java class that does not use a package statement ends up in the so-called unnamed package. The servlet class generated from the JSP page is, however, typically assigned to a named package. If you try to refer to a class in the unnamed package from a class in a named package, Java cannot find the class unless you use an import statement to import it. In a JSP page that means you must use both a page directive to import the class, and the
<%@ page import="UserInfoBean" %>
If the bean is part of a named packed, the
Saturday, November 27, 2010
Interview with Proxxxxx in Hyderabad
Questions and answers
=====================
1. Spring instance check
2. How to maintain inserted order in Set
3. Xsd include vs Import
4. why should we overide hashCode and equals
5. immutable collection
6. String intern
7. Template design pattern
8. Any other soa
9. Builder
10. Abstract constructor
11. Soap action
12. Soap method
13. Jms
14. Spring jms
15. Spring aop core
16. Dwr
17. Drools
18. Int n=null
==============================================================================
Q2. How to maintain inserted order in Set
LinkedHashSet - maintain inserted set
TreeSet - Sorted set
Q3. Xsd include vs Import
The difference between the include element and the import element is that import element allows references to schema components from schema documents with different target namespaces and the include element adds the schema components from other schema documents that have the same target namespace (or no specified target namespace) to the containing schema. In short, the import element allows you to use schema components from any schema; the include element allows you to add all the components of an included schema to the containing schema.
Q4. why should we overide hashCode and equals
Objects that are equal according to the equals method must return the same hashCode value
If two objects are not equal according to equals, they are not required to return different hashCode values.
Hash code equal but not the strings
public static void main(String[] args) {
String str1 = "2L";
String str2 = "3-";
System.out.println("String equality: " + str1.equals(str2));
System.out.println("HashCode eqauality: " + (str1.hashCode() == str2.hashCode()));
}
Q5. immutable collection
public static Collection unmodifiableCollection(Collection c)
Q6. String intern()
Returns a canonical representation for the string object.
A pool of strings, initially empty, is maintained privately by the class String.
When the intern method is invoked, if the pool already contains a string equal to this String object as determined by the equals(Object) method, then the string from the pool is returned. Otherwise, this String object is added to the pool and a reference to this String object is returned.
Q7. Builder Pattern
The telescoping constructor anti-pattern occurs when the increase of object constructor parameter combination leads to an exponential list of constructors. Instead of using numerous constructors, the builder pattern uses another object, a builder, that receives each initialization parameter step by step and then returns the resulting constructed object at once.
=====================
1. Spring instance check
2. How to maintain inserted order in Set
3. Xsd include vs Import
4. why should we overide hashCode and equals
5. immutable collection
6. String intern
7. Template design pattern
8. Any other soa
9. Builder
10. Abstract constructor
11. Soap action
12. Soap method
13. Jms
14. Spring jms
15. Spring aop core
16. Dwr
17. Drools
18. Int n=null
==============================================================================
Q2. How to maintain inserted order in Set
LinkedHashSet - maintain inserted set
TreeSet - Sorted set
Q3. Xsd include vs Import
The difference between the include element and the import element is that import element allows references to schema components from schema documents with different target namespaces and the include element adds the schema components from other schema documents that have the same target namespace (or no specified target namespace) to the containing schema. In short, the import element allows you to use schema components from any schema; the include element allows you to add all the components of an included schema to the containing schema.
Q4. why should we overide hashCode and equals
Objects that are equal according to the equals method must return the same hashCode value
If two objects are not equal according to equals, they are not required to return different hashCode values.
Hash code equal but not the strings
public static void main(String[] args) {
String str1 = "2L";
String str2 = "3-";
System.out.println("String equality: " + str1.equals(str2));
System.out.println("HashCode eqauality: " + (str1.hashCode() == str2.hashCode()));
}
Q5. immutable collection
public static Collection unmodifiableCollection(Collection c)
Q6. String intern()
Returns a canonical representation for the string object.
A pool of strings, initially empty, is maintained privately by the class String.
When the intern method is invoked, if the pool already contains a string equal to this String object as determined by the equals(Object) method, then the string from the pool is returned. Otherwise, this String object is added to the pool and a reference to this String object is returned.
Q7. Builder Pattern
The telescoping constructor anti-pattern occurs when the increase of object constructor parameter combination leads to an exponential list of constructors. Instead of using numerous constructors, the builder pattern uses another object, a builder, that receives each initialization parameter step by step and then returns the resulting constructed object at once.
Definition[edit]
The intent of the Builder design pattern is to separate the construction of a complex object from its representation. By doing so the same construction process can create different representations. [2]
Advantages[3][edit]
- Allows you to vary a product’s internal representation.
- Encapsulates code for construction and representation.
- Provides control over steps of construction process.
Disadvantages[3][edit]
- Requires creating a separate ConcreteBuilder for each different type of Product.
- Requires the builder classes to be mutable.
References: https://en.wikipedia.org/wiki/Builder_pattern
Friday, November 26, 2010
JSP interview questions
1. What are the implicit objects in JSP?
Q & A
1. What are the implicit objects in JSP?
A. There are nine implicit objects. Here is the list of all the implicit objects:
Object Class
application javax.servlet.ServletContext
config javax.servlet.ServletConfig
exception java.lang.Throwable
out javax.servlet.jsp.JspWriter
page java.lang.Object
PageContext javax.servlet.jsp.PageContext
request javax.servlet.ServletRequest
response javax.servlet.ServletResponse
session javax.servlet.http.HttpSession
* Application: These objects has an application scope. These objects are available at the widest context level, that allows to share the same information between the JSP page's servlet and any Web components with in the same application.
* Config: These object has a page scope and is an instance of javax.servlet.ServletConfig class. Config object allows to pass the initialization data to a JSP page's servlet. Parameters of this objects can be set in the deployment descriptor (web.xml) inside the element. The method getInitParameter() is used to access the initialization parameters.
* Exception: This object has a page scope and is an instance of java.lang.Throwable class. This object allows the exception data to be accessed only by designated JSP "error pages."
* Out: This object allows us to access the servlet's output stream and has a page scope. Out object is an instance of javax.servlet.jsp.JspWriter class. It provides the output stream that enable access to the servlet's output stream.
* Page: This object has a page scope and is an instance of the JSP page's servlet class that processes the current request. Page object represents the current page that is used to call the methods defined by the translated servlet class. First type cast the servlet before accessing any method of the servlet through the page.
* Pagecontext: PageContext has a page scope. Pagecontext is the context for the JSP page itself that provides a single API to manage the various scoped attributes. This API is extensively used if we are implementing JSP custom tag handlers. PageContext also provides access to several page attributes like including some static or dynamic resource.
* Request: Request object has a request scope that is used to access the HTTP request data, and also provides a context to associate the request-specific data. Request object implements javax.servlet.ServletRequest interface. It uses the getParameter() method to access the request parameter. The container passes this object to the _jspService() method.
* Response: This object has a page scope that allows direct access to the HTTPServletResponse class object. Response object is an instance of the classes that implements the javax.servlet.ServletResponse class. Container generates to this object and passes to the _jspService() method as a parameter.
* Session: Session object has a session scope that is an instance of javax.servlet.http.HttpSession class. Perhaps it is the most commonly used object to manage the state contexts. This object persist information across multiple user connection.
Q & A
1. What are the implicit objects in JSP?
A. There are nine implicit objects. Here is the list of all the implicit objects:
Object Class
application javax.servlet.ServletContext
config javax.servlet.ServletConfig
exception java.lang.Throwable
out javax.servlet.jsp.JspWriter
page java.lang.Object
PageContext javax.servlet.jsp.PageContext
request javax.servlet.ServletRequest
response javax.servlet.ServletResponse
session javax.servlet.http.HttpSession
* Application: These objects has an application scope. These objects are available at the widest context level, that allows to share the same information between the JSP page's servlet and any Web components with in the same application.
* Config: These object has a page scope and is an instance of javax.servlet.ServletConfig class. Config object allows to pass the initialization data to a JSP page's servlet. Parameters of this objects can be set in the deployment descriptor (web.xml) inside the element
* Exception: This object has a page scope and is an instance of java.lang.Throwable class. This object allows the exception data to be accessed only by designated JSP "error pages."
* Out: This object allows us to access the servlet's output stream and has a page scope. Out object is an instance of javax.servlet.jsp.JspWriter class. It provides the output stream that enable access to the servlet's output stream.
* Page: This object has a page scope and is an instance of the JSP page's servlet class that processes the current request. Page object represents the current page that is used to call the methods defined by the translated servlet class. First type cast the servlet before accessing any method of the servlet through the page.
* Pagecontext: PageContext has a page scope. Pagecontext is the context for the JSP page itself that provides a single API to manage the various scoped attributes. This API is extensively used if we are implementing JSP custom tag handlers. PageContext also provides access to several page attributes like including some static or dynamic resource.
* Request: Request object has a request scope that is used to access the HTTP request data, and also provides a context to associate the request-specific data. Request object implements javax.servlet.ServletRequest interface. It uses the getParameter() method to access the request parameter. The container passes this object to the _jspService() method.
* Response: This object has a page scope that allows direct access to the HTTPServletResponse class object. Response object is an instance of the classes that implements the javax.servlet.ServletResponse class. Container generates to this object and passes to the _jspService() method as a parameter.
* Session: Session object has a session scope that is an instance of javax.servlet.http.HttpSession class. Perhaps it is the most commonly used object to manage the state contexts. This object persist information across multiple user connection.
Tuesday, April 13, 2010
microdata
There are three formats available (mostly used)
1. Microdata
2. Microformat
3. RDFa
They represent different trade-offs in terms of ease of authoring versus expressibility.
<span style="font-size:130%;">Interesting facts about microdata:
Microdata is HTML5 microdata specification. It is a way to label the content data to describe specific type of information. This doesn't supported by Yahoo
Ex: Person, Event, ....
Microdata uses the simple html tags div or span
Ex1: <div itemscope="" itemtype="http://data-vocabulary.org/Person">
My name is <span itemprop="name">Bob Smith,
but people call me Smithy.
Here is my homepage:
www.example.com.
I live in
<span itemprop="address" itemscope="" itemtype="http://data-vocabulary.org/Address">
<span itemprop="locality">Albuquerque,
<span itemprop="region">NM
and work as an <span itemprop="title">engineer
at <span itemprop="affiliation">ACME Corp.
Ex2:
Rating: 8.5
Interesting facts about microformat:
Microformats are the easiest to write and understand, but may not fill all your metadata needs. In particular, you may not find an appropriate vocabulary to represent your information.
Interesting facts about RDFa:
eRDF and RDFa allow you to work with any RDF or OWL vocabulary, and create your own vocabulary or reuse existing ones. eRDF is a subset of the full RDF model; for example, you can only make statements about the current page. RDFa offers all the features of RDF, making it the most complex of the three formalisms but also the most powerful one.
Source:
http://www.google.com/support/webmasters/bin/answer.py?answer=176035
1. Microdata
2. Microformat
3. RDFa
They represent different trade-offs in terms of ease of authoring versus expressibility.
<span style="font-size:130%;">Interesting facts about microdata:
Microdata is HTML5 microdata specification. It is a way to label the content data to describe specific type of information. This doesn't supported by Yahoo
Ex: Person, Event, ....
Microdata uses the simple html tags div or span
Ex1: <div itemscope="" itemtype="http://data-vocabulary.org/Person">
My name is <span itemprop="name">Bob Smith,
but people call me Smithy.
Here is my homepage:
www.example.com.
I live in
<span itemprop="address" itemscope="" itemtype="http://data-vocabulary.org/Address">
<span itemprop="locality">Albuquerque,
<span itemprop="region">NM
and work as an <span itemprop="title">engineer
at <span itemprop="affiliation">ACME Corp.
Ex2:
Rating: 8.5
Microformats are the easiest to write and understand, but may not fill all your metadata needs. In particular, you may not find an appropriate vocabulary to represent your information.
Interesting facts about RDFa:
eRDF and RDFa allow you to work with any RDF or OWL vocabulary, and create your own vocabulary or reuse existing ones. eRDF is a subset of the full RDF model; for example, you can only make statements about the current page. RDFa offers all the features of RDF, making it the most complex of the three formalisms but also the most powerful one.
Source:
http://www.google.com/support/webmasters/bin/answer.py?answer=176035
Subscribe to:
Posts (Atom)