I know that I know nothing

Open multiple Eclipse workspaces on the Mac

clock November 9, 2014 21:29 by author Administrator

OS X Eclipse Launcher 2.0.0 plugin


Unsupported major.minor version 51.0

clock November 9, 2014 10:40 by author Administrator

The version number shown describes the version of the JRE the class file is compatible with.


J2SE 8=52,
J2SE 7=51,
J2SE 6.0=50,
J2SE 5.0=49,
JDK 1.4=48,
JDK 1.3=47,
JDK 1.2=46,
JDK 1.1=45

javac -target

apache ode start problem java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory

clock November 9, 2014 09:58 by author Administrator

If you are using Tomcat v.6 or v.7, you probably get the error


Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory
  at org.apache.catalina.startup.Bootstrap.<clinit>(
Caused by: java.lang.ClassNotFoundException: org.apache.juli.logging.LogFactory
  at Method)
  at java.lang.ClassLoader.loadClass(
  at sun.misc.Launcher$AppClassLoader.loadClass(
  at java.lang.ClassLoader.loadClass(
  at java.lang.ClassLoader.loadClassInternal(
  ... 1 more
Could not find the main class: org.apache.catalina.startup.Bootstrap. Program will exit.

Click on Open launch configuration → Classpath tab → Add External JARs → [your TOMCAT_DIR]\bin\tomcat-juli.jar. Then Ok.

@RequestHeader in Spring MVC

clock June 21, 2014 20:01 by author Administrator

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

public class RequestHeaderExampleController{
    @RequestMapping(value = "/example", method = RequestMethod.GET)
    public String  getHello(@RequestHeader ("host") String hostName,
            @RequestHeader ("Accept") String acceptType,
            @RequestHeader ("Accept-Language") String acceptLang,
            @RequestHeader ("Accept-Encoding") String acceptEnc,
            @RequestHeader ("Cache-Control") String cacheCon,
            @RequestHeader ("Cookie") String cookie,
            @RequestHeader ("User-Agent") String userAgent){
        System.out.println("Host : " + hostName);
        System.out.println("Accept : " + acceptType);
        System.out.println("Accept Language : " + acceptLang);
        System.out.println("Accept Encoding : " + acceptEnc);
        System.out.println("Cache-Control : " + cacheCon);
        System.out.println("Cookie : " + cookie);
        System.out.println("User-Agent : " + userAgent);
        return "example";

https test using certificate & keystore

clock June 13, 2014 20:58 by author Administrator





public class HttpsTest {
    public static void main(String[] args) {
        System.setProperty("", "pass");

        // full log for debugging
        System.setProperty("", "all");

        try {
            try {
                            public boolean verify(String hostname,
                           sslSession) {
                                if (hostname.equals("ansarrootca")) {
                                    return true;
                                return false;
                URL url = new URL("https://site:3443");
                InputStream is = url.openStream();
                BufferedReader in = new BufferedReader(new InputStreamReader(is));
                String inputLine = null;
                while ((inputLine = in.readLine()) != null)
            } catch (MalformedURLException e) {

        } catch (Exception e) {


using keystore & trust store in java

clock June 13, 2014 20:51 by author Administrator


add this code for run application that use  keystore


System.setProperty("", "pass");
System.setProperty("", "all");




disable java check for subject alternative names in certificate

clock June 13, 2014 20:41 by author Administrator

when i want to invoke https webservice by certificate(keystore.jks) .

i get this exception No subject alternative names present

ip of webservice is but certificate is created for

java check this in client and throw this exception 

i add host for  in my os and add this line in application

this code disable this check
                    public boolean verify(String hostname,
                   sslSession) {
                        if (hostname.equals("azizkhanihost")) {
                            return true;
                        return false;


add host in mac os

clock June 13, 2014 20:36 by author Administrator

sudo nano /private/etc/hosts

and add line like this

save and ..

sudo dscacheutil -flushcache



ping Cool

Import PKCS12 private keys into JKS keystores using Java Keytool

clock June 8, 2014 20:31 by author Administrator
  1. Create an empty JKS store
    keytool -genkey -alias alice -keystore alice.jks
    keytool -delete -alias alice -keystore alice.jks
  2. Import alice.p12 into alice.jks
    keytool -v -importkeystore -srckeystore alice.p12 -srcstoretype PKCS12 
    -destkeystore truststore.jks -deststoretype JKS

managing and examining keystores by (Portecle software)

clock June 8, 2014 20:24 by author Administrator

Portecle is a user friendly GUI application for creating, managing and examining keystores, keys, certificates, certificate requests, certificate revocation lists and more.

  • Create, load, save, and convert keystores.
  • Generate DSA and RSA key pair entries with self-signed version 1 X.509 certificates.
  • Import X.509 certificate files as trusted certificates.
  • Import key pairs from PKCS #12 and PEM bundle files.
  • Clone and change the password of key pair entries and keystores.
  • View the details of certificates contained within keystore entries, certificate files, and SSL/TLS connections.
  • Export keystore entries in a variety of formats.
  • Generate and view certification requests (CSRs).
  • Import Certificate Authority (CA) replies.
  • Change the password of key pair entries and keystores.
  • Delete, clone, and rename keystore entries.
  • View the details of certificate revocation list (CRL) files.

About the author

 Welcome to this web site . This page has two purposes: Sharing information about my professional life such as articles, presentations, etc.
This website is also a place where I would like to share content I enjoy with the rest of the world. Feel free to take a look around, read my blog

Java,J2EE,Spring Framework,JQuery,

Hibernate,NoSql,Cloud,SOA,Rest WebService and Web Stack tech...


Month List

Sign In