Jdk1.2.1 on windows xp

i have a problem with javac command in command prompt.It always gives me the windows error message telling me that "javac.exe encountered a problem,sorry for the inconvience"
is it because jdk1.2.1 is compatible with windowsxp or is it because of windowsxp or jdk problem.
This same jdk1.2.1 is working on windows98.

Hello sudhir_ptl1,
If you are having problems getting jdk1.2.1 working with windowsXP, you can go ahead and try 1.3.1. I have included below the link to download jdk1.3.1 for the Intel platform.
http://java.sun.com/j2se/1.3/download-windows.html
Under the "Installation" notes, it specifies support for Windows XP, so it should work.
Hope this helps,
Ming
Developer Technical Support
http://www.sun.com/developers/support

Similar Messages

  • Error while installing jdk1.5.07 on Windows 2000.(data1.cab file missing or

    I am unable to install jdk1.5.0.07/jdk1.5.0.11and while Copying files this error is generated.
    "Data1.cab file is missing or corrupt.". I have tried to download the same from Sun's download centre as offline installation.
    Please suggest a solution.
    Regards,
    Neha Shrivastava

    I have tried downloading it again and also used the installer which was successfully able to install on Windows XP.
    Also, a few days back I was able to install jdk1.5.0.07 but then my system was attacked by some trojan and I had to format it. Since then I am unable to install it using the same exe.

  • Problem when installing JDK1.4.2_07 ?

    Hai .....,
    I have recently downloaded JDK1.4.2_07 for windows platform. I 'm running Windows XP SP2. When i try to run the exe i dwonloaded, I get the following error under the DOS prompt:
    "Program too big to fit in memory"
    Please help me to fix this problem
    Thanx and Regards,
    Hemant

    Hai jgalacambra,
    Are u sure If i download it again, there won't be a problem. Coz it's a 50 MB stuff which really makes me sick to get it downloaded again. Have you faced the same problem. Please Reply me immdly, if that is the actual problem...
    Thanx and Regards,
    Hemant

  • Display Problem with RowHeader of a Scroll Pane

    Hi,
    I am trying to display row headers for a table using another table
    Here is the code
    import javax.swing.*;
    import javax.swing.table.*;
    public class RowNumberHeader extends JTable {
      protected JTable mainTable;
      public RowNumberHeader(JTable table) {
        super();
        mainTable = table;
        setModel(new RowNumberTableModel());
        setRowSelectionAllowed(false);
        JComponent renderer = (JComponent)getDefaultRenderer(Object.class);
      public int getRowHeight(int row) {
        return mainTable.getRowHeight();
      class RowNumberTableModel extends AbstractTableModel {
        public int getRowCount() {
          return mainTable.getModel().getRowCount();
        public int getColumnCount() {
          return 1;
        public Object getValueAt(int row, int column) {
          return new Integer(row + 1);
    }and then
            JTable displayTable = new JTable(...);
            scrollPane = new JScrollPane(displayTable);
            JViewport jvp = new JViewport();
            jvp.setView(new RowNumberHeader(displayTable));
            scrollPane.setRowHeader(jvp);the problem I have is that when a row is selected inside the row header, some rows go blank and you can see the selection is all screwed up. I tried setting the selection mode to ListSelectionModel.SINGLE_SELECTION but that didn't help.
    A refresh of the entire screen (minimize/maximize) seems to resolve the problem. I am using jdk1.4.1 in Windows 2000.
    Any ideas?
    Sylvain

    Again the problem is that when you click on the row headers, some row header rows go blank (completely white) so you can't see what they show.
    ie say I have table
    Row 1 - 1  2  3
    Row 2 - 2  4  5
    Row 3 - 5  7  7
    Row 4 - 5  6  7where Row X is the row header. So for example, if you click on Row 2, you will get something like
    Row 1 - 1  2  3
    Row 2 - 2  4  5
          - 5  7  7
    Row 4 - 5  6  7until the screen is refreshed or you click some other row header.
    hmm ok, I added calling repaint on the table whenever a row is selected and at least the display problem goes away; however, the selected indexes from the event don't always match the index of the row selected. I think actually that may be the source of the display problem.
    Here is the code I added in the constructor:
            getSelectionModel().addListSelectionListener(new ListSelectionListener()
                public void valueChanged(ListSelectionEvent e)
                    System.out.println("Header table selection is: First = " + e.getFirstIndex() +
                                       " Last = " + e.getLastIndex());
                    RowNumberHeader.this.repaint();
            });

  • Reading & writing to file using ArrayList String incorrectly (2)

    I have been able to store two strings (M44110|T33010, M92603|T10350) using ArrayList<String>, which represent the result of some patient tests. Nevertheless, the order of these results have been stored correctly.
    E.g. currently stored in file Snomed-Codes as -
    [M44110|T33010, M92603|T10350][M44110|T33010, M92603|T10350]
    Should be stored and printed out as -
    M44110|T33010
    M92603|T10350
    Below is the detail of the source code of this program:
    import java.io.*;
    import java.io.IOException;
    import java.lang.String;
    import java.util.regex.*;
    import java.util.ArrayList;
    public class FindSnomedCode {
        static ArrayList<String> allRecords = new ArrayList<String>();
        static public ArrayList<String> getContents(File existingFile) {
            StringBuffer contents = new StringBuffer();
            BufferedReader input = null;
            int line_number = 0;
            int number_of_records = 0;
            String snomedCodes = null;
            ArrayList<String> complete_records = new ArrayList<String>();
            try {
                input = new BufferedReader( new FileReader(existingFile) );
                String current_line = null;
                while (( current_line = input.readLine()) != null) {
                    // Create a pattern to match for the "\"
                    Pattern p = Pattern.compile("\\\\");
                    // Create a matcher with an input string
                    Matcher m = p.matcher(current_line);
                    boolean beginning_of_record = m.find();
                    if (beginning_of_record) {
                        line_number = 0;
                        number_of_records++;
                    } else {
                        line_number++;
                    if ( (line_number == 2) && (current_line.length() != 0) ) {
                        snomedCodes = current_line;
                        System.out.println(snomedCodes);
                        complete_records.add(current_line);
            catch (FileNotFoundException ex) {
                ex.printStackTrace();
            catch (IOException ex){
                ex.printStackTrace();
            finally {
                try {
                    if (input!= null) {
                        input.close();
                catch (IOException ex) {
                    ex.printStackTrace();
            return complete_records;
        static public void setContents(File reformatFile, ArrayList<String> snomedCodes)
                                     throws FileNotFoundException, IOException {
           Writer output = null;
            try {
                output = new BufferedWriter( new FileWriter(reformatFile) );
                  for (String index : snomedCodes) {
                      output.write( snomedCodes.toString() );
            finally {
                if (output != null) output.close();
        static public void printContents(File existingFile) {
            StringBuffer contents = new StringBuffer();
            BufferedReader input = null;
            int line_number = 0;
            int number_of_records = 0;
            String snomedCodes = null;
            try {
                input = new BufferedReader( new FileReader(existingFile) );
                String current_line = null;
                while (( current_line = input.readLine()) != null)
                    System.out.println(current_line);
            catch (FileNotFoundException ex) {
                ex.printStackTrace();
            catch (IOException ex){
                ex.printStackTrace();
            finally {
                try {
                    if (input!= null) {
                        input.close();
                catch (IOException ex) {
                    ex.printStackTrace();
        public static void main (String args[]) throws IOException {
            File currentFile = new File("D:\\dummy_patient.txt");
            allRecords = getContents(currentFile);
            File snomedFile = new File( "D:\\Snomed-Codes.txt");
            setContents(snomedFile, allRecords);
            printContents(snomedFile);
    }There are 4 patient records in the dummy_patient.txt file but only the 1st (M44110|T33010) & 3rd (M92603|T10350) records have results in them. The 2nd & 4th records have blank results.
    Lastly, could someone explain to me the difference between java.util.List & java.util.ArrayList?
    I am running Netbeans 5.0, jdk1.5.0_09 on Windows XP, SP2.
    Many thanks,
    Netbeans Fan.

    while (snomedCodes.iterator().hasNext())
      output.write( snomedCodes.toString() );
    }Here you have some kind of a list or something (I couldn't stand to read all that unformatted code but I suppose you can find out). It has an iterator which gives you the entries of the list one at a time. You keep asking if it has more entries -- which it does -- but you never get those entries by calling the next() method, so it always has all the entries still available.
    And your code inside the loop is independent of the iterator, so it's rather pointless to iterate over the entries and output exactly the same data for each entry. Even if you were iterating correctly.

  • How to run a Java applet on a website.

    Hi,
    I am trying to run the code below [DrawLines.java|http://www.dgp.toronto.edu/~mjmcguff/learn/java/01-drawingLines/]
    import java.applet.*;
    import java.awt.*;
    public class DrawingLines extends Applet {
       int width, height;
       public void init() {
          width = getSize().width;
          height = getSize().height;
          setBackground( Color.black );
       public void paint( Graphics g ) {
          g.setColor( Color.green );
          for ( int i = 0; i < 10; ++i ) {
             g.drawLine( width, height, i * width / 10, 0 );
    on my website . I compiled it using JDK1.6.0_21 on Windows 7 and generated DrawingLines.class (My site is hosted on a linux server, is this an issue since it was compiled on Windows?)
    I created a html file:
    <applet width=300 height=300 code="/shanegibney/classes/DrawingLines.class"> </applet>Then I created a new folder called 'classes' in my public directory.
    I get the following error:
    java.lang.NoClassDefFoundError: /shanegibney/classes/DrawingLines (wrong name: DrawingLines)
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClassCond(Unknown Source)
         at java.lang.ClassLoader.defineClass(Unknown Source)
         at java.security.SecureClassLoader.defineClass(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Exception: java.lang.NoClassDefFoundError: /shanegibney/classes/DrawingLines (wrong name: DrawingLines)I'm sure adding a java applet is very common. Does anyone have any ideas why this isn't working? It can be seen here .
    Any help would be greatly appreciated,
    Thanks,
    Shane
    Edited by: ofey on Jul 9, 2010 4:21 PM

    I believe it's interpreting some of the code attribute as a path. Try this:
    <applet width=300 height=300 codebase="/shanegibney/classes/" code="DrawingLines"> </applet>

  • Steps to upgrade the FMW 11.1.1.4 to 11.1.1.6

    I plan to upgrade the FMW 11.1.1.4 to 11.1.1.6 ,Weblogic 10.3.4 to 10.3.6 and jrockit-jdk1.6.0_31 in windows 32 bit enviornment.
    Can anybody send me the steps to how to upgrade this.
    Thanks in advance.

    Oracle Fusion Middleware Upgrade needs the right patch set(PS) application to the environment. Oracle Fusion Middleware Patchsets (Patchset 2 onwards) are cumulative. For example: If you would like to upgrade Oracle HTTP Server 11g Release1 Patchset 3 (11.1.1.4.0) to PS5 11.1.1.6, you do NOT have to apply 11.1.1.5.0 and 11.1.1.6.0, rather you can directly apply 11.1.1.6.0 on top of 11.1.1.4.0.
    Likewise, Oracle Fusion Middleware 11g Release 1 Patchset 5(11.1.1.6.0) can be applied to the following existing Oracle Fusion Middleware installations: 11.1.1.2.0, 11.1.1.3.0, 11.1.1.4.0, or 11.1.1.5.0. If you are currently using Oracle Fusion Middleware 11g Release 1 (11.1.1.1.0), then you must first update your environment to Oracle Fusion Middleware 11g Release 1 (11.1.1.2.0) before applying 11g Release 1 (11.1.1.6.0). Some of the new names are confusing, so, here the name again.
    Oracle Fusion Middleware 11g Release1 Patchset 5 (PS5) = 11.1.1.6.0
    Oracle Fusion Middleware 11g Release1 Patchset 4 (PS4) = 11.1.1.5.0
    Oracle Fusion Middleware 11g Release1 Patchset 3 (PS3) = 11.1.1.4.0
    Oracle Fusion Middleware 11g Release1 Patchset 2 (PS2) = 11.1.1.3.0
    Oracle Fusion Middleware 11g Release1 Patchset 1 (PS1) = 11.1.1.2.0

  • Getting this error :NB: JAVA_HOME should point to a JDK not a JRE

    HI All
    I've installed jdk1.5.0_06 in windows enviroment.i've correctly set the java_home path for it.
    Apart from it i've installed two servers one is Weblogic 9.1 and Tomcat 5.5 and NetBeans 5.5.1.
    While running my project with the netbeans it tried to start the server. On starting the Tomcat server it showed me this error in the Tomcat log.
    NB: JAVA_HOME should point to a JDK not a JRE
    but while running Weblogic it worked smoothly. the java_home path has both the paths of jdk1.5 (installed separatly ) and the one which is bundeled with weblogic(jdk1.5)
    Could anyone tell me the solution for the error.while running the project sseparatly is working fine. but i am not able to run it from NetBeans.

    By why it is so that we bin folder was not selected,
    because when i earlier installed weblogic then at
    that time weblogic automatically made this entry
    using its own internal jdk and the path was till bin.A JAVA_HOME directory should point to a directory containing all the java related stuff. The bin part is appended while executing javac or java command. Weblogic might be using the JAVA_HOME variable differently.

  • Mapping of PLSQL  table type  Date to java

    i am having problem in mapping plsql table type DATE in java,
    able to execute procedures which return plsql table type NUMBER,VARCHAR.
    i am using oracle 9 , jdk1.4, oci driver, windows 2000.
    sample code:
    registering:
    st.registerIndexTableOutParameter(15,100,OracleTypes.DATE,1000);
    st.registerIndexTableOutParameter(16,100,OracleTypes.DATE,1000);
    st.execute();
    getting out params in arrays:
    java.sql.Date[] O_lSubFolder_CrOn=(java.sql.Date[])java.sql.Date[] st.getPlsqlIndexTable(15);
    O_lSubFolder_MdOn=(java.sql.Date[])st.getPlsqlIndexTable(16);
    error while executing the code:
    java.sql.SQLException: Invalid PL/SQL Index Table element type
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:222)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:285)
    at oracle.jdbc.driver.OraclePreparedStatement.checkPlsqlIndexTableBindTypes(OraclePreparedSt
    atement.java:2705)
    at oracle.jdbc.driver.OracleCallableStatement.registerIndexTableOutParameter(OracleCallableS
    tatement.java:834)
    can anyone help me to solve this problem.

    i am having problem in mapping plsql table type
    DATE in java,
    able to execute procedures which return plsql table
    type NUMBER,VARCHAR.
    i am using oracle 9 , jdk1.4, oci driver, windows
    2000.
    sample code:
    registering:
    st.registerIndexTableOutParameter(15,100,OracleTypes.D
    TE,1000);
    st.registerIndexTableOutParameter(16,100,OracleTypes.D
    TE,1000);
    st.execute();
    getting out params in arrays:
    java.sql.Date[]
    O_lSubFolder_CrOn=(java.sql.Date[])java.sql.Date[]
    st.getPlsqlIndexTable(15);
    O_lSubFolder_MdOn=(java.sql.Date[])st.getPlsqlIndexTab
    e(16);
    can anyone help me to solve this problem.1. Write a wrapper procedure that converts the table of dates to either number or date and then re-convert the table back into date.
    2. Since it's an out param you could create a temp table, insert the contents of the index by array into it and return a cursor.
    3. Create a oracle type using CREATE TYPE and then use an array of the type.
    David Rolfe
    Orinda Software

  • Import javax.crypto not found error

    Hi,
    I have just installed the JDK1.7 on a windows machine.
    Whenever I try to compile my module, I get an error on the import javax.crypto line. It tells me that it can't the javax\Crypto\Cipher.class.
    I have the jdk installed on d:\glassfish3 and am pointing the classpath to d:\glassfish3\jdk7 (also tried d:\glassfish3\jdk7\jre as well) with no luck.
    Any help would be greatly appreciated.
    Thanks,
    Drew Nathanson
    Technical Synergy, Inc.

    Thanks. Maybe I should explain a little better.
    I am using JBuilder 2006 to my IDE. This environment requires that you put in the path to the JRE/JDK.
    I have uninstalled and downloaded the jdk again and this time i'm getting a strange error:
    "test.java": cannot access javax.crypto.Cipher; bad class file: D:\Program Files\Java\jre7\lib\jce.jar\javax\crypto\Cipher.class, class file has wrong version 51.0, should be 49.0, Please remove or make sure it appears in the correct subdirectory of the classpath. at line 19, column 21
    Now this is strange because i'm using the right library.
    Is there something that I'm missing here?
    Again, thanks for your help.
    Drew Nathanson

  • OutOfMemoryError in 1.4.1, not in 1.3.1

    I'm having trouble diagnosing an OutOfMemoryError in my application and I would like to double-check my assumptions here, if I may. I apologize in advance for the length of this post... I figured the more information the better.
    The situation is this:
    When running the application, it will eventually generate an OutOfMemoryError.
    The OutOfMemoryError always happens during garbage collection and there is plenty of collectable garbage. What I mean to suggest is that I did not actually run out of memory.
    If I specify the minimum heap size to be larger than default (equal to the max heap size at the extreme), I effectively increase the space allowed for allocation before a garbage collection which makes for a longer garbage collection which causes the error to occur much more quickly - usually within the first 3 garbage collections.
    I am currently testing with the Windows JDK1.4.1 on Windows 2000/SP3.
    My expectation (I have not verified this yet, perhaps someone here can confirm this) is that the JVM is supposed to guarantee that any time an allocation is attempted that, if there isn't enough memory available on the heap, the GC will run and attempt to give me my memory before it throws an error. I do not believe that this is what is happening.
    The application uses several threads and my belief is that this must be some sort of race condition, incorrect or incomplete synchronization. When the OutOfMemoryError occurs during the collection, I will get anywhere from 1 to 11 (so far) threads reporting the error.
    The reason I really don't think I'm running out of memory is based on observing the output of a profiler (OptimizeIt). I start with "-Xms192m -Xmx192m". Heap usage starts out at a nominal value of 15m. Application runs under load, eventually usage gets to within 1K of the limit and a "Full GC" begins. The first couple of times, memory usage drops back to the starting value of 15m. Then it fails. Either I "sprung" a really big leak or there is some other problem.
    I have observed that, when running under 1.3.1, the GC runs while there is a LOT more room before reaching the heap limit. For example, in this case it will run when heap usage reaches around 180m. I have also noticed that, when running "-verbose:gc -XX:+PrintGCDetails", it appears that there is never a non-Full GC.
    If anyone has any suggestions on where to look for this problem, I'm all ears. I've used a profiler to determine where most of the allocations are occuring, but that just doesn't help. I'm not really running out of memory, this could be a single byte allocation for all I know that's happening when it shouldn't. I can't believe that it's a VM bug or I would have heard more about it.

    Well, as I mentioned, I am starting at only 15m of heap usage. I then climb to 192m and drop back down to 15m after the collection. Even under load, my baseline memory usage is only about 32m. There is a lot of temporary creation (I've done a lot to reduce it, which has helped, but still quite a bit).
    The duration of the GC appears to be part of the equation. If the GC lasts a long time, it is more likely to happen.
    Maybe I should also point out this: If, rather than specify "-Xms192m -Xmx192m", I use "-Xms128m -Xmx192m", I may get an OutOfMemoryError before heap size even grows to 192m.

  • Using Swing Parser locks up.

    I'm using the Swing Parser class to read all the text content of an HTML page off the web.
    I override the parse() method. I then setup my URL connection and setup my BufferedReader, and then I call super.parse(br);
    I run this code every 5 seconds in a thread. After some time my java.exe process consumes almost 100% of my CPU and my java program is blocked.
    It seems to me that my program is locking up somwhere inside the super class method parse().
    I'm open to any advice or suggestions. I'm using jdk1.3.1_01 and windows xp. I know XP isn't exactly Java friendly. I'm not sure if that is the cause.
    Any help or advice is gretly appreciated.

    Here is my entire program. I re-read the Swing article on HTML and as you can see, there is minimal code here.
    Could it be that the particular web site I'm trying to visit maybe denies me access if I keep hitting it?
    After awhile my java process stops running and is in some kind of loop and uses 90+% cpu.
    Thanks for any insight.
    import java.util.*;
    import javax.swing.text.html.parser.*;
    import javax.swing.text.html.parser.*;
    import java.util.Hashtable;
    import javax.swing.text.html.HTML.*;
    import javax.swing.text.html.HTMLEditorKit;
    public class HTMLToString {
         ArrayList     htmlTextContent;
         public Object[] getHtmlTextContent(String url) {
              htmlTextContent = new ArrayList();
              parse(url);
              return     htmlTextContent.toArray();
    // note: url can also just be a file name:
    public boolean parse(String addr) {
         HTMLEditorKit.ParserCallback callback = new HTMLEditorKit.ParserCallback () {
                                                                          public void handleText(char[] data, int pos) {
                                                                               //System.out.println("Test");
                                                                               htmlTextContent.add((String) new String(data));
                                                                               //System.out.println(data);
              try
              URL url = new URL(addr);
    URLConnection uconn = url.openConnection();
                   InputStream is = uconn.getInputStream();
                   InputStreamReader isr = new InputStreamReader(is);
                   new ParserDelegator().parse(isr, callback, false);
              catch (IOException ioe)
                   System.out.println(ioe);
              return true;
         public static void main(String[] argv) {
              HTMLToString hts;//= new HTMLToString();
              while(true) {
              try
                        hts = new HTMLToString();
                        Object[] page = hts.getHtmlTextContent("http://www.jossh.com/database/inventory/Solrain_Core.html");
                        Thread.sleep(100);
                        System.out.println("Html Read\n");
              catch (InterruptedException ie)

  • Handshake failure

    Hello everyone
    here iam struggling with a problem, of handshake failure. the synoptical story is
    1. I am developing a java client to connect a payware merchant server at a port 3443 through SSL, with package JSSE from JDK1.4.1 on windows 2000 using socket API.
    2. I got the two server certificates namely ca.pem and client.pem. I feel these are server's public key and CA key. Is it right? I have to keep these certificates in the client's keystore. Here itself, i feel the problem is. How to create a keystore for adding these certificates at client's machine using keytool.
    a) If i create using "keytool -genkey" and there after, i try
    to add above certificates, i am getting the exceptions,
    and not adding these certificates.
    3. here i don't want to have client side certificates, i.e one way handshaking, or in otherwards, it is server authentication only.
    4. after this process i am using below code and trying to contact, iam getting the handshake failure exception, why I unable to resolve this.
    the code i am using:
    import java.net.*;
    import java.io.*;
    import javax.net.ssl.*;
    import javax.net.ssl.*;
    import java.security.cert.X509Certificate;
    import java.security.cert.*;
    import java.security.KeyStore;
    * This example demostrates how to use a SSLSocket as client to
    * send a request through SSL socket and get response from a server developed
    * in C++. Communication through the SSL layers.
    * It assumes that the client is not behind a firewall
    public class TestSocketClient {
    public static void main(String[] args) throws Exception {
         try {
    // System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.internal.www.protocol");
    // java.security.Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
                        System.setProperty("javax.net.debug","SSL");
    System.setProperty("javax.net.ssl.TrustStore","testkeys");
    System.setProperty("javax.net.ssl.TrustStorePassword","passphrase");
                        KeyManagerFactory kmf = KeyManagerFactory.getInstance("SUNX509");
                        KeyStore ks = KeyStore.getInstance("JKS");
                        char[] pass = "passphrase".toCharArray();
                        ks.load(new FileInputStream("testkeys"),pass);
                        kmf.init(ks,pass);
                        TrustManagerFactory tmf = TrustManagerFactory.getInstance("SUNX509");
                        X509TrustManager xtm =new MyX509TrustManager();
                        TrustManager[] tm = {xtm};
                        tmf.init(ks);
                        SSLContext context = SSLContext.getInstance("SSL");
                        java.security.SecureRandom sr = new java.security.SecureRandom();
                        context.init(kmf.getKeyManagers(),tm,sr);
                        SSLSocketFactory sslfactory = context.getSocketFactory();
    /*          SSLSocketFactory factory =
              (SSLSocketFactory)SSLSocketFactory.getDefault();
         SSLSocket socket =
    (SSLSocket)sslfactory.createSocket("10.0.0.20",3443);
         //     socket.setNeedClientAuth(true);
    String[] protocols = {"SSLv3","TLSv1"};
    socket.setEnabledProtocols(protocols);
                   //     socket.setEnabledCipherSuites(socket.getSupportedCipherSuites());
    OutputStream os;
    System.out.println("socket is created.");
         * send http request
         * Before any application data is sent or received, the
         * SSL socket will do SSL handshaking first to set up
         * the security attributes.
         * SSL handshaking can be initiated by either flushing data
         * down the pipe, or by starting the handshaking by hand.
         * Handshaking is started manually in this example because
         * PrintWriter catches all IOExceptions (including
         * SSLExceptions), sets an internal error flag, and then
         * returns without rethrowing the exception.
         * Unfortunately, this means any error messages are lost,
         * which caused lots of confusion for others using this
         * code. The only way to tell there was an error is to call
         * PrintWriter.checkError().
    System.out.println(" just before handshake ");
    // socket.setNeedClientAuth(false);
    // socket.startHandshake();
    // System.out.println(" Hand shake is completed ");
         PrintWriter out = new PrintWriter(
    socket.getOutputStream());
    System.out.println(" print writer object is created ");
    String s="GET http://www.verisign.com/index.html HTTP/1.1";
    byte[] b1=s.getBytes("ISO-8859-1");
    // out.println("GET http://www.verisign.com/index.html HTTP/1.1");
    // os.write(b1);
    out.print(b1);
                   System.out.println(" print is created ");
         out.flush();
              BufferedReader in = new BufferedReader(
                        new InputStreamReader(
                        socket.getInputStream()));
    String inputLine=null;
    System.out.println("The input line is: "+inputLine);
         while ((inputLine = in.readLine()) != null) {
              System.out.println("Received messages from here.");
              System.out.println(inputLine);
    // out.close();
    System.out.println(" output is trying to flushing the data ");
         * Make sure there were no surprises
         if (out.checkError())
              System.out.println(
              "SSLSocketClient: java.io.PrintWriter error");
         /* read response */
         in.close();
         out.close();
         socket.close();
         } catch (Exception e) {
    System.out.println(" the exception is "+e);
    e.printStackTrace();
                        System.exit(0);
    debugging information:
    ---------- Run the application ----------
    found key for : duke
    chain [0] = [
    Version: V1
    Subject: CN=Duke, OU=Java Software, O="Sun Microsystems, Inc.", L=Cupertino, ST=CA, C=US
    Signature Algorithm: MD5withRSA, OID = 1.2.840.113549.1.1.4
    Key: com.sun.net.ssl.internal.ssl.JSA_RSAPublicKey@d520c4
    Validity: [From: Wed May 23 02:46:46 GMT+03:00 2001,
                   To: Mon May 23 02:46:46 GMT+03:00 2011]
    Issuer: CN=Duke, OU=Java Software, O="Sun Microsystems, Inc.", L=Cupertino, ST=CA, C=US
    SerialNumber: [    3b0afa66 ]
    Algorithm: [MD5withRSA]
    Signature:
    0000: 5F B5 62 E9 A0 26 1D 8E A2 7E 7C 02 08 36 3A 3E _.b..&.......6:>
    0010: C9 C2 45 03 DD F9 BC 06 FC 25 CF 30 92 91 B1 4E ..E......%.0...N
    0020: 62 17 08 48 14 68 80 CF DD 89 11 EA 92 7F CE DD b..H.h..........
    0030: B4 FD 12 A8 71 C7 9E D7 C3 D0 E3 BD BB DE 20 92 ....q......... .
    0040: C2 3B C8 DE CB 25 23 C0 8B B6 92 B9 0B 64 80 63 .;...%#......d.c
    0050: D9 09 25 2D 7A CF 0A 31 B6 E9 CA C1 37 93 BC 0D ..%-z..1....7...
    0060: 4E 74 95 4F 58 31 DA AC DF D8 BD 89 BD AF EC C8 Nt.OX1..........
    0070: 2D 18 A2 BC B2 15 4F B7 28 6F D3 00 E1 72 9B 6C -.....O.(o...r.l
    adding as trusted cert: [
    Version: V1
    Subject: ST=Dublin, L=Leopardstown, OU=Banking Support, O=Trintech Technologies, CN=trintech.com, C=IE
    Signature Algorithm: MD5withRSA, OID = 1.2.840.113549.1.1.4
    Key: com.sun.net.ssl.internal.ssl.JSA_RSAPublicKey@749757
    Validity: [From: Fri Aug 23 13:05:43 GMT+03:00 2002,
                   To: Sun Sep 22 13:05:43 GMT+03:00 2002]
    Issuer: CN=TEST RSA CERTIFICATION AUTHORITY - FOR INTERNAL TESTING PURPOSES ONLY - NO LIABILITY, OU=Banking Division, O=Trintech Technologies Ltd, L=Dublin, ST=County Dublin, C=IE
    SerialNumber: [    f0]
    Algorithm: [MD5withRSA]
    Signature:
    0000: 7F 7A 9C F6 9D 6D AF AF 2D D4 4F 92 39 4E 95 9B .z...m..-.O.9N..
    0010: 2C 50 76 59 BB E1 27 02 86 DC DB 72 99 7C 97 11 ,PvY..'....r....
    0020: 11 36 97 F3 53 E0 68 DB A9 98 B7 94 EF 17 6D 91 .6..S.h.......m.
    0030: 81 14 FE B6 33 7C 60 CA 13 12 13 EB 75 E7 23 0C ....3.`.....u.#.
    0040: A5 AB 6D F5 0B A2 DA B6 12 DD 48 43 4C AC 80 79 ..m.......HCL..y
    0050: 7F EF 98 E7 5A 67 D5 20 C8 91 C2 32 10 F4 F8 02 ....Zg. ...2....
    0060: B8 44 45 AC 45 24 57 12 60 12 03 6F 9C 50 CB D4 .DE.E$W.`..o.P..
    0070: 8F C5 E5 FB AE 44 0B BC D1 F3 A8 EE 78 64 C0 CF .....D......xd..
    adding private entry as trusted cert: [
    Version: V1
    Subject: CN=Duke, OU=Java Software, O="Sun Microsystems, Inc.", L=Cupertino, ST=CA, C=US
    Signature Algorithm: MD5withRSA, OID = 1.2.840.113549.1.1.4
    Key: com.sun.net.ssl.internal.ssl.JSA_RSAPublicKey@d520c4
    Validity: [From: Wed May 23 02:46:46 GMT+03:00 2001,
                   To: Mon May 23 02:46:46 GMT+03:00 2011]
    Issuer: CN=Duke, OU=Java Software, O="Sun Microsystems, Inc.", L=Cupertino, ST=CA, C=US
    SerialNumber: [    3b0afa66 ]
    Algorithm: [MD5withRSA]
    Signature:
    0000: 5F B5 62 E9 A0 26 1D 8E A2 7E 7C 02 08 36 3A 3E _.b..&.......6:>
    0010: C9 C2 45 03 DD F9 BC 06 FC 25 CF 30 92 91 B1 4E ..E......%.0...N
    0020: 62 17 08 48 14 68 80 CF DD 89 11 EA 92 7F CE DD b..H.h..........
    0030: B4 FD 12 A8 71 C7 9E D7 C3 D0 E3 BD BB DE 20 92 ....q......... .
    0040: C2 3B C8 DE CB 25 23 C0 8B B6 92 B9 0B 64 80 63 .;...%#......d.c
    0050: D9 09 25 2D 7A CF 0A 31 B6 E9 CA C1 37 93 BC 0D ..%-z..1....7...
    0060: 4E 74 95 4F 58 31 DA AC DF D8 BD 89 BD AF EC C8 Nt.OX1..........
    0070: 2D 18 A2 BC B2 15 4F B7 28 6F D3 00 E1 72 9B 6C -.....O.(o...r.l
    adding as trusted cert: [
    Version: V3
    Subject: [email protected], CN=Thawte Server CA, OU=Certification Services Division, O=Thawte Consulting cc, L=Cape Town, ST=Western Cape, C=ZA
    Signature Algorithm: MD5withRSA, OID = 1.2.840.113549.1.1.4
    Key: com.sun.net.ssl.internal.ssl.JSA_RSAPublicKey@dfafd1
    Validity: [From: Thu Aug 01 03:00:00 GMT+03:00 1996,
                   To: Fri Jan 01 02:59:59 GMT+03:00 2021]
    Issuer: [email protected], CN=Thawte Server CA, OU=Certification Services Division, O=Thawte Consulting cc, L=Cape Town, ST=Western Cape, C=ZA
    SerialNumber: [    01]
    Certificate Extensions: 1
    [1]: ObjectId: 2.5.29.19 Criticality=true
    BasicConstraints:[
    CA:true
    PathLen:2147483647
    Algorithm: [MD5withRSA]
    Signature:
    0000: 07 FA 4C 69 5C FB 95 CC 46 EE 85 83 4D 21 30 8E ..Li\...F...M!0.
    0010: CA D9 A8 6F 49 1A E6 DA 51 E3 60 70 6C 84 61 11 ...oI...Q.`pl.a.
    0020: A1 1A C8 48 3E 59 43 7D 4F 95 3D A1 8B B7 0B 62 ...H>YC.O.=....b
    0030: 98 7A 75 8A DD 88 4E 4E 9E 40 DB A8 CC 32 74 B9 [email protected].
    0040: 6F 0D C6 E3 B3 44 0B D9 8A 6F 9A 29 9B 99 18 28 o....D...o.)...(
    0050: 3B D1 E3 40 28 9A 5A 3C D5 B5 E7 20 1B 8B CA A4 ;..@(.Z<... ....
    0060: AB 8D E9 51 D9 E2 4C 2C 59 A9 DA B9 B2 75 1B F6 ...Q..L,Y....u..
    0070: 42 F2 EF C7 F2 18 F9 89 BC A3 FF 8A 23 2E 70 47 B...........#.pG
    adding as trusted cert: [
    Version: V3
    Subject: ST=Safat, L=Kuwait, OU=ISP, O=Qualitynet General Trading and Contracting Co., CN=Qualitynet.net, C=KW
    Signature Algorithm: MD5withRSA, OID = 1.2.840.113549.1.1.4
    Key: com.sun.net.ssl.internal.ssl.JSA_RSAPublicKey@a8c488
    Validity: [From: Tue Jan 08 17:48:01 GMT+03:00 2002,
                   To: Wed Jan 08 17:48:01 GMT+03:00 2003]
    Issuer: [email protected], CN=Thawte Server CA, OU=Certification Services Division, O=Thawte Consulting cc, L=Cape Town, ST=Western Cape, C=ZA
    SerialNumber: [    08b1fa]
    Certificate Extensions: 2
    [1]: ObjectId: 2.5.29.37 Criticality=false
    ExtendedKeyUsages [
    [1.3.6.1.5.5.7.3.1]]
    [2]: ObjectId: 2.5.29.19 Criticality=true
    BasicConstraints:[
    CA:false
    PathLen: undefined
    Algorithm: [MD5withRSA]
    Signature:
    0000: 01 26 CD A6 B4 88 69 68 31 99 44 6C CD 24 5E EE .&....ih1.Dl.$^.
    0010: 0D AD 1A 27 94 BC 17 9F 50 CE 22 99 84 29 8E 30 ...'....P."..).0
    0020: 74 38 DF 8E 24 35 83 10 7D CD 50 AC C3 5E C8 89 t8..$5....P..^..
    0030: 63 B5 02 B4 5B 9F D8 79 28 2B 8B 53 4A 5D 81 30 c...[..y(+.SJ].0
    0040: F0 72 53 5D 3D A9 31 75 1C 6F FC 92 9E 41 B9 A7 .rS]=.1u.o...A..
    0050: DC 2C 64 FA 17 65 79 83 A2 4D 04 73 C1 61 3E C5 .,d..ey..M.s.a>.
    0060: E6 4E 20 2A B1 68 FB D9 15 77 52 10 C1 C6 4E 95 .N *.h...wR...N.
    0070: 56 8E E3 7D C1 5F DE 20 14 BB D3 1F A3 8E 85 8D V...._. ........
    trigger seeding of SecureRandom
    done seeding SecureRandom
    socket is created.
    just before handshake
    print writer object is created
    print is created
    %% No cached client session
    *** ClientHello, v3.1
    RandomCookie: GMT: 987413342 bytes = { 254, 80, 236, 112, 44, 177, 113, 24, 240, 17, 19, 124, 170, 193, 156, 242, 6, 94, 107, 49, 236, 18, 211, 50, 196, 36, 58, 91 }
    Session ID: {}
    Cipher Suites: { 0, 5, 0, 4, 0, 9, 0, 10, 0, 18, 0, 19, 0, 3, 0, 17 }
    Compression Methods: { 0 }
    [write] MD5 and SHA1 hashes: len = 59
    0000: 01 00 00 37 03 01 3B DB BB 5E FE 50 EC 70 2C B1 ...7..;..^.P.p,.
    0010: 71 18 F0 11 13 7C AA C1 9C F2 06 5E 6B 31 EC 12 q..........^k1..
    0020: D3 32 C4 24 3A 5B 00 00 10 00 05 00 04 00 09 00 .2.$:[..........
    0030: 0A 00 12 00 13 00 03 00 11 01 00 ...........
    main, WRITE: SSL v3.1 Handshake, length = 59
    main, READ: SSL v3.0 Handshake, length = 74
    *** ServerHello, v3.0
    RandomCookie: GMT: 1019049914 bytes = { 146, 60, 74, 221, 254, 223, 224, 218, 86, 64, 214, 127, 32, 0, 235, 238, 181, 210, 212, 218, 141, 38, 198, 142, 110, 175, 146, 113 }
    Session ID: {1, 241, 227, 143, 175, 90, 192, 25, 155, 216, 173, 103, 159, 41, 90, 222, 86, 8, 76, 153, 122, 138, 88, 120, 112, 104, 65, 202, 147, 134, 163, 143}
    Cipher Suite: { 0, 10 }
    Compression Method: 0
    %% Created: [Session-1, SSL_RSA_WITH_3DES_EDE_CBC_SHA]
    ** SSL_RSA_WITH_3DES_EDE_CBC_SHA
    [read] MD5 and SHA1 hashes: len = 74
    0000: 02 00 00 46 03 00 3D BD 78 BA 92 3C 4A DD FE DF ...F..=.x..<J...
    0010: E0 DA 56 40 D6 7F 20 00 EB EE B5 D2 D4 DA 8D 26 ..V@.. ........&
    0020: C6 8E 6E AF 92 71 20 01 F1 E3 8F AF 5A C0 19 9B ..n..q .....Z...
    0030: D8 AD 67 9F 29 5A DE 56 08 4C 99 7A 8A 58 78 70 ..g.)Z.V.L.z.Xxp
    0040: 68 41 CA 93 86 A3 8F 00 0A 00 hA........
    main, READ: SSL v3.0 Handshake, length = 1561
    *** Certificate chain
    chain [0] = [
    Version: V3
    Subject: ST=Safat, L=Kuwait, OU=ISP, O=Qualitynet General Trading and Contracting Co., CN=Qualitynet.net, C=KW
    Signature Algorithm: MD5withRSA, OID = 1.2.840.113549.1.1.4
    Key: com.sun.net.ssl.internal.ssl.JSA_RSAPublicKey@d251a3
    Validity: [From: Tue Jan 08 17:48:01 GMT+03:00 2002,
                   To: Wed Jan 08 17:48:01 GMT+03:00 2003]
    Issuer: [email protected], CN=Thawte Server CA, OU=Certification Services Division, O=Thawte Consulting cc, L=Cape Town, ST=Western Cape, C=ZA
    SerialNumber: [    08b1fa]
    Certificate Extensions: 2
    [1]: ObjectId: 2.5.29.37 Criticality=false
    ExtendedKeyUsages [
    [1.3.6.1.5.5.7.3.1]]
    [2]: ObjectId: 2.5.29.19 Criticality=true
    BasicConstraints:[
    CA:false
    PathLen: undefined
    Algorithm: [MD5withRSA]
    Signature:
    0000: 01 26 CD A6 B4 88 69 68 31 99 44 6C CD 24 5E EE .&....ih1.Dl.$^.
    0010: 0D AD 1A 27 94 BC 17 9F 50 CE 22 99 84 29 8E 30 ...'....P."..).0
    0020: 74 38 DF 8E 24 35 83 10 7D CD 50 AC C3 5E C8 89 t8..$5....P..^..
    0030: 63 B5 02 B4 5B 9F D8 79 28 2B 8B 53 4A 5D 81 30 c...[..y(+.SJ].0
    0040: F0 72 53 5D 3D A9 31 75 1C 6F FC 92 9E 41 B9 A7 .rS]=.1u.o...A..
    0050: DC 2C 64 FA 17 65 79 83 A2 4D 04 73 C1 61 3E C5 .,d..ey..M.s.a>.
    0060: E6 4E 20 2A B1 68 FB D9 15 77 52 10 C1 C6 4E 95 .N *.h...wR...N.
    0070: 56 8E E3 7D C1 5F DE 20 14 BB D3 1F A3 8E 85 8D V...._. ........
    chain [1] = [
    Version: V3
    Subject: [email protected], CN=Thawte Server CA, OU=Certification Services Division, O=Thawte Consulting cc, L=Cape Town, ST=Western Cape, C=ZA
    Signature Algorithm: MD5withRSA, OID = 1.2.840.113549.1.1.4
    Key: com.sun.net.ssl.internal.ssl.JSA_RSAPublicKey@edc073
    Validity: [From: Thu Aug 01 03:00:00 GMT+03:00 1996,
                   To: Fri Jan 01 02:59:59 GMT+03:00 2021]
    Issuer: [email protected], CN=Thawte Server CA, OU=Certification Services Division, O=Thawte Consulting cc, L=Cape Town, ST=Western Cape, C=ZA
    SerialNumber: [    01]
    Certificate Extensions: 1
    [1]: ObjectId: 2.5.29.19 Criticality=true
    BasicConstraints:[
    CA:true
    PathLen:2147483647
    Algorithm: [MD5withRSA]
    Signature:
    0000: 07 FA 4C 69 5C FB 95 CC 46 EE 85 83 4D 21 30 8E ..Li\...F...M!0.
    0010: CA D9 A8 6F 49 1A E6 DA 51 E3 60 70 6C 84 61 11 ...oI...Q.`pl.a.
    0020: A1 1A C8 48 3E 59 43 7D 4F 95 3D A1 8B B7 0B 62 ...H>YC.O.=....b
    0030: 98 7A 75 8A DD 88 4E 4E 9E 40 DB A8 CC 32 74 B9 [email protected].
    0040: 6F 0D C6 E3 B3 44 0B D9 8A 6F 9A 29 9B 99 18 28 o....D...o.)...(
    0050: 3B D1 E3 40 28 9A 5A 3C D5 B5 E7 20 1B 8B CA A4 ;..@(.Z<... ....
    0060: AB 8D E9 51 D9 E2 4C 2C 59 A9 DA B9 B2 75 1B F6 ...Q..L,Y....u..
    0070: 42 F2 EF C7 F2 18 F9 89 BC A3 FF 8A 23 2E 70 47 B...........#.pG
    [read] MD5 and SHA1 hashes: len = 1561
    0000: 0B 00 06 15 00 06 12 00 02 F5 30 82 02 F1 30 82 ..........0...0.
    0010: 02 5A A0 03 02 01 02 02 03 08 B1 FA 30 0D 06 09 .Z..........0...
    0020: 2A 86 48 86 F7 0D 01 01 04 05 00 30 81 C4 31 0B *.H........0..1.
    0030: 30 09 06 03 55 04 06 13 02 5A 41 31 15 30 13 06 0...U....ZA1.0..
    0040: 03 55 04 08 13 0C 57 65 73 74 65 72 6E 20 43 61 .U....Western Ca
    0050: 70 65 31 12 30 10 06 03 55 04 07 13 09 43 61 70 pe1.0...U....Cap
    0060: 65 20 54 6F 77 6E 31 1D 30 1B 06 03 55 04 0A 13 e Town1.0...U...
    0070: 14 54 68 61 77 74 65 20 43 6F 6E 73 75 6C 74 69 .Thawte Consulti
    0080: 6E 67 20 63 63 31 28 30 26 06 03 55 04 0B 13 1F ng cc1(0&..U....
    0090: 43 65 72 74 69 66 69 63 61 74 69 6F 6E 20 53 65 Certification Se
    00A0: 72 76 69 63 65 73 20 44 69 76 69 73 69 6F 6E 31 rvices Division1
    00B0: 19 30 17 06 03 55 04 03 13 10 54 68 61 77 74 65 .0...U....Thawte
    00C0: 20 53 65 72 76 65 72 20 43 41 31 26 30 24 06 09 Server CA1&0$..
    00D0: 2A 86 48 86 F7 0D 01 09 01 16 17 73 65 72 76 65 *.H........serve
    00E0: 72 2D 63 65 72 74 73 40 74 68 61 77 74 65 2E 63 [email protected]
    00F0: 6F 6D 30 1E 17 0D 30 32 30 31 30 38 31 34 34 38 om0...0201081448
    0100: 30 31 5A 17 0D 30 33 30 31 30 38 31 34 34 38 30 01Z..03010814480
    0110: 31 5A 30 81 8E 31 0B 30 09 06 03 55 04 06 13 02 1Z0..1.0...U....
    0120: 4B 57 31 17 30 15 06 03 55 04 03 13 0E 51 75 61 KW1.0...U....Qua
    0130: 6C 69 74 79 6E 65 74 2E 6E 65 74 31 37 30 35 06 litynet.net1705.
    0140: 03 55 04 0A 13 2E 51 75 61 6C 69 74 79 6E 65 74 .U....Qualitynet
    0150: 20 47 65 6E 65 72 61 6C 20 54 72 61 64 69 6E 67 General Trading
    0160: 20 61 6E 64 20 43 6F 6E 74 72 61 63 74 69 6E 67 and Contracting
    0170: 20 43 6F 2E 31 0C 30 0A 06 03 55 04 0B 13 03 49 Co.1.0...U....I
    0180: 53 50 31 0F 30 0D 06 03 55 04 07 13 06 4B 75 77 SP1.0...U....Kuw
    0190: 61 69 74 31 0E 30 0C 06 03 55 04 08 13 05 53 61 ait1.0...U....Sa
    01A0: 66 61 74 30 81 9F 30 0D 06 09 2A 86 48 86 F7 0D fat0..0...*.H...
    01B0: 01 01 01 05 00 03 81 8D 00 30 81 89 02 81 81 00 .........0......
    01C0: B3 22 23 70 88 16 D8 60 DA A4 CF FF 87 57 54 69 ."#p...`.....WTi
    01D0: 53 66 7F 92 A5 38 80 EB E4 AB 12 68 72 AF 91 28 Sf...8.....hr..(
    01E0: 26 34 D6 E3 D4 F5 6C C2 69 A3 FF E6 DC 5F C9 A1 &4....l.i...._..
    01F0: D9 57 22 45 DB 7F 48 6B 6A 10 8C 85 0D 73 C4 0D .W"E..Hkj....s..
    0200: B8 18 5D 89 09 D6 D1 83 B6 1A CF 90 12 80 8B F0 ..].............
    0210: 0D 9D CD CC C0 7A 92 86 22 AD A6 EC 4A 57 D5 A2 .....z.."...JW..
    0220: 0C 27 C6 3D BC AC 34 6A 3F E6 EC 06 8C 59 8D 1A .'.=..4j?....Y..
    0230: 5E 55 9C 28 9B D9 EA 33 B0 D2 82 3B C8 83 02 B5 ^U.(...3...;....
    0240: 02 03 01 00 01 A3 25 30 23 30 13 06 03 55 1D 25 ......%0#0...U.%
    0250: 04 0C 30 0A 06 08 2B 06 01 05 05 07 03 01 30 0C ..0...+.......0.
    0260: 06 03 55 1D 13 01 01 FF 04 02 30 00 30 0D 06 09 ..U.......0.0...
    0270: 2A 86 48 86 F7 0D 01 01 04 05 00 03 81 81 00 01 *.H.............
    0280: 26 CD A6 B4 88 69 68 31 99 44 6C CD 24 5E EE 0D &....ih1.Dl.$^..
    0290: AD 1A 27 94 BC 17 9F 50 CE 22 99 84 29 8E 30 74 ..'....P."..).0t
    02A0: 38 DF 8E 24 35 83 10 7D CD 50 AC C3 5E C8 89 63 8..$5....P..^..c
    02B0: B5 02 B4 5B 9F D8 79 28 2B 8B 53 4A 5D 81 30 F0 ...[..y(+.SJ].0.
    02C0: 72 53 5D 3D A9 31 75 1C 6F FC 92 9E 41 B9 A7 DC rS]=.1u.o...A...
    02D0: 2C 64 FA 17 65 79 83 A2 4D 04 73 C1 61 3E C5 E6 ,d..ey..M.s.a>..
    02E0: 4E 20 2A B1 68 FB D9 15 77 52 10 C1 C6 4E 95 56 N *.h...wR...N.V
    02F0: 8E E3 7D C1 5F DE 20 14 BB D3 1F A3 8E 85 8D 00 ...._. .........
    0300: 03 17 30 82 03 13 30 82 02 7C A0 03 02 01 02 02 ..0...0.........
    0310: 01 01 30 0D 06 09 2A 86 48 86 F7 0D 01 01 04 05 ..0...*.H.......
    0320: 00 30 81 C4 31 0B 30 09 06 03 55 04 06 13 02 5A .0..1.0...U....Z
    0330: 41 31 15 30 13 06 03 55 04 08 13 0C 57 65 73 74 A1.0...U....West
    0340: 65 72 6E 20 43 61 70 65 31 12 30 10 06 03 55 04 ern Cape1.0...U.
    0350: 07 13 09 43 61 70 65 20 54 6F 77 6E 31 1D 30 1B ...Cape Town1.0.
    0360: 06 03 55 04 0A 13 14 54 68 61 77 74 65 20 43 6F ..U....Thawte Co
    0370: 6E 73 75 6C 74 69 6E 67 20 63 63 31 28 30 26 06 nsulting cc1(0&.
    0380: 03 55 04 0B 13 1F 43 65 72 74 69 66 69 63 61 74 .U....Certificat
    0390: 69 6F 6E 20 53 65 72 76 69 63 65 73 20 44 69 76 ion Services Div
    03A0: 69 73 69 6F 6E 31 19 30 17 06 03 55 04 03 13 10 ision1.0...U....
    03B0: 54 68 61 77 74 65 20 53 65 72 76 65 72 20 43 41 Thawte Server CA
    03C0: 31 26 30 24 06 09 2A 86 48 86 F7 0D 01 09 01 16 1&0$..*.H.......
    03D0: 17 73 65 72 76 65 72 2D 63 65 72 74 73 40 74 68 .server-certs@th
    03E0: 61 77 74 65 2E 63 6F 6D 30 1E 17 0D 39 36 30 38 awte.com0...9608
    03F0: 30 31 30 30 30 30 30 30 5A 17 0D 32 30 31 32 33 01000000Z..20123
    0400: 31 32 33 35 39 35 39 5A 30 81 C4 31 0B 30 09 06 1235959Z0..1.0..
    0410: 03 55 04 06 13 02 5A 41 31 15 30 13 06 03 55 04 .U....ZA1.0...U.
    0420: 08 13 0C 57 65 73 74 65 72 6E 20 43 61 70 65 31 ...Western Cape1
    0430: 12 30 10 06 03 55 04 07 13 09 43 61 70 65 20 54 .0...U....Cape T
    0440: 6F 77 6E 31 1D 30 1B 06 03 55 04 0A 13 14 54 68 own1.0...U....Th
    0450: 61 77 74 65 20 43 6F 6E 73 75 6C 74 69 6E 67 20 awte Consulting
    0460: 63 63 31 28 30 26 06 03 55 04 0B 13 1F 43 65 72 cc1(0&..U....Cer
    0470: 74 69 66 69 63 61 74 69 6F 6E 20 53 65 72 76 69 tification Servi
    0480: 63 65 73 20 44 69 76 69 73 69 6F 6E 31 19 30 17 ces Division1.0.
    0490: 06 03 55 04 03 13 10 54 68 61 77 74 65 20 53 65 ..U....Thawte Se
    04A0: 72 76 65 72 20 43 41 31 26 30 24 06 09 2A 86 48 rver CA1&0$..*.H
    04B0: 86 F7 0D 01 09 01 16 17 73 65 72 76 65 72 2D 63 ........server-c
    04C0: 65 72 74 73 40 74 68 61 77 74 65 2E 63 6F 6D 30 [email protected]
    04D0: 81 9F 30 0D 06 09 2A 86 48 86 F7 0D 01 01 01 05 ..0...*.H.......
    04E0: 00 03 81 8D 00 30 81 89 02 81 81 00 D3 A4 50 6E .....0........Pn
    04F0: C8 FF 56 6B E6 CF 5D B6 EA 0C 68 75 47 A2 AA C2 ..Vk..]...huG...
    0500: DA 84 25 FC A8 F4 47 51 DA 85 B5 20 74 94 86 1E ..%...GQ... t...
    0510: 0F 75 C9 E9 08 61 F5 06 6D 30 6E 15 19 02 E9 52 .u...a..m0n....R
    0520: C0 62 DB 4D 99 9E E2 6A 0C 44 38 CD FE BE E3 64 .b.M...j.D8....d
    0530: 09 70 C5 FE B1 6B 29 B6 2F 49 C8 3B D4 27 04 25 .p...k)./I.;.'.%
    0540: 10 97 2F E7 90 6D C0 28 42 99 D7 4C 43 DE C3 F5 ../..m.(B..LC...
    0550: 21 6D 54 9F 5D C3 58 E1 C0 E4 D9 5B B0 B8 DC B4 !mT.].X....[....
    0560: 7B DF 36 3A C2 B5 66 22 12 D6 87 0D 02 03 01 00 ..6:..f"........
    0570: 01 A3 13 30 11 30 0F 06 03 55 1D 13 01 01 FF 04 ...0.0...U......
    0580: 05 30 03 01 01 FF 30 0D 06 09 2A 86 48 86 F7 0D .0....0...*.H...
    0590: 01 01 04 05 00 03 81 81 00 07 FA 4C 69 5C FB 95 ...........Li\..
    05A0: CC 46 EE 85 83 4D 21 30 8E CA D9 A8 6F 49 1A E6 .F...M!0....oI..
    05B0: DA 51 E3 60 70 6C 84 61 11 A1 1A C8 48 3E 59 43 .Q.`pl.a....H>YC
    05C0: 7D 4F 95 3D A1 8B B7 0B 62 98 7A 75 8A DD 88 4E .O.=....b.zu...N
    05D0: 4E 9E 40 DB A8 CC 32 74 B9 6F 0D C6 E3 B3 44 0B [email protected].
    05E0: D9 8A 6F 9A 29 9B 99 18 28 3B D1 E3 40 28 9A 5A ..o.)...(;..@(.Z
    05F0: 3C D5 B5 E7 20 1B 8B CA A4 AB 8D E9 51 D9 E2 4C <... .......Q..L
    0600: 2C 59 A9 DA B9 B2 75 1B F6 42 F2 EF C7 F2 18 F9 ,Y....u..B......
    0610: 89 BC A3 FF 8A 23 2E 70 47 .....#.pG
    main, READ: SSL v3.0 Handshake, length = 210
    *** CertificateRequest
    Cert Types: RSA, DSS,
    Cert Authorities:
    <[email protected], CN=Thawte Server CA, OU=Certification Services Division, O=Thawte Consulting cc, L=Cape Town, ST=Western Cape, C=ZA>
    [read] MD5 and SHA1 hashes: len = 210
    0000: 0D 00 00 CE 02 01 02 00 C9 00 C7 30 81 C4 31 0B ...........0..1.
    0010: 30 09 06 03 55 04 06 13 02 5A 41 31 15 30 13 06 0...U....ZA1.0..
    0020: 03 55 04 08 13 0C 57 65 73 74 65 72 6E 20 43 61 .U....Western Ca
    0030: 70 65 31 12 30 10 06 03 55 04 07 13 09 43 61 70 pe1.0...U....Cap
    0040: 65 20 54 6F 77 6E 31 1D 30 1B 06 03 55 04 0A 13 e Town1.0...U...
    0050: 14 54 68 61 77 74 65 20 43 6F 6E 73 75 6C 74 69 .Thawte Consulti
    0060: 6E 67 20 63 63 31 28 30 26 06 03 55 04 0B 13 1F ng cc1(0&..U....
    0070: 43 65 72 74 69 66 69 63 61 74 69 6F 6E 20 53 65 Certification Se
    0080: 72 76 69 63 65 73 20 44 69 76 69 73 69 6F 6E 31 rvices Division1
    0090: 19 30 17 06 03 55 04 03 13 10 54 68 61 77 74 65 .0...U....Thawte
    00A0: 20 53 65 72 76 65 72 20 43 41 31 26 30 24 06 09 Server CA1&0$..
    00B0: 2A 86 48 86 F7 0D 01 09 01 16 17 73 65 72 76 65 *.H........serve
    00C0: 72 2D 63 65 72 74 73 40 74 68 61 77 74 65 2E 63 [email protected]
    00D0: 6F 6D om
    main, READ: SSL v3.0 Handshake, length = 4
    *** ServerHelloDone
    [read] MD5 and SHA1 hashes: len = 4
    0000: 0E 00 00 00 ....
    main, SEND SSL v3.0 ALERT: warning, description = no_certificate
    main, WRITE: SSL v3.0 Alert, length = 2
    JsseJCE: Using JSSE internal implementation for cipher RSA/ECB/PKCS1Padding
    *** ClientKeyExchange, RSA PreMasterSecret, v3.0
    Random Secret: { 3, 0, 57, 228, 245, 13, 91, 181, 92, 129, 234, 123, 199, 2, 84, 156, 170, 175, 48, 221, 204, 142, 18, 177, 69, 95, 165, 11, 196, 105, 168, 66, 230, 117, 243, 61, 22, 60, 41, 203, 229, 232, 240, 78, 200, 114, 53, 56 }
    [write] MD5 and SHA1 hashes: len = 132
    0000: 10 00 00 80 78 F9 25 03 98 3E C5 F7 8D 63 17 F2 ....x.%..>...c..
    0010: 5A 0F 3D 7C D1 DB 3C 88 69 A1 1F 0F A0 E0 54 AC Z.=...<.i.....T.
    0020: 99 8D 4F EC C7 74 F2 BA 8E AD C3 A0 B4 91 E9 1C ..O..t..........
    0030: 74 75 2F 89 26 7C 82 6A 70 1F 72 50 F0 07 41 38 tu/.&..jp.rP..A8
    0040: 4B 5A 8A F2 DE 61 1A 9D 34 2A 1D 0C C1 9D EC CA KZ...a..4*......
    0050: 27 D7 93 3E B1 17 4A 48 62 5E 47 DA 70 6B 10 A2 '..>..JHb^G.pk..
    0060: 29 99 3D 17 93 0D B2 FB DF EB 5C 13 91 72 FB 6C ).=.......\..r.l
    0070: AD 6D 4D 46 F7 B3 AB 02 76 61 F8 0E 03 7D 32 AF .mMF....va....2.
    0080: 3A 53 64 B0 :Sd.
    main, WRITE: SSL v3.0 Handshake, length = 132
    SESSION KEYGEN:
    PreMaster Secret:
    0000: 03 00 39 E4 F5 0D 5B B5 5C 81 EA 7B C7 02 54 9C ..9...[.\.....T.
    0010: AA AF 30 DD CC 8E 12 B1 45 5F A5 0B C4 69 A8 42 ..0.....E_...i.B
    0020: E6 75 F3 3D 16 3C 29 CB E5 E8 F0 4E C8 72 35 38 .u.=.<)....N.r58
    CONNECTION KEYGEN:
    Client Nonce:
    0000: 3B DB BB 5E FE 50 EC 70 2C B1 71 18 F0 11 13 7C ;..^.P.p,.q.....
    0010: AA C1 9C F2 06 5E 6B 31 EC 12 D3 32 C4 24 3A 5B .....^k1...2.$:[
    Server Nonce:
    0000: 3D BD 78 BA 92 3C 4A DD FE DF E0 DA 56 40 D6 7F =.x..<J.....V@..
    0010: 20 00 EB EE B5 D2 D4 DA 8D 26 C6 8E 6E AF 92 71 ........&..n..q
    Master Secret:
    0000: 85 D3 60 38 ED 28 6E 78 A3 1E 6D 6D AB 16 28 00 ..`8.(nx..mm..(.
    0010: 43 13 02 A9 27 41 29 52 31 2E E8 4F AD C9 18 2B C...'A)R1..O...+
    0020: 32 CE 4F 54 C5 82 24 4D E5 F2 6F 4D 28 E3 F6 BB 2.OT..$M..oM(...
    Client MAC write Secret:
    0000: CD A6 10 71 07 C6 D4 DE 67 17 3B E1 FD ED D3 1A ...q....g.;.....
    0010: 1F C2 0A F0 ....
    Server MAC write Secret:
    0000: 4D 72 94 AD 25 0C 13 8A 8C 38 99 D7 A7 5C 9C EA Mr..%....8...\..
    0010: BC 6D 05 D3 .m..
    Client write key:
    0000: AF 2E A1 B1 F5 65 C0 DC 06 A9 0B 2F 6D 50 9D AD .....e...../mP..
    0010: 9C 54 81 C0 C2 CA 00 1F .T......
    Server write key:
    0000: C8 D1 05 53 51 AC 90 ED A4 E2 4B ED 9E 51 21 DC ...SQ.....K..Q!.
    0010: B6 5C EC 2A AA F9 8F 78 .\.*...x
    Client write IV:
    0000: 2F 8F 34 8F 63 A6 35 28 /.4.c.5(
    Server write IV:
    0000: 8F FF D3 C1 AC 32 3D 96 .....2=.
    main, WRITE: SSL v3.0 Change Cipher Spec, length = 1
    JsseJCE: Using JSSE internal implementation for cipher DESede/CBC/NoPadding
    *** Finished, v3.0
    MD5 Hash: { 210, 197, 57, 55, 38, 216, 173, 32, 214, 81, 225, 100, 54, 5, 93, 247 }
    SHA1 Hash: { 183, 114, 192, 183, 141, 75, 236, 153, 35, 197, 117, 135, 145, 199, 218, 137, 187, 186, 216, 148 }
    [write] MD5 and SHA1 hashes: len = 40
    0000: 14 00 00 24 D2 C5 39 37 26 D8 AD 20 D6 51 E1 64 ...$..97&.. .Q.d
    0010: 36 05 5D F7 B7 72 C0 B7 8D 4B EC 99 23 C5 75 87 6.]..r...K..#.u.
    0020: 91 C7 DA 89 BB BA D8 94 ........
    Padded plaintext before ENCRYPTION: len = 64
    0000: 14 00 00 24 D2 C5 39 37 26 D8 AD 20 D6 51 E1 64 ...$..97&.. .Q.d
    0010: 36 05 5D F7 B7 72 C0 B7 8D 4B EC 99 23 C5 75 87 6.]..r...K..#.u.
    0020: 91 C7 DA 89 BB BA D8 94 D9 CB BD E2 60 63 C1 09 ............`c..
    0030: 3D CD A5 EF 06 89 80 FA 47 D8 4A 9A 03 03 03 03 =.......G.J.....
    main, WRITE: SSL v3.0 Handshake, length = 64
    main, READ: SSL v3.0 Alert, length = 2
    main, RECV SSLv3 ALERT: fatal, handshake_failure
    the exception is java.net.SocketException: Socket is closed
    java.net.SocketException: Socket is closed
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.getInputStream(DashoA6275)
         at TestSocketClient.main(TestSocketClient.java:108)
    Normal Termination
    Output completed (9 sec consumed).
    Hope somebody came across this situation....... waiting for your appreciate response.
    thanks

    Hi,
    This might not solve all your problems, but it should allow you to load the certificates into a keystore programmatically in Java.
    2. I got the two server certificates namely ca.pem and
    client.pem. I feel these are server's public key and
    CA key. Is it right?You should proabably find out what they are, and make sure they
    are certificates.
    How to create a keystore for adding these
    certificates at client's machine using keytool. Here is how you can create a keystore (in memory) and load the
    certificates (if that's what they are) into the keystore:
    // assuming you are using X.509 certificates
    CertificateFactory cf = CertificateFactory.getInstance("X.509");
    FileInputStream certFile = new FileInputStream("pathToCert");
    Certificate cert = cf.generateCertificate( certFile );
    KeyStore trustedks = KeyStore.getInstance("JKS");
    // this essentially initializes a keystor in memeory
    trustedks.load(null,null);
    // substitute "alias" with "server" and "ca" respectively for your case
    // though I find it doesn't matter what their alias is.
    trustedks.setCertificateEntry( "alias", certificate );
    // continue as you did in your example and use this new trusted keystore
    Cheers,
    Jason

  • Can't load jvm.dll in Vista

    I have a bizarre problem with JDK1.6.0_03 and Windows Vista. I am trying to compile and run a C program that calls a Java method, using the invocation API. In the past, this worked like a charm, provided I had c:\Program Files\Java\jdk1.6.0_03\jre\bin\client on the PATH.
    It no longer works. I get an error message that jvm.dll was not found and that Windows will notify me if it finds a solution to my problem. (I am not holding my breath.)
    I then try to load the library manually:
       HINSTANCE h = LoadLibrary("c:\\Program Files\\Java\\jdk1.6.0_03\\jre\\bin\\client\\jvm.dll");
       if (h == NULL)
           printf("Can't load library\n");
           exit(1);
         }I get the exact same error message.
    Did something break in Vista, or do I need to look elsewhere for a stupid configuration error?
    Thanks,
    Cay Horstmann

    Just in case some other poor soul gets to this, here is the way to implement the invocation under Windows Vista:
    #include <jni.h>
    #include <stdlib.h>
    #include <windows.h>
    typedef jint (JNICALL *CreateJavaVM_t)(JavaVM **, JNIEnv **, JavaVMInitArgs *);
    int main()
       JavaVMOption options[2];
       JavaVMInitArgs vm_args;
       JavaVM *jvm;
       JNIEnv *env;
       long status;
       jclass class_Welcome;
       jclass class_String;
       jobjectArray args;
       jmethodID id_main;
       HINSTANCE h1, h2;
       CreateJavaVM_t createJavaVM;
       h1 = LoadLibrary("c:\\Program Files\\Java\\jdk1.6.0_03\\jre\\bin\\msvcr71.dll");
       if (h1 == NULL)
          printf("Can't load library msvcr71.dll\n");
          exit(1);
       h2 = LoadLibrary("c:\\Program Files\\Java\\jdk1.6.0_03\\jre\\bin\\client\\jvm.dll");
       if (h2 == NULL)
          printf("Can't load library jvm.dll\n");
          exit(1);
       options[0].optionString = "-Djava.class.path=.";
       memset(&vm_args, 0, sizeof(vm_args));
       vm_args.version = JNI_VERSION_1_2;
       vm_args.nOptions = 1;
       vm_args.options = options;
       createJavaVM = (CreateJavaVM_t) GetProcAddress(h2, "JNI_CreateJavaVM");
       status = (*createJavaVM)(&jvm, &env, &vm_args);
       if (status == JNI_ERR)
          printf("Error creating VM\n");
          return 1;
       class_Welcome = (*env)->FindClass(env, "Welcome");
       id_main = (*env)->GetStaticMethodID(env, class_Welcome, "main", "([Ljava/lang/String;)V");
       class_String = (*env)->FindClass(env, "java/lang/String");
       args = (*env)->NewObjectArray(env, 0, class_String, NULL);
       (*env)->CallStaticVoidMethod(env, class_Welcome, id_main, args);
       (*jvm)->DestroyJavaVM(jvm);
       return 0;
    }Compile with
    gcc -g -mno-cygwin -D __int64="long long" -I /cygdrive/c/Program\ Files/Java/jdk1.6.0_03/include/ -I /cygdrive/c/Program\ Files/Java/jdk1.6.0_03/include/win32/ -o InvocationTest InvocationTest.c Of course, in a real application, you'll want to dynamically locate the Java directory; look at launcher/java_md.c inside src.zip for inspiration.

  • JCheckBoxMenuItem doesn't show the checkbox

    Hi,
    I'm trying to add a JCheckBoxMenuItem to a popup menu. I'm using jdk1.4 and the Windows L&F. The checkbox portion of the JCheckBoxMenuItem doesn't show up; all I see are the words associated with the check box. Any help would be greatly appreciated.
    Thanks,
    Angella
    private void createPopup(Point p) {
    JMenuItem item;
    popup = new JPopupMenu();
    JCheckBoxMenuItem checkItem = new JCheckBoxMenuItem("Show Labels");
    popup.add(checkItem);
    if xxx== null || xxx.equals(""))
    checkItem.setEnabled(false);
    checkItem.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent e){
    JCheckBoxMenuItem temp = ((JCheckBoxMenuItem)(e.getSource()));
    setShowLabels(temp.isSelected());
    checkItem = new JCheckBoxMenuItem("ShowTypes");
    popup.add(checkItem);
    if (xxx == null || xxx.equals(""))
    checkItem.setEnabled(false);
    checkItem.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent e){
    JCheckBoxMenuItem temp = ((JCheckBoxMenuItem)(e.getSource()));
    setType(temp.isSelected());
    popup.show(this, p.x, p.y);

    Angella,
    Did you ever overcome this limitation in the windows l&f. I would also like to show an empty checkbox on the menu item to indicate that the menu item is "checkable". Did you find a way to do this?
    Thanks,
    Troy

Maybe you are looking for

  • Error while starting Admin Server after install WLS 7.0.1

    Hi all, I am getting the following error while starting the Admin Server on HP-UX, after doing a silent install. Any Help is appreciated. thanks, sudu Dweblogic.security.SSL.trustedCAKeyStore=/opt/blueadmi/bea/weblogic700/server/lib/cacerts -classpat

  • Add new line in table

    Hello, On my web dynpro screen there is one button add when i click on add button a new line inserted in table .After empty row insertion i am putting the values in the table on selecting drop down list by key .Two field coln selected correctly but w

  • How to display all the columns in the printpreview

    hi experts, I have developed an alv report using grid display. there are nearly 10 fields in the output with varrious of length. They get displayed correctly in grid format. But, when on the output screen, I click on List menu and goto "Print Preview

  • Form downloaded from Internet is blank

    When I click on my VA-5 icon to do my state employer's withholdings tax, all I get is a blank, white screen. Sometimes, followed by this message: "Adobe Reader cannot open in Protected Mode due to an incompatibility with your system configuration. Wo

  • Info regarding Diswarrior 4 and Leopard compatibility

    I emailed Alsoft regarding Diskwarrior 4 and Leopard compatibility. Here is the response I got. +DiskWarrior 4.0 will successfully rebuild a disk that has Mac OS X 10.5+ +Leopard installed or a disk that has been attached to a computer running+ Leopa