PLSQL enqueue -- Java client

Hi
Can anyone shed some light on how to enqueue a message using dbms_aq.enqueue() and have a (connected) java client pick it up?
I have managed to get a java-to-java pub/sub to work - I would like to do this with both a standard and multi-consumer queue.
Thanks in advance.

PL/SQL to send a JMS message to the SCO_QUEUE queue
DECLARE
Enqueue_options DBMS_AQ.enqueue_options_t;
Message_properties DBMS_AQ.message_properties_t;
Message_handle RAW(16);
User_prop_array SYS.AQ$_JMS_USERPROPARRAY;
Agent SYS.AQ$_AGENT;
Header SYS.AQ$_JMS_HEADER;
Message SYS.AQ$_JMS_TEXT_MESSAGE;
Message_text VARCHAR2(500);
BEGIN
Agent := SYS.AQ$_AGENT('',NULL,0);
User_prop_array := SYS.AQ$_JMS_USERPROPARRAY();
Header := SYS.AQ$_JMS_HEADER( Agent, '', 'AQUSER', '', '', '', User_prop_array);
Message_text := 'Message from score engine '|| TO_CHAR(SYSDATE, 'mm/dd/yyyy hh24:mi:ss');
Message := SYS.AQ$_JMS_TEXT_MESSAGE(Header, LENGTH(Message_text), Message_text, NULL);
DBMS_AQ.ENQUEUE(queue_name => 'SCO_QUEUE',
                         Enqueue_options => enqueue_options,
                         Message_properties => message_properties,
                         Payload => message,
                         Msgid => message_handle);
DBMS_OUTPUT.PUT_LINE('Msgid: ' || message_handle);
COMMIT;
END;
JAVA class to receive message
public ScoreController() {
try {
//Connect to AQ (Oracle's JMS provider)
QueueConnectionFactory queueConnectionFactory = AQjmsFactory.getQueueConnectionFactory("dax", "v48DEV",
1521, "thin");
//Create the queue Connection
QueueConnection queueConnection = queueConnectionFactory.createQueueConnection("AQUSER", "AQUSER");
queueConnection.start();
//Create the Topic Session
QueueSession queueSession = queueConnection.createQueueSession(true, Session.CLIENT_ACKNOWLEDGE);
Queue queue = ((AQjmsSession) queueSession).getQueue("AQUSER", "SCO_QUEUE");
//Create a non-durable Subscriber.
QueueReceiver receiver = ((AQjmsSession) queueSession).createReceiver(queue);
//get the next message off the queue
while (true) {
System.out.println("Looking for message ");
TextMessage message = (TextMessage) receiver.receive(1000);
if (message == null) {
System.out.println("Gave up, No message found.");
continue;
} else {
message.acknowledge();
System.out.println("Received request");
System.out.println("\tTime: " + System.currentTimeMillis() + " ms");
System.out.println("\tMessage ID: " + message.getJMSMessageID());
System.out.println("\tCorrel. ID: " + message.getJMSCorrelationID());
System.out.println("\tReply to: " + message.getJMSReplyTo());
System.out.println("\tContents: " + message.getText());
} catch (JMSException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

Similar Messages

  • How to insert message in OC4J JMS from standalone java client.

    Hi,
    I have been following available examples for creating standalone java clients to insert messages in JMS queues.
    I am able to insert using java client when the SOA suite and the standalone java code are on same machine.
    package producerconsumerinjava;
    import javax.jms.*;
    import javax.naming.*;
    import java.util.Hashtable;
    public class QueueProducer
    public static void main(String[] args)
    String queueName = "jms/demoQueue";
    String queueConnectionFactoryName = "jms/QueueConnectionFactory";
    Context jndiContext = null;
    QueueConnectionFactory queueConnectionFactory = null;
    QueueConnection queueConnection = null;
    QueueSession queueSession = null;
    Queue queue = null;
    QueueSender queueSender = null;
    TextMessage message = null;
    int noMessages = 5;
    * Set the environment for a connection to the OC4J instance
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "oracle.j2ee.rmi.RMIInitialContextFactory");
    env.put(Context.SECURITY_PRINCIPAL, "oc4jadmin");
    env.put(Context.SECURITY_CREDENTIALS, "mypass");
    env.put(Context.PROVIDER_URL,"ormi://myserver.company.com:12402"); //12402 is the rmi port
    * Set the Context Object.
    * Lookup the Queue Connection Factory.
    * Lookup the JMS Destination.
    try
    jndiContext = new InitialContext(env);
    queueConnectionFactory =
    (QueueConnectionFactory) jndiContext.lookup(queueConnectionFactoryName);
    queue = (Queue) jndiContext.lookup(queueName);
    catch (NamingException e)
    System.out.println("JNDI lookup failed: " + e.toString());
    System.exit(1);
    * Create connection.
    * Create session from connection.
    * Create sender.
    * Create text message.
    * Send messages.
    * Send non text message to end text messages.
    * Close connection.
    try
    queueConnection = queueConnectionFactory.createQueueConnection();
    queueSession =
    queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
    queueSender = queueSession.createSender(queue);
    message = queueSession.createTextMessage();
    for (int i = 0; i < noMessages; i++)
    message.setText("Message " + (i + 1));
    System.out.println("Producing message: " + message.getText());
    queueSender.send(message);
    queueSender.send(queueSession.createBytesMessage());
    catch (JMSException e)
    System.out.println("Exception occurred: " + e.toString());
    finally
    if (queueConnection != null)
    try
    queueConnection.close();
    catch (JMSException e)
    System.out.println("Closing error: " + e.toString());
    But when the SOA Suite is remote, I am struggling to get the settings correct
    Till now, here is what I have figured out from looking at blogs/tars etc on the Net:
    1. I need to use ApplicationClientInitialContextFactory instead of RMIInitialContextFactory (http://download.oracle.com/docs/cd/E14101_01/doc.1013/e13975/jndi.htm)
    2. The project should have a META-INF/application-client.xml file, which may be dummy (http://www.wever.org/java/space/Oracle/JmsTar1). Question is, my code is there in a single absolutely standalone code..how I can use this application-client.xml and where it has to be placed.
    Errors:
    When trying to run exact same code on local server that tries to enqueue JMS on remotee serverer
    Exception occurred: javax.jms.JMSException: Unable to create a connection to "xxxxxxx.yyyyyy01.dev.com/10.42.456.11:12,602" as user "null".
    Any help is greatly welcome.
    As an exercise, I copied this complete code on the server and then ran locally using a telnet client...it worked. So the problem is coming when accessing the server remotely.
    Rgds,
    Amit

    1. I need to use ApplicationClientInitialContextFactory instead of RMIInitialContextFactoryNot necessarily.
    2. The project should have a META-INF/application-client.xml fileThat's only necessary if going the ApplicationClientInitialContextFactory route.
    There are two types of JMS client applications you can write -- a pure/plain Java app, and an "AppClient". That first is your everyday run-of-the-mill Java application, nothing special. That latter is a special, complicated beast that tries to act as a part of the whole client/server/J2EE architecture which provides you with a semi-managed environment. Either can be made to work, but if all you need is JMS access (using plain OC4J JMS factory/queue names and not JMS Connector names), then the first is easier to get working (and performs a tiny bit better as well due to being a lighter-weight solution).
    I think the problem you are having might be: When you use the plain Java client solution, you do not have any type of management, and that includes user management. With no user management (and if the JMS server is not configured to allow anonymous connections) you need to include the username and password in the call to createConnection. (I think it may be that this is actually true in the AppClient case as well -- I avoid using the AppClient model as much as possible so my memory there is weaker.)
    If you prefer to go the AppClient route, I would point you to a demo I wrote which had a functioning example, but Oracle seems to have removed it (and all of the 10.1.3 demos?) from OTN. :-(
    Hmm, it seems to still be available on the wayback machine:
    http://web.archive.org/web/20061021064014/www.oracle.com/technology/tech/java/oc4j/1013/how_to/index.html
    (Just look down the page for "With OEMS JMS (In-Memory and File-Based)" -- there is an .html document with info, and there is a .zip file with source code.)
    Question is, my code is there in a single absolutely standalone code..how I can use this application-client.xml and where it has to be placed.The app client in my demo had the following directory structure:
    myjavaclient.class
    jndi.properties
    META-INF\MANIFEST.MF
    META-INF\application-client.xml
    META-INF\orion-application-client.xml
    When you use ApplicationClientInitialContextFactory I think it just looks under .\META-INF for the .xml files.
    -Jeff

  • Produce Message to AQ Queue using standalone Java client in Oracle 11g FMW

    I have a Java client that creates a TextMessage and tries to post it to AQ queue using the server context. Please find the sample code below:
    QueueSession jmsSession = null;
    QueueConnection queueConnection = null;
    try {
    Properties parm = new Properties();
    parm.setProperty("java.naming.factory.initial","weblogic.jndi.WLInitialContextFactory");
    parm.setProperty("java.naming.provider.url","t3://10.209.125.23:8001");
    parm.setProperty("java.naming.security.principal","weblogic");
    parm.setProperty("java.naming.security.credentials","weblogic1");
    Context ctx = new InitialContext(parm);
    System.out.println("Weblogic Initial Context obtained : " + ctx);
    //DataSource ds = (DataSource)ctx.lookup(datasourceJNDI);
    QueueConnectionFactory queueConnfactory = (QueueConnectionFactory)ctx.lookup(QCF) ;
    System.out.println("QueueConnectionFactory from QCF jndi lookup : " + queueConnfactory);
    queueConnection = queueConnfactory.createQueueConnection();
    System.out.println("QueueConnection obtained : " + queueConnection);
    //Make QueueSession
    jmsSession = queueConnection.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);
    System.out.println("QueueSession obtained : " + jmsSession);
    //Start QueueConnection else no messages will be delivered
    queueConnection.start();
    Queue aqQueue = (Queue)ctx.lookup(QUEUE_JNDI);
    System.out.println("Queue obtained from lookup: " + aqQueue);
    QueueSender sender = ((AQjmsSession)jmsSession).createSender(aqQueue);
    System.out.println("QueueSender obtained: " + sender);
    File file = new File("C:
    Documents and Settings\\Apara\\Desktop\\EH_Mig\\development
    Resub.xml");
    XmlObject object = XmlObject.Factory.parse(file);
    String payloadString = object.toString();
    System.out.println("Message to be sent : " + payloadString);
    Message message = jmsSession.createTextMessage(payloadString);
    sender.send(message);
    jmsSession.commit();
    System.out.println("Message sent : " + message.toString());
    catch(Exception ex) {
    ex.printStackTrace();
    finally {
    if (jmsSession != null)
    jmsSession.close();
    if (queueConnection != null)
    queueConnection.stop();
    queueConnection.close();
    The code gives a runtime exception when it reaches the statement sender.send() as below :
    weblogic.rmi.extensions.RemoteRuntimeException: Unexpected Exception
    at weblogic.jdbc.rmi.internal.ConnectionImpl_weblogic_jdbc_wrapper_JTAConnection_weblogic_jdbc_wrapper_XAConnection_oracle_jdbc_driver_LogicalConnection_1032_WLStub.physicalConnectionWithin(Unknown Source)
    at weblogic.jdbc.rmi.SerialConnection_weblogic_jdbc_rmi_internal_ConnectionImpl_weblogic_jdbc_wrapper_JTAConnection_weblogic_jdbc_wrapper_XAConnection_oracle_jdbc_driver_LogicalConnection_1032_WLStub.physicalConnectionWithin(Unknown Source)
    at oracle.sql.TypeDescriptor.setPhysicalConnectionOf(TypeDescriptor.java:817)
    at oracle.sql.TypeDescriptor.<init>(TypeDescriptor.java:622)
    at oracle.sql.StructDescriptor.<init>(StructDescriptor.java:317)
    at oracle.sql.StructDescriptor.createDescriptor(StructDescriptor.java:200)
    at oracle.sql.StructDescriptor.createDescriptor(StructDescriptor.java:168)
    at oracle.sql.StructDescriptor.createDescriptor(StructDescriptor.java:137)
    at oracle.jpub.runtime.MutableStruct.toDatum(MutableStruct.java:113)
    at oracle.jms.AQjmsGenMessage_C.toDatum(AQjmsGenMessage_C.java:46)
    at oracle.jms.AQjmsProducer.jdbcEnqueue(AQjmsProducer.java:1027)
    at oracle.jms.AQjmsProducer.send(AQjmsProducer.java:747)
    at oracle.jms.AQjmsProducer.send(AQjmsProducer.java:517)
    at co.uk.morrisons.errorhospital.util.QueueTest.sendMessageUsingServerContextAndQCF(QueueTest.java:245)
    at co.uk.morrisons.errorhospital.util.QueueTest.main(QueueTest.java:293)
    Caused by: java.rmi.MarshalException: error marshalling return; nested exception is:
    java.io.NotSerializableException: oracle.jdbc.driver.T4CConnection
    at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:234)
    at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:223)
    ... 15 more
    Caused by: java.io.NotSerializableException: oracle.jdbc.driver.T4CConnection
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
    at weblogic.rjvm.MsgAbbrevOutputStream.writeObject(MsgAbbrevOutputStream.java:618)
    at weblogic.utils.io.ChunkedObjectOutputStream.writeObject(ChunkedObjectOutputStream.java:63)
    at weblogic.jdbc.rmi.internal.ConnectionImpl_weblogic_jdbc_wrapper_JTAConnection_weblogic_jdbc_wrapper_XAConnection_oracle_jdbc_driver_LogicalConnection_WLSkel.internalInvoke2(Unknown Source)
    at weblogic.jdbc.rmi.internal.ConnectionImpl_weblogic_jdbc_wrapper_JTAConnection_weblogic_jdbc_wrapper_XAConnection_oracle_jdbc_driver_LogicalConnection_WLSkel.internalInvoke1(Unknown Source)
    at weblogic.jdbc.rmi.internal.ConnectionImpl_weblogic_jdbc_wrapper_JTAConnection_weblogic_jdbc_wrapper_XAConnection_oracle_jdbc_driver_LogicalConnection_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473)
    at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    I am using a ForeignServer configuration which is targeted to a JMS Server. This a Weblogic 10.3.2 feature. Please see if you can help me to enqueue the message.
    Thanks,
    Aparajeeta

    It finally got resolved with help from Edwin Biemond and Oracle docs. I have made a blog out of it @
    http://technicknacks.blogspot.com
    Edited by: oraaps on Mar 26, 2010 5:33 PM

  • PACKAGE PLSQL to control client machine

    Hi,
    Is there a PLSQL package ( JAVA encapsulated I thing ) to get some informations of client machine or print on client machine using IP address of the machine and/or printer.
    Thanks a lot
    Romeo.

    What client information?
    Remember that the database is a server. It can service any number of very different clients. It can be Delphi, Java, Powerbuilder or C# clients.. or command line clients like SQL*Plus... or developer clients like TOAD, Tora, SQL-Developer... and these clients can be running on Windows, Linux, Unix, Apple Mac.. and they can be using TCP, IPX or even LU6.2.
    Or the client could be a server.. like a Jboss or Weblogic server.. or another database server.
    Etc.
    Do the server need to know anything about the client in order to service the client? The server gets a SQL from a Powerbuilder app on Windows send via TCP. Does this SQL look different from a SQL from a SQL*Plus command line tool on an IBM mainframe, send via LU6.2?
    SQL is SQL. PL/SQL is PL/SQL. And that is what the Oracle server receives and executes. All clients are equal in the eyes of the Oracle server.
    Given this, why would the server need information about the client and why? The Oracle server session (shadow process) that services a client does not need to know anything about the client. No need.
    Even so, when the Oracle client connects, the connection string (from the client) contains some data about the client. This is added to the connection string by the client's Oracle driver (and of course, can be spoofed). This includes information like executable name, o/s user name and so on.
    When the Listener hands off the connection to Oracle (either by starting a dedicated server process or talking to a dispatcher process), it passes this connection data along. This is stored by these processes in the SGA - and can be viewed using the V$SESSION virtual view.
    Client data such as the following is stored as a 'for your information only':
    - Client Operating system client user name
    - Client Operating system client process ID
    - Client Operating system machine name
    - Client Operating system terminal name
    - Client Operating system program name
    The USERENV context can be used to get the client's IP address and Hostname, e.g.
    select SYS_CONTEXT( 'USERENV', 'HOST' ), SYS_CONTEXT( 'USERENV', 'IP_ADDRESS' ) from dual
    That in a nutshell is what client info is kept by an Oracle server process.
    As for PL/SQL code in Oracle using this data..? Yes, it can be useful as long as one remember that the client supplied it, and could have been lying. The data is untrusted data.
    As for using this data to make a connection to the client? Not a good idea. This changes the PL/SQL code into a client, and the client into a server. This can be problematic ito firewalls, network connectivity, security and so on.
    For example, for the PL/SQL to use the client's printer, the code will need to know what type of network shared printer it is. The PL/SQL code may very likely need to authenticate against the client (or a Windows Domain Controller) to access that client's printer.
    This makes the complexity of the PL/SQL (or Java stored procs) all the more complexed.
    Why?
    Surely it is the client application's responsibility and job to serve as interface between the database and the client platform! It is the application's job to take data from the database server and present that to the client. As a graph, shiny table with pretty colours.. or as a printout on the local printer.

  • Unable to get 'InitialContext' using Java Client in Oracle App 10.0.2.0

    Scenario & Problem Description: Unable to get 'Initial Context' using Simple Java Client in Oracle Application Server 10.0.2.0
    I'm having an issue while I try to initialize the Initial Context for an EJB lookup from a simple Java Client [local lookup], but the same code snippet works fine when I try from Servlet. I have enclosed the Exception Stack Trace and the Code Snippet for your reference.
    1. .NET Client ---> Servlet --> LookupUtility --> EJB --> DB - Issue
    2. .NET Client ---> Servlet --> EJB --> DB - Works
    Exception: java.lang.InstantiationException: Error communicating with server: Lookup error: javax.naming.AuthenticationException: Invalid username/password for Config (guest); nested exception is: nested exception is: Exception in InitialContext: javax.naming.NamingException: Lookup error: javax.naming.AuthenticationException: Invalid username/password for Config (guest) at com.evermind.server.ApplicationClientInitialContextFactory.getInitialContext(ApplicationClientInitialContextFactory.java:149)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
    at javax.naming.InitialContext.init(InitialContext.java:219)
    at javax.naming.InitialContext.<init>(InitialContext.java:195)
    at com.seagate.edcs.config.util.LookupUtility.getInitialContext(LookupUtility.java:123)
    at com.seagate.edcs.config.util.LookupUtility.getConfiguration (LookupUtility.java:69)
    at com.seagate.edcs.config.util.LookupUtility.main(LookupUtility.java:135)
    Code Snippet:
    * This method returns the Configuration for the properties set.
    public ArrayList getConfiguration ( ) throws Exception {
    ArrayList arrayList = null;
    try {
    Context context = getInitialContext();
    System.out.println("Context : " + context);
    Object home = context.lookup("java:comp/env/ejb/com.seagate.edcs.config.ejb.ConfigSessionEJBHome");
    System.out.println("Object home : " + home);
    ConfigSessionEJBHome configSessionEJBHome = (ConfigSessionEJBHome)PortableRemoteObject.narrow(home, ConfigSessionEJBHome.class);
    System.out.println("ConfigSessionEJBHome configSessionEJBHome : " + configSessionEJBHome);
    ConfigSessionEJB configSessionEJB =(ConfigSessionEJB)PortableRemoteObject.narrow(configSessionEJBHome.create(), ConfigSessionEJB.class);
    System.out.println("ConfigSessionEJB configSessionEJB : " + configSessionEJB);
    arrayList = configSessionEJB.getAllConfig();
    System.out.println("Context : " + context);
    } catch (Exception ex) {
    System.out.println("Exception Occured");
    throw ex;
    return arrayList;
    * Get an initial context from the JNDI tree.
    private Context getInitialContext() throws NamingException {
    try {
    Hashtable hashtable = new Hashtable();
    hashtable.put("java.naming.factory.initial", "com.evermind.server.ApplicationClientInitialContextFactory");
    hashtable.put("java.naming.provider.url", "ormi://seagate.mil-shivas-270.am.ad.seagate.com/home"); // if we won't specify the port, it considers the default port
    hashtable.put("java.naming.security.principal","ias_admin");
    hashtable.put("java.naming.security.credentials","ias123");
    return new InitialContext(hashtable);
    } catch (NamingException ne) {
    System.out.println("Exception in InitialContext.");
    throw ne;
    Note:
    1. The user "ias_admin" & password "ias123" are the credential provided for the 'Admin' while installing the Oracle App Server and using these credentials I'm able to bring the Admin Console. Also, added new user 'guest/guest' - assigned this user to the 'admin' group ...
    2. Since its a local lookup, there is no need to specify the credentials, but at runtime a dialog box pops up prompting to enter the 'userid/password' and when I enter the crendtials, I get the exception as stated. [In case of Servlet - EJB lookup, I'm not specifying any credentials]
    Are there are any configuration parameters which I need to provide in any of the .xml? Could you please let me know the fix for the same.
    Regards,
    Kafeel/-

    Please use the OS {forum:id=210}

  • Java client application + SAP Logon Tickets (SSO)

    Java client application + SAP Logon Tickets (SSO)
    Hello
    I have the following question, it is about connection between SAP Enterprise Portal and Java Application.
    After registration in Enterprise Portal (with Internet Explorer Browser) request is passed on to SAP backend system - cFolders (SSO methode)
    With internet browser functioned everything.
    How can one get, however, this Logon tickets with Java application and then be of use later for SOAP connection
    (everything with client java application)
    Thanks for quick help
    Edo

    Hi Edo,
    look at this https://media.sdn.sap.com/javadocs/NW04/SPS15/um/com/sap/security/api/ticket/TicketVerifier.html
    Best Regards
    Oliver

  • How do you use .wsse policy file from Java Client?

    I'd like to call a WSSE enabled web service from my Java client but setup my encryption/signing requirements with a .wsse policy file.
    I know how to call a web service by programmatically setting up the security headers as described in:
    http://e-docs.bea.com/workshop/docs81/doc/en/core/index.html
    But how can I do the same thing by simply using a .wsse file?

    import java.awt.*;
    import java.applet.Applet;
    import java.awt.event.*;
    import java.net.*;
    public class links extends java.applet.Applet {
       Panel panel = new Panel();
       public links(){
          super();
          add(panel);
          Link link = new Link(this,"Answers for programmers;- ","http://forum.java.sun.com");
          panel.add(link);
       public void init(){
          setVisible(true);
       public class Link extends Label implements MouseListener {
          Applet applet;
          Color fcolor = Color.blue;
          Color lcolor = Color.pink;
          String text;
          String word;
       public Link(Applet ap, String s, String s1){
          super(s);
             this.applet = ap;
             this.text = s;
             this.word = s1;
             addMouseListener(this);
          setForeground(fcolor);
       public void paint(Graphics g){
       super.paint(g);
          if (getForeground() == lcolor){
             Dimension d = getSize();
             g.fillRect(1,d.height-5,d.width,1);
       public void update(Graphics g){paint(g);}
       public void mouseClicked(MouseEvent e){
          try{
             URL url = new URL(word);
             applet.getAppletContext().showDocument(url,"_self");
          catch(MalformedURLException er){ }
       public void mouseEntered(MouseEvent e){
          setForeground(lcolor);
          setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
          repaint();
       public void mouseExited(MouseEvent e){
          setForeground(fcolor);
          setCursor(Cursor.getDefaultCursor());
          repaint();
    public void mousePressed(MouseEvent e){}
    public void mouseReleased(MouseEvent e){}
       public static void main (String[] args){
          new links(); 
    }

  • Design Problem : How to design/code a java client which is deployed to all the machines in a cluster and make sure that only one of the java client is active

              hi ,
              I have to design a java client (which is basically a JMS message listener)which
              is deplloyed to all the servers in the cluster. But as these are message listeners,
              i want only one of the instance to be active at a time.
              If the server on which the client is active goes down , I want the second server
              to start listening to messages.
              How do i design this ? Also is there a public api for multicasting that we can
              use ?
              Anybody has an idea on how to go about this..
              Thanks
              nisha
              

    Hi Nisha,
              Failover message listeners? Sounds like you want MDBs, which are deployed on all nodes in a
              cluster. If your JMS destination is a queue, then only one MDB will pick up the message. And just
              like any other ejb service, MDBs failover.
              Gene
              "Nisha" <[email protected]> wrote in message news:[email protected]..
              hi ,
              I have to design a java client (which is basically a JMS message listener)which
              is deplloyed to all the servers in the cluster. But as these are message listeners,
              i want only one of the instance to be active at a time.
              If the server on which the client is active goes down , I want the second server
              to start listening to messages.
              How do i design this ? Also is there a public api for multicasting that we can
              use ?
              Anybody has an idea on how to go about this..
              Thanks
              nisha
              

  • Java Client AUthentication to IIS 5 server throwing no IV for Cipher error

    I have trying to do Java client authentication. Got the Certificate from CA and loaded it in server. When I run the JavaClient program I get the
    error no IV for Cipher.
    I am using JDK 1.5.0_06 and JSSE 1.0.3_03.
    Any help is greatly appreciated.
    Thanks
    Here is the debug report
    trustStore is: C:\JTEST\cacerts
    trustStore type is : JKS
    trustStore provider is :
    init truststore
    adding as trusted cert:
    Subject: CN=devclient.test.com, OU=Mycompany, O=Second Data Corporation., L=San Francisco, ST=California, C=US
    Issuer: OU=Equifax Secure Certificate Authority, O=Equifax, C=US
    Algorithm: RSA; Serial number: 0x5b0bf
    Valid from Thu Feb 16 06:23:37 PST 2006 until Sat Feb 17 06:23:37 PST 2007
    adding as trusted cert:
    Subject: [email protected], CN=http://www.valicert.com/, OU=ValiCert Class 2 Policy Validation Authority, O="ValiCert, Inc.", L=ValiCert Validation Network
    Issuer: [email protected], CN=http://www.valicert.com/, OU=ValiCert Class 2 Policy Validation Authority, O="ValiCert, Inc.", L=ValiCert Validation Network
    Algorithm: RSA; Serial number: 0x1
    Valid from Fri Jun 25 17:19:54 PDT 1999 until Tue Jun 25 17:19:54 PDT 2019
    adding as trusted cert:
    Subject: CN=Baltimore CyberTrust Code Signing Root, OU=CyberTrust, O=Baltimore, C=IE
    Issuer: CN=Baltimore CyberTrust Code Signing Root, OU=CyberTrust, O=Baltimore, C=IE
    Algorithm: RSA; Serial number: 0x20000bf
    Valid from Wed May 17 07:01:00 PDT 2000 until Sat May 17 16:59:00 PDT 2025
    adding as trusted cert:
    Subject: CN=Entrust.net Secure Server Certification Authority, OU=(c) 1999 Entrust.net Limited, OU=www.entrust.net/CPS incorp. by ref. (limits liab.), O=Entrust.net, C=US
    Issuer: CN=Entrust.net Secure Server Certification Authority, OU=(c) 1999 Entrust.net Limited, OU=www.entrust.net/CPS incorp. by ref. (limits liab.), O=Entrust.net, C=US
    Algorithm: RSA; Serial number: 0x374ad243
    Valid from Tue May 25 09:09:40 PDT 1999 until Sat May 25 09:39:40 PDT 2019
    adding as trusted cert:
    Subject: CN=Baltimore CyberTrust Root, OU=CyberTrust, O=Baltimore, C=IE
    Issuer: CN=Baltimore CyberTrust Root, OU=CyberTrust, O=Baltimore, C=IE
    Algorithm: RSA; Serial number: 0x20000b9
    Valid from Fri May 12 11:46:00 PDT 2000 until Mon May 12 16:59:00 PDT 2025
    adding as trusted cert:
    Subject: CN=devclient.paymap.com, OU=First Data Corp, O=Paymap Inc, L=San Francisco, ST=California, C=USA
    Issuer: CN=Thawte Test CA Root, OU=TEST TEST TEST, O=Thawte Certification, ST=FOR TESTING PURPOSES ONLY, C=ZA
    Algorithm: RSA; Serial number: 0xe2501de73ac37428
    Valid from Mon Feb 20 15:51:25 PST 2006 until Mon Mar 13 15:51:25 PST 2006
    adding as trusted cert:
    Subject: CN=VeriSign Class 3 Public Primary Certification Authority - G3, OU="(c) 1999 VeriSign, Inc. - For authorized use only", OU=VeriSign Trust Network, O="VeriSign, Inc.", C=US
    Issuer: CN=VeriSign Class 3 Public Primary Certification Authority - G3, OU="(c) 1999 VeriSign, Inc. - For authorized use only", OU=VeriSign Trust Network, O="VeriSign, Inc.", C=US
    Algorithm: RSA; Serial number: 0x9b7e0649a33e62b9d5ee90487129ef57
    Valid from Thu Sep 30 17:00:00 PDT 1999 until Wed Jul 16 16:59:59 PDT 2036
    adding as trusted cert:
    Subject: OU=Starfield Class 2 Certification Authority, O="Starfield Technologies, Inc.", C=US
    Issuer: OU=Starfield Class 2 Certification Authority, O="Starfield Technologies, Inc.", C=US
    Algorithm: RSA; Serial number: 0x0
    Valid from Tue Jun 29 10:39:16 PDT 2004 until Thu Jun 29 10:39:16 PDT 2034
    adding as trusted cert:
    Subject: [email protected], CN=Thawte Personal Basic CA, OU=Certification Services Division, O=Thawte Consulting, L=Cape Town, ST=Western Cape, C=ZA
    Issuer: [email protected], CN=Thawte Personal Basic CA, OU=Certification Services Division, O=Thawte Consulting, L=Cape Town, ST=Western Cape, C=ZA
    Algorithm: RSA; Serial number: 0x0
    Valid from Sun Dec 31 16:00:00 PST 1995 until Thu Dec 31 15:59:59 PST 2020
    adding as trusted cert:
    Subject: OU=Class 3 Public Primary Certification Authority, O="VeriSign, Inc.", C=US
    Issuer: OU=Class 3 Public Primary Certification Authority, O="VeriSign, Inc.", C=US
    Algorithm: RSA; Serial number: 0x70bae41d10d92934b638ca7b03ccbabf
    Valid from Sun Jan 28 16:00:00 PST 1996 until Tue Aug 01 16:59:59 PDT 2028
    adding as trusted cert:
    Subject: OU=Equifax Secure eBusiness CA-2, O=Equifax Secure, C=US
    Issuer: OU=Equifax Secure eBusiness CA-2, O=Equifax Secure, C=US
    Algorithm: RSA; Serial number: 0x3770cfb5
    Valid from Wed Jun 23 05:14:45 PDT 1999 until Sun Jun 23 05:14:45 PDT 2019
    adding as trusted cert:
    Subject: OU=Equifax Secure Certificate Authority, O=Equifax, C=US
    Issuer: OU=Equifax Secure Certificate Authority, O=Equifax, C=US
    Algorithm: RSA; Serial number: 0x35def4cf
    Valid from Sat Aug 22 09:41:51 PDT 1998 until Wed Aug 22 09:41:51 PDT 2018
    adding as trusted cert:
    Subject: [email protected], CN=Thawte Personal Freemail CA, OU=Certification Services Division, O=Thawte Consulting, L=Cape Town, ST=Western Cape, C=ZA
    Issuer: [email protected], CN=Thawte Personal Freemail CA, OU=Certification Services Division, O=Thawte Consulting, L=Cape Town, ST=Western Cape, C=ZA
    Algorithm: RSA; Serial number: 0x0
    Valid from Sun Dec 31 16:00:00 PST 1995 until Thu Dec 31 15:59:59 PST 2020
    adding as trusted cert:
    Subject: CN=Equifax Secure eBusiness CA-1, O=Equifax Secure Inc., C=US
    Issuer: CN=Equifax Secure eBusiness CA-1, O=Equifax Secure Inc., C=US
    Algorithm: RSA; Serial number: 0x4
    Valid from Sun Jun 20 21:00:00 PDT 1999 until Sat Jun 20 21:00:00 PDT 2020
    adding as trusted cert:
    Subject: [email protected], CN=Thawte Personal Premium CA, OU=Certification Services Division, O=Thawte Consulting, L=Cape Town, ST=Western Cape, C=ZA
    Issuer: [email protected], CN=Thawte Personal Premium CA, OU=Certification Services Division, O=Thawte Consulting, L=Cape Town, ST=Western Cape, C=ZA
    Algorithm: RSA; Serial number: 0x0
    Valid from Sun Dec 31 16:00:00 PST 1995 until Thu Dec 31 15:59:59 PST 2020
    adding as trusted cert:
    Subject: CN=GTE CyberTrust Root 5, OU="GTE CyberTrust Solutions, Inc.", O=GTE Corporation, C=US
    Issuer: CN=GTE CyberTrust Root 5, OU="GTE CyberTrust Solutions, Inc.", O=GTE Corporation, C=US
    Algorithm: RSA; Serial number: 0x1b6
    Valid from Fri Aug 14 07:50:00 PDT 1998 until Wed Aug 14 16:59:00 PDT 2013
    adding as trusted cert:
    Subject: OU=Class 1 Public Primary Certification Authority, O="VeriSign, Inc.", C=US
    Issuer: OU=Class 1 Public Primary Certification Authority, O="VeriSign, Inc.", C=US
    Algorithm: RSA; Serial number: 0xcdba7f56f0dfe4bc54fe22acb372aa55
    Valid from Sun Jan 28 16:00:00 PST 1996 until Tue Aug 01 16:59:59 PDT 2028
    adding as trusted cert:
    Subject: CN=GTE CyberTrust Root, O=GTE Corporation, C=US
    Issuer: CN=GTE CyberTrust Root, O=GTE Corporation, C=US
    Algorithm: RSA; Serial number: 0x1a3
    Valid from Fri Feb 23 15:01:00 PST 1996 until Thu Feb 23 15:59:00 PST 2006
    adding as trusted cert:
    Subject: CN=Entrust.net Secure Server Certification Authority, OU=(c) 2000 Entrust.net Limited, OU=www.entrust.net/SSL_CPS incorp. by ref. (limits liab.), O=Entrust.net
    Issuer: CN=Entrust.net Secure Server Certification Authority, OU=(c) 2000 Entrust.net Limited, OU=www.entrust.net/SSL_CPS incorp. by ref. (limits liab.), O=Entrust.net
    Algorithm: RSA; Serial number: 0x389b113c
    Valid from Fri Feb 04 09:20:00 PST 2000 until Tue Feb 04 09:50:00 PST 2020
    adding as trusted cert:
    Subject: OU=VeriSign Trust Network, OU="(c) 1998 VeriSign, Inc. - For authorized use only", OU=Class 3 Public Primary Certification Authority - G2, O="VeriSign, Inc.", C=US
    Issuer: OU=VeriSign Trust Network, OU="(c) 1998 VeriSign, Inc. - For authorized use only", OU=Class 3 Public Primary Certification Authority - G2, O="VeriSign, Inc.", C=US
    Algorithm: RSA; Serial number: 0x7dd9fe07cfa81eb7107967fba78934c6
    Valid from Sun May 17 17:00:00 PDT 1998 until Tue Aug 01 16:59:59 PDT 2028
    adding as trusted cert:
    Subject: [email protected], CN=Thawte Premium Server CA, OU=Certification Services Division, O=Thawte Consulting cc, L=Cape Town, ST=Western Cape, C=ZA
    Issuer: [email protected], CN=Thawte Premium Server CA, OU=Certification Services Division, O=Thawte Consulting cc, L=Cape Town, ST=Western Cape, C=ZA
    Algorithm: RSA; Serial number: 0x1
    Valid from Wed Jul 31 17:00:00 PDT 1996 until Thu Dec 31 15:59:59 PST 2020
    adding as trusted cert:
    Subject: OU=Secure Server Certification Authority, O="RSA Data Security, Inc.", C=US
    Issuer: OU=Secure Server Certification Authority, O="RSA Data Security, Inc.", C=US
    Algorithm: RSA; Serial number: 0x2ad667e4e45fe5e576f3c98195eddc0
    Valid from Tue Nov 08 16:00:00 PST 1994 until Thu Jan 07 15:59:59 PST 2010
    adding as trusted cert:
    Subject: CN=Entrust.net Client Certification Authority, OU=(c) 1999 Entrust.net Limited, OU=www.entrust.net/Client_CA_Info/CPS incorp. by ref. limits liab., O=Entrust.net, C=US
    Issuer: CN=Entrust.net Client Certification Authority, OU=(c) 1999 Entrust.net Limited, OU=www.entrust.net/Client_CA_Info/CPS incorp. by ref. limits liab., O=Entrust.net, C=US
    Algorithm: RSA; Serial number: 0x380391ee
    Valid from Tue Oct 12 12:24:30 PDT 1999 until Sat Oct 12 12:54:30 PDT 2019
    adding as trusted cert:
    Subject: CN=Entrust.net Client Certification Authority, OU=(c) 2000 Entrust.net Limited, OU=www.entrust.net/GCCA_CPS incorp. by ref. (limits liab.), O=Entrust.net
    Issuer: CN=Entrust.net Client Certification Authority, OU=(c) 2000 Entrust.net Limited, OU=www.entrust.net/GCCA_CPS incorp. by ref. (limits liab.), O=Entrust.net
    Algorithm: RSA; Serial number: 0x389ef6e4
    Valid from Mon Feb 07 08:16:40 PST 2000 until Fri Feb 07 08:46:40 PST 2020
    adding as trusted cert:
    Subject: OU=Class 2 Public Primary Certification Authority, O="VeriSign, Inc.", C=US
    Issuer: OU=Class 2 Public Primary Certification Authority, O="VeriSign, Inc.", C=US
    Algorithm: RSA; Serial number: 0x2d1bfc4a178da391ebe7fff58b45be0b
    Valid from Sun Jan 28 16:00:00 PST 1996 until Tue Aug 01 16:59:59 PDT 2028
    adding as trusted cert:
    Subject: CN=VeriSign Class 2 Public Primary Certification Authority - G3, OU="(c) 1999 VeriSign, Inc. - For authorized use only", OU=VeriSign Trust Network, O="VeriSign, Inc.", C=US
    Issuer: CN=VeriSign Class 2 Public Primary Certification Authority - G3, OU="(c) 1999 VeriSign, Inc. - For authorized use only", OU=VeriSign Trust Network, O="VeriSign, Inc.", C=US
    Algorithm: RSA; Serial number: 0x6170cb498c5f984529e7b0a6d9505b7a
    Valid from Thu Sep 30 17:00:00 PDT 1999 until Wed Jul 16 16:59:59 PDT 2036
    adding as trusted cert:
    Subject: CN=GTE CyberTrust Global Root, OU="GTE CyberTrust Solutions, Inc.", O=GTE Corporation, C=US
    Issuer: CN=GTE CyberTrust Global Root, OU="GTE CyberTrust Solutions, Inc.", O=GTE Corporation, C=US
    Algorithm: RSA; Serial number: 0x1a5
    Valid from Wed Aug 12 17:29:00 PDT 1998 until Mon Aug 13 16:59:00 PDT 2018
    adding as trusted cert:
    Subject: [email protected], CN=Thawte Server CA, OU=Certification Services Division, O=Thawte Consulting cc, L=Cape Town, ST=Western Cape, C=ZA
    Issuer: [email protected], CN=Thawte Server CA, OU=Certification Services Division, O=Thawte Consulting cc, L=Cape Town, ST=Western Cape, C=ZA
    Algorithm: RSA; Serial number: 0x1
    Valid from Wed Jul 31 17:00:00 PDT 1996 until Thu Dec 31 15:59:59 PST 2020
    adding as trusted cert:
    Subject: CN=GeoTrust Global CA, O=GeoTrust Inc., C=US
    Issuer: CN=GeoTrust Global CA, O=GeoTrust Inc., C=US
    Algorithm: RSA; Serial number: 0x23456
    Valid from Mon May 20 21:00:00 PDT 2002 until Fri May 20 21:00:00 PDT 2022
    adding as trusted cert:
    Subject: CN=Entrust.net Certification Authority (2048), OU=(c) 1999 Entrust.net Limited, OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.), O=Entrust.net
    Issuer: CN=Entrust.net Certification Authority (2048), OU=(c) 1999 Entrust.net Limited, OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.), O=Entrust.net
    Algorithm: RSA; Serial number: 0x3863b966
    Valid from Fri Dec 24 09:50:51 PST 1999 until Tue Dec 24 10:20:51 PST 2019
    adding as trusted cert:
    Subject: CN=Equifax Secure Global eBusiness CA-1, O=Equifax Secure Inc., C=US
    Issuer: CN=Equifax Secure Global eBusiness CA-1, O=Equifax Secure Inc., C=US
    Algorithm: RSA; Serial number: 0x1
    Valid from Sun Jun 20 21:00:00 PDT 1999 until Sat Jun 20 21:00:00 PDT 2020
    adding as trusted cert:
    Subject: OU=Go Daddy Class 2 Certification Authority, O="The Go Daddy Group, Inc.", C=US
    Issuer: OU=Go Daddy Class 2 Certification Authority, O="The Go Daddy Group, Inc.", C=US
    Algorithm: RSA; Serial number: 0x0
    Valid from Tue Jun 29 10:06:20 PDT 2004 until Thu Jun 29 10:06:20 PDT 2034
    adding as trusted cert:
    Subject: CN=VeriSign Class 1 Public Primary Certification Authority - G3, OU="(c) 1999 VeriSign, Inc. - For authorized use only", OU=VeriSign Trust Network, O="VeriSign, Inc.", C=US
    Issuer: CN=VeriSign Class 1 Public Primary Certification Authority - G3, OU="(c) 1999 VeriSign, Inc. - For authorized use only", OU=VeriSign Trust Network, O="VeriSign, Inc.", C=US
    Algorithm: RSA; Serial number: 0x8b5b75568454850b00cfaf3848ceb1a4
    Valid from Thu Sep 30 17:00:00 PDT 1999 until Wed Jul 16 16:59:59 PDT 2036
    adding as trusted cert:
    Subject: OU=VeriSign Trust Network, OU="(c) 1998 VeriSign, Inc. - For authorized use only", OU=Class 2 Public Primary Certification Authority - G2, O="VeriSign, Inc.", C=US
    Issuer: OU=VeriSign Trust Network, OU="(c) 1998 VeriSign, Inc. - For authorized use only", OU=Class 2 Public Primary Certification Authority - G2, O="VeriSign, Inc.", C=US
    Algorithm: RSA; Serial number: 0xb92f60cc889fa17a4609b85b706c8aaf
    Valid from Sun May 17 17:00:00 PDT 1998 until Tue Aug 01 16:59:59 PDT 2028
    adding as trusted cert:
    Subject: OU=VeriSign Trust Network, OU="(c) 1998 VeriSign, Inc. - For authorized use only", OU=Class 1 Public Primary Certification Authority - G2, O="VeriSign, Inc.", C=US
    Issuer: OU=VeriSign Trust Network, OU="(c) 1998 VeriSign, Inc. - For authorized use only", OU=Class 1 Public Primary Certification Authority - G2, O="VeriSign, Inc.", C=US
    Algorithm: RSA; Serial number: 0x4cc7eaaa983e71d39310f83d3a899192
    Valid from Sun May 17 17:00:00 PDT 1998 until Tue Aug 01 16:59:59 PDT 2028
    trigger seeding of SecureRandom
    done seeding SecureRandom
    main, setSoTimeout(50000) called
    TIMEOUT=50000
    %% No cached client session
    *** ClientHello, TLSv1
    RandomCookie: GMT: 1123703368 bytes = { 11, 7, 242, 147, 134, 10, 57, 192, 137, 131, 191, 249, 253, 146, 232, 223, 146, 195, 53, 255, 121, 236, 182, 158, 191, 94, 156, 190 }
    Session ID: {}
    Cipher Suites: [SSL_RSA_WITH_RC4_128_MD5, SSL_RSA_WITH_RC4_128_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_DES_CBC_SHA, SSL_DHE_RSA_WITH_DES_CBC_SHA, SSL_DHE_DSS_WITH_DES_CBC_SHA, SSL_RSA_EXPORT_WITH_RC4_40_MD5, SSL_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA]
    Compression Methods: { 0 }
    main, WRITE: TLSv1 Handshake, length = 73
    main, WRITE: SSLv2 client hello message, length = 98
    main, READ: TLSv1 Handshake, length = 873
    *** ServerHello, TLSv1
    RandomCookie: GMT: 1123703296 bytes = { 123, 165, 102, 102, 169, 196, 229, 241, 3, 49, 81, 239, 83, 155, 209, 243, 236, 229, 18, 193, 228, 104, 27, 152, 232, 193, 173, 11 }
    Session ID: {147, 24, 0, 0, 22, 29, 124, 158, 177, 166, 96, 36, 217, 32, 191, 41, 36, 217, 54, 244, 11, 56, 214, 139, 133, 140, 38, 132, 157, 77, 87, 77}
    Cipher Suite: SSL_RSA_WITH_RC4_128_MD5
    Compression Method: 0
    %% Created: [Session-1, SSL_RSA_WITH_RC4_128_MD5]
    ** SSL_RSA_WITH_RC4_128_MD5
    *** Certificate chain
    chain [0] = [
    Version: V3
    Subject: CN=www.just-in-time-eft-paymap.com, OU=Paymap, O=First Data Corporation., L=San Francisco, ST=California, C=US
    Signature Algorithm: SHA1withRSA, OID = 1.2.840.113549.1.1.5
    Key: Sun RSA public key, 1024 bits
    modulus: 115897801846480906504507305240934762652258285705294305856746227593079520228602278416768070978663757452626836382370415992468189745643687252249588163510925353035555192020212360325664657305599855674966873189987712512397233103225326014387972568754281141553272745093478026229567341632738641376167448499163118598699
    public exponent: 65537
    Validity: [From: Mon Sep 12 11:37:51 PDT 2005,
                   To: Sun Nov 12 11:37:51 PST 2006]
    Issuer: OU=Equifax Secure Certificate Authority, O=Equifax, C=US
    SerialNumber: [    057aa7]
    Certificate Extensions: 5
    [1]: ObjectId: 2.5.29.14 Criticality=false
    SubjectKeyIdentifier [
    KeyIdentifier [
    0000: FC 76 D2 8C C3 DE 0D 8F EA 32 26 60 83 C9 8B 9C .v.......2&`....
    0010: C6 E6 BB 57 ...W
    [2]: ObjectId: 2.5.29.35 Criticality=false
    AuthorityKeyIdentifier [
    KeyIdentifier [
    0000: 48 E6 68 F9 2B D2 B2 95 D7 47 D8 23 20 10 4F 33 H.h.+....G.# .O3
    0010: 98 90 9F D4 ....
    [3]: ObjectId: 2.5.29.31 Criticality=false
    CRLDistributionPoints [
    [DistributionPoint:
    [URIName: http://crl.geotrust.com/crls/secureca.crl]
    [4]: ObjectId: 2.5.29.37 Criticality=false
    ExtendedKeyUsages [
    [1.3.6.1.5.5.7.3.1, 1.3.6.1.5.5.7.3.2]]
    [5]: ObjectId: 2.5.29.15 Criticality=true
    KeyUsage [
    DigitalSignature
    Non_repudiation
    Key_Encipherment
    Data_Encipherment
    Algorithm: [SHA1withRSA]
    Signature:
    0000: 44 D7 B0 69 BF B0 AA 4D 5A 17 70 9C 37 BA 61 A2 D..i...MZ.p.7.a.
    0010: 57 B4 34 85 6D 59 1F 82 72 34 9B 92 7D BD DF 27 W.4.mY..r4.....'
    0020: CE 97 E3 CA AE 23 5D 85 3C 1A C6 19 D1 49 C2 3F .....#].<....I.?
    0030: C6 E2 7E 97 8D 63 94 1E 04 AC 9F 5F 37 08 2A 96 .....c....._7.*.
    0040: 1A 47 D1 9D 69 0C 71 6A F3 74 1C FF 7D 20 E1 CA .G..i.qj.t... ..
    0050: 75 D0 45 84 2E 11 3C DD D4 73 25 38 76 27 E0 73 u.E...<..s%8v'.s
    0060: 70 AC 70 0F A5 E3 5B 9D 7E 0E AB 6A 79 07 18 38 p.p...[....jy..8
    0070: 5B A1 63 A2 89 8C 96 A1 50 36 4C D2 C6 D5 27 25 [.c.....P6L...'%
    Found trusted certificate:
    Version: V3
    Subject: OU=Equifax Secure Certificate Authority, O=Equifax, C=US
    Signature Algorithm: SHA1withRSA, OID = 1.2.840.113549.1.1.5
    Key: Sun RSA public key, 1024 bits
    modulus: 135786214035069526348186531221551781468391756233528066061569654028671100866720352830303278016129003918213826297308054231261658522889438712013757624116391437358730449661353175673177742307421061340003741057138887918110217006515773038453829253517076741780039735595086881329494037450587568122088113584549069375417
    public exponent: 65537
    Validity: [From: Sat Aug 22 09:41:51 PDT 1998,
                   To: Wed Aug 22 09:41:51 PDT 2018]
    Issuer: OU=Equifax Secure Certificate Authority, O=Equifax, C=US
    SerialNumber: [    35def4cf]
    Certificate Extensions: 7
    [1]: ObjectId: 1.2.840.113533.7.65.0 Criticality=false
    Extension unknown: DER encoded OCTET string =
    0000: 04 0D 30 0B 1B 05 56 33 2E 30 63 03 02 06 C0 ..0...V3.0c....
    [2]: ObjectId: 2.5.29.14 Criticality=false
    SubjectKeyIdentifier [
    KeyIdentifier [
    0000: 48 E6 68 F9 2B D2 B2 95 D7 47 D8 23 20 10 4F 33 H.h.+....G.# .O3
    0010: 98 90 9F D4 ....
    [3]: ObjectId: 2.5.29.35 Criticality=false
    AuthorityKeyIdentifier [
    KeyIdentifier [
    0000: 48 E6 68 F9 2B D2 B2 95 D7 47 D8 23 20 10 4F 33 H.h.+....G.# .O3
    0010: 98 90 9F D4 ....
    [4]: ObjectId: 2.5.29.31 Criticality=false
    CRLDistributionPoints [
    [DistributionPoint:
    [CN=CRL1, OU=Equifax Secure Certificate Authority, O=Equifax, C=US]
    [5]: ObjectId: 2.5.29.15 Criticality=false
    KeyUsage [
    Key_CertSign
    Crl_Sign
    [6]: ObjectId: 2.5.29.16 Criticality=false
    PrivateKeyUsage: [
    To: Wed Aug 22 09:41:51 PDT 2018]
    [7]: ObjectId: 2.5.29.19 Criticality=false
    BasicConstraints:[
    CA:true
    PathLen:2147483647
    Algorithm: [SHA1withRSA]
    Signature:
    0000: 58 CE 29 EA FC F7 DE B5 CE 02 B9 17 B5 85 D1 B9 X.).............
    0010: E3 E0 95 CC 25 31 0D 00 A6 92 6E 7F B6 92 63 9E ....%1....n...c.
    0020: 50 95 D1 9A 6F E4 11 DE 63 85 6E 98 EE A8 FF 5A P...o...c.n....Z
    0030: C8 D3 55 B2 66 71 57 DE C0 21 EB 3D 2A A7 23 49 ..U.fqW..!.=*.#I
    0040: 01 04 86 42 7B FC EE 7F A2 16 52 B5 67 67 D3 40 ...B......R.gg.@
    0050: DB 3B 26 58 B2 28 77 3D AE 14 77 61 D6 FA 2A 66 .;&X.(w=..wa..*f
    0060: 27 A0 0D FA A7 73 5C EA 70 F1 94 21 65 44 5F FA '....s\.p..!eD_.
    0070: FC EF 29 68 A9 A2 87 79 EF 79 EF 4F AC 07 77 38 ..)h...y.y.O..w8
    *** ServerHelloDone
    *** ClientKeyExchange, RSA PreMasterSecret, TLSv1
    Random Secret: { 3, 1, 82, 2, 69, 241, 210, 36, 175, 168, 76, 86, 170, 3, 158, 52, 89, 146, 84, 210, 223, 113, 212, 231, 129, 100, 177, 125, 116, 31, 97, 233, 150, 162, 161, 51, 168, 189, 14, 47, 83, 27, 67, 252, 172, 191, 102, 39 }
    main, WRITE: TLSv1 Handshake, length = 134
    SESSION KEYGEN:
    PreMaster Secret:
    0000: 03 01 52 02 45 F1 D2 24 AF A8 4C 56 AA 03 9E 34 ..R.E..$..LV...4
    0010: 59 92 54 D2 DF 71 D4 E7 81 64 B1 7D 74 1F 61 E9 Y.T..q...d..t.a.
    0020: 96 A2 A1 33 A8 BD 0E 2F 53 1B 43 FC AC BF 66 27 ...3.../S.C...f'
    CONNECTION KEYGEN:
    Client Nonce:
    0000: 43 FA 5A 48 0B 07 F2 93 86 0A 39 C0 89 83 BF F9 C.ZH......9.....
    0010: FD 92 E8 DF 92 C3 35 FF 79 EC B6 9E BF 5E 9C BE ......5.y....^..
    Server Nonce:
    0000: 43 FA 5A 00 7B A5 66 66 A9 C4 E5 F1 03 31 51 EF C.Z...ff.....1Q.
    0010: 53 9B D1 F3 EC E5 12 C1 E4 68 1B 98 E8 C1 AD 0B S........h......
    Master Secret:
    0000: 10 47 C2 16 13 58 4B 50 D3 D6 34 05 C8 C9 11 29 .G...XKP..4....)
    0010: AD 90 0D 8F 9B BD C8 C1 FC CD BC 26 ED FB 26 84 ...........&..&.
    0020: 04 0B 94 BC D2 4D 7D 71 E0 1E 08 10 59 38 B5 4E .....M.q....Y8.N
    Client MAC write Secret:
    0000: A5 66 C1 48 0E F1 18 2B 2B 7A F7 9B A4 6C D7 FA .f.H...++z...l..
    Server MAC write Secret:
    0000: 3B F5 04 FA AC 9C D7 ED 2E E7 36 44 80 FF 11 E2 ;.........6D....
    Client write key:
    0000: 7B 9F 56 A1 FC 3D BD 31 25 27 91 BB D0 66 66 0B ..V..=.1%'...ff.
    Server write key:
    0000: 2B 45 E2 19 E8 C8 61 5B 84 B8 94 76 A1 B4 9C 6E +E....a[...v...n
    ... no IV for cipher
    main, WRITE: TLSv1 Change Cipher Spec, length = 1
    *** Finished
    verify_data: { 110, 253, 95, 109, 150, 89, 93, 140, 108, 186, 172, 188 }
    main, WRITE: TLSv1 Handshake, length = 32
    main, READ: TLSv1 Change Cipher Spec, length = 1
    main, READ: TLSv1 Handshake, length = 32
    *** Finished
    verify_data: { 70, 219, 18, 202, 105, 203, 83, 220, 151, 174, 102, 125 }
    %% Cached client session: [Session-1, SSL_RSA_WITH_RC4_128_MD5]
    main, setSoTimeout(50000) called
    main, WRITE: TLSv1 Application Data, length = 96
    main, setSoTimeout(50000) called
    main, READ: TLSv1 Handshake, length = 20
    *** HelloRequest (empty)
    %% Client cached [Session-1, SSL_RSA_WITH_RC4_128_MD5]
    %% Try resuming [Session-1, SSL_RSA_WITH_RC4_128_MD5] from port 1130
    *** ClientHello, TLSv1
    RandomCookie: GMT: 1123703368 bytes = { 242, 6, 117, 127, 243, 197, 134, 82, 139, 54, 241, 243, 132, 22, 63, 136, 4, 180, 225, 8, 159, 55, 182, 105, 133, 226, 213, 167 }
    Session ID: {147, 24, 0, 0, 22, 29, 124, 158, 177, 166, 96, 36, 217, 32, 191, 41, 36, 217, 54, 244, 11, 56, 214, 139, 133, 140, 38, 132, 157, 77, 87, 77}
    Cipher Suites: [SSL_RSA_WITH_RC4_128_MD5, SSL_RSA_WITH_RC4_128_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_DES_CBC_SHA, SSL_DHE_RSA_WITH_DES_CBC_SHA, SSL_DHE_DSS_WITH_DES_CBC_SHA, SSL_RSA_EXPORT_WITH_RC4_40_MD5, SSL_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA]
    Compression Methods: { 0 }
    main, WRITE: TLSv1 Handshake, length = 121
    main, READ: TLSv1 Handshake, length = 11432
    *** ServerHello, TLSv1
    RandomCookie: GMT: 1123703296 bytes = { 168, 158, 224, 186, 230, 77, 9, 24, 237, 106, 203, 158, 176, 252, 249, 167, 73, 173, 69, 178, 115, 34, 96, 179, 191, 230, 178, 160 }
    Session ID: {3, 27, 0, 0, 51, 252, 181, 131, 214, 28, 220, 247, 154, 175, 51, 237, 76, 111, 88, 78, 28, 105, 106, 114, 42, 51, 53, 144, 178, 93, 245, 127}
    Cipher Suite: SSL_RSA_WITH_RC4_128_MD5
    Compression Method: 0
    %% Created: [Session-2, SSL_RSA_WITH_RC4_128_MD5]
    ** SSL_RSA_WITH_RC4_128_MD5
    *** Certificate chain
    chain [0] = [
    Version: V3
    Subject: CN=www.just-in-time-eft-paymap.com, OU=Paymap, O=First Data Corporation., L=San Francisco, ST=California, C=US
    Signature Algorithm: SHA1withRSA, OID = 1.2.840.113549.1.1.5
    Key: Sun RSA public key, 1024 bits
    modulus: 115897801846480906504507305240934762652258285705294305856746227593079520228602278416768070978663757452626836382370415992468189745643687252249588163510925353035555192020212360325664657305599855674966873189987712512397233103225326014387972568754281141553272745093478026229567341632738641376167448499163118598699
    public exponent: 65537
    Validity: [From: Mon Sep 12 11:37:51 PDT 2005,
                   To: Sun Nov 12 11:37:51 PST 2006]
    Issuer: OU=Equifax Secure Certificate Authority, O=Equifax, C=US
    SerialNumber: [    057aa7]
    Certificate Extensions: 5
    [1]: ObjectId: 2.5.29.14 Criticality=false
    SubjectKeyIdentifier [
    KeyIdentifier [
    0000: FC 76 D2 8C C3 DE 0D 8F EA 32 26 60 83 C9 8B 9C .v.......2&`....
    0010: C6 E6 BB 57 ...W
    [2]: ObjectId: 2.5.29.35 Criticality=false
    AuthorityKeyIdentifier [
    KeyIdentifier [
    0000: 48 E6 68 F9 2B D2 B2 95 D7 47 D8 23 20 10 4F 33 H.h.+....G.# .O3
    0010: 98 90 9F D4 ....
    [3]: ObjectId: 2.5.29.31 Criticality=false
    CRLDistributionPoints [
    [DistributionPoint:
    [URIName: http://crl.geotrust.com/crls/secureca.crl]
    [4]: ObjectId: 2.5.29.37 Criticality=false
    ExtendedKeyUsages [
    [1.3.6.1.5.5.7.3.1, 1.3.6.1.5.5.7.3.2]]
    [5]: ObjectId: 2.5.29.15 Criticality=true
    KeyUsage [
    DigitalSignature
    Non_repudiation
    Key_Encipherment
    Data_Encipherment
    Algorithm: [SHA1withRSA]
    Signature:
    0000: 44 D7 B0 69 BF B0 AA 4D 5A 17 70 9C 37 BA 61 A2 D..i...MZ.p.7.a.
    0010: 57 B4 34 85 6D 59 1F 82 72 34 9B 92 7D BD DF 27 W.4.mY..r4.....'
    0020: CE 97 E3 CA AE 23 5D 85 3C 1A C6 19 D1 49 C2 3F .....#].<....I.?
    0030: C6 E2 7E 97 8D 63 94 1E 04 AC 9F 5F 37 08 2A 96 .....c....._7.*.
    0040: 1A 47 D1 9D 69 0C 71 6A F3 74 1C FF 7D 20 E1 CA .G..i.qj.t... ..
    0050: 75 D0 45 84 2E 11 3C DD D4 73 25 38 76 27 E0 73 u.E...<..s%8v'.s
    0060: 70 AC 70 0F A5 E3 5B 9D 7E 0E AB 6A 79 07 18 38 p.p...[....jy..8
    0070: 5B A1 63 A2 89 8C 96 A1 50 36 4C D2 C6 D5 27 25 [.c.....P6L...'%
    Found trusted certificate:
    Version: V3
    Subject: OU=Equifax Secure Certificate Authority, O=Equifax, C=US
    Signature Algorithm: SHA1withRSA, OID = 1.2.840.113549.1.1.5
    Key: Sun RSA public key, 1024 bits
    modulus: 135786214035069526348186531221551781468391756233528066061569654028671100866720352830303278016129003918213826297308054231261658522889438712013757624116391437358730449661353175673177742307421061340003741057138887918110217006515773038453829253517076741780039735595086881329494037450587568122088113584549069375417
    public exponent: 65537
    Validity: [From: Sat Aug 22 09:41:51 PDT 1998,
                   To: Wed Aug 22 09:41:51 PDT 2018]
    Issuer: OU=Equifax Secure Certificate Authority, O=Equifax, C=US
    SerialNumber: [    35def4cf]
    Certificate Extensions: 7
    [1]: ObjectId: 1.2.840.113533.7.65.0 Criticality=false
    Extension unknown: DER encoded OCTET string =
    0000: 04 0D 30 0B 1B 05 56 33 2E 30 63 03 02 06 C0 ..0...V3.0c....
    [2]: ObjectId: 2.5.29.14 Criticality=false
    SubjectKeyIdentifier [
    KeyIdentifier [
    0000: 48 E6 68 F9 2B D2 B2 95 D7 47 D8 23 20 10 4F 33 H.h.+....G.# .O3
    0010: 98 90 9F D4 ....
    [3]: ObjectId: 2.5.29.35 Criticality=false
    AuthorityKeyIdentifier [
    KeyIdentifier [
    0000: 48 E6 68 F9 2B D2 B2 95 D7 47 D8 23 20 10 4F 33 H.h.+....G.# .O3
    0010: 98 90 9F D4 ....
    [4]: ObjectId: 2.5.29.31 Criticality=false
    CRLDistributionPoints [
    [DistributionPoint:
    [CN=CRL1, OU=Equifax Secure Certificate Authority, O=Equifax, C=US]
    [5]: ObjectId: 2.5.29.15 Criticality=false
    KeyUsage [
    Key_CertSign
    Crl_Sign
    [6]: ObjectId: 2.5.29.16 Criticality=false
    PrivateKeyUsage: [
    To: Wed Aug 22 09:41:51 PDT 2018]
    [7]: ObjectId: 2.5.29.19 Criticality=false
    BasicConstraints:[
    CA:true
    PathLen:2147483647
    Algorithm: [SHA1withRSA]
    Signature:
    0000: 58 CE 29 EA FC F7 DE B5 CE 02 B9 17 B5 85 D1 B9 X.).............
    0010: E3 E0 95 CC 25 31 0D 00 A6 92 6E 7F B6 92 63 9E ....%1....n...c.
    0020: 50 95 D1 9A 6F E4 11 DE 63 85 6E 98 EE A8 FF 5A P...o...c.n....Z
    0030: C8 D3 55 B2 66 71 57 DE C0 21 EB 3D 2A A7 23 49 ..U.fqW..!.=*.#I
    0040: 01 04 86 42 7B FC EE 7F A2 16 52 B5 67 67 D3 40 ...B......R.gg.@
    0050: DB 3B 26 58 B2 28 77 3D AE 14 77 61 D6 FA 2A 66 .;&X.(w=..wa..*f
    0060: 27 A0 0D FA A7 73 5C EA 70 F1 94 21 65 44 5F FA '....s\.p..!eD_.
    0070: FC EF 29 68 A9 A2 87 79 EF 79 EF 4F AC 07 77 38 ..)h...y.y.O..w8
    *** CertificateRequest
    Cert Types: RSA,
    Cert Authorities:
    <OU=VeriSign Trust Network, OU="(c) 1998 VeriSign, Inc. - For authorized use only", OU=Class 1 Public Primary Certification Authority - G2, O="VeriSign, Inc.", C=US>
    <CN=Sonera Class1 CA, O=Sonera, C=FI>
    <OU=VeriSign Trust Network, OU="(c) 1998 VeriSign, Inc. - For authorized use only", OU=Class 4 Public Primary Certification Authority - G2, O="VeriSign, Inc.", C=US>
    <CN=Staat der Nederlanden Root CA, O=Staat der Nederlanden, C=NL>
    <CN=VeriSign Class 3

    I have the same problem. I�m turning crazy working with certificates in mutual athetication!!!
    If someone has the solution to this problem, send a repy or at [email protected]
    Thanks in advance

  • Connecting Java client to SSL server with existing certificates

    I am currently trying to connect my Java client to an existing server application
    written in C++. I have been provided the needed certificates (root.pem, server.pem,
    and client.pem). My code simply creates a SSLSocket and then attempts to read
    from it. Something goes wrong during the handshake process and I get a SSLHandshakeException. The certificates have been added to the keystore
    I am using, and I do not know any other action to take.
    Here is the debug output:
    setting up default SSLSocketFactory
    use default SunJSSE impl class: com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl
    class com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl is loaded
    keyStore is :
    keyStore type is : jks
    keyStore provider is :
    init keystore
    init keymanager of type SunX509
    trustStore is: keystore.jks
    trustStore type is : jks
    trustStore provider is :
    init truststore
    adding as trusted cert:
    Subject: [email protected], CN=Employee, OU=test, O=company-USA, L=City, ST=AL, C=US
    Issuer: [email protected], CN=company Employee, OU=test, O="company, Inc.", L=City, ST=AL, C=US
    Algorithm: RSA; Serial number: 0xb40b909f74d167aa
    Valid from Tue Sep 12 09:42:01 CDT 2006 until Thu Oct 12 09:42:01 CDT 2006
    adding as trusted cert:
    Subject: [email protected], CN=Employee, OU=test, O="company, Inc.", L=City, ST=AL, C=US
    Issuer: [email protected], CN=ISAC Employee, OU=test, O="company, Inc.", L=City, ST=AL, C=US
    Algorithm: RSA; Serial number: 0xb40b909f74d167ab
    Valid from Tue Sep 12 09:49:12 CDT 2006 until Thu Oct 12 09:49:12 CDT 2006
    adding as trusted cert:
    Subject: [email protected], CN=company Employee, OU=test, O="company, Inc.", L=City, ST=AL, C=US
    Issuer: [email protected], CN=company, OU=test, O="company, Inc.", L=City, ST=AL, C=US
    Algorithm: RSA; Serial number: 0xf6e3ada87dc4004f
    Valid from Tue Sep 12 09:40:32 CDT 2006 until Thu Oct 12 09:40:32 CDT 2006
    init context
    trigger seeding of SecureRandom
    done seeding SecureRandom
    instantiated an instance of class com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl
    SSL socket created
    %% No cached client session
    *** ClientHello, TLSv1
    RandomCookie: GMT: 1158089181 bytes = { 138, 112, 170, 91, 246, 86, 216, 146, 160, 188, 243, 154, 238, 132, 33, 219, 251, 3, 93, 25, 191, 247, 41, 14, 99, 135, 130, 23 }
    Session ID: {}
    Cipher Suites: [SSL_RSA_WITH_RC4_128_MD5, SSL_RSA_WITH_RC4_128_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_DES_CBC_SHA, SSL_DHE_RSA_WITH_DES_CBC_SHA, SSL_DHE_DSS_WITH_DES_CBC_SHA, SSL_RSA_EXPORT_WITH_RC4_40_MD5, SSL_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA]
    Compression Methods: { 0 }
    [write] MD5 and SHA1 hashes: len = 79
    0000: 01 00 00 4B 03 01 45 07 0A DD 8A 70 AA 5B F6 56 ...K..E....p.[.V
    0010: D8 92 A0 BC F3 9A EE 84 21 DB FB 03 5D 19 BF F7 ........!...]...
    0020: 29 0E 63 87 82 17 00 00 24 00 04 00 05 00 2F 00 ).c.....$...../.
    0030: 35 00 33 00 39 00 32 00 38 00 0A 00 16 00 13 00 5.3.9.2.8.......
    0040: 09 00 15 00 12 00 03 00 08 00 14 00 11 01 00 ...............
    Client Thread, WRITE: TLSv1 Handshake, length = 79
    [write] MD5 and SHA1 hashes: len = 107
    0000: 01 03 01 00 42 00 00 00 20 00 00 04 01 00 80 00 ....B... .......
    0010: 00 05 00 00 2F 00 00 35 00 00 33 00 00 39 00 00 ..../..5..3..9..
    0020: 32 00 00 38 00 00 0A 07 00 C0 00 00 16 00 00 13 2..8............
    0030: 00 00 09 06 00 40 00 00 15 00 00 12 00 00 03 02 .....@..........
    0040: 00 80 00 00 08 00 00 14 00 00 11 45 07 0A DD 8A ...........E....
    0050: 70 AA 5B F6 56 D8 92 A0 BC F3 9A EE 84 21 DB FB p.[.V........!..
    0060: 03 5D 19 BF F7 29 0E 63 87 82 17 .]...).c...
    Client Thread, WRITE: SSLv2 client hello message, length = 107
    [Raw write]: length = 109
    0000: 80 6B 01 03 01 00 42 00 00 00 20 00 00 04 01 00 .k....B... .....
    0010: 80 00 00 05 00 00 2F 00 00 35 00 00 33 00 00 39 ....../..5..3..9
    0020: 00 00 32 00 00 38 00 00 0A 07 00 C0 00 00 16 00 ..2..8..........
    0030: 00 13 00 00 09 06 00 40 00 00 15 00 00 12 00 00 .......@........
    0040: 03 02 00 80 00 00 08 00 00 14 00 00 11 45 07 0A .............E..
    0050: DD 8A 70 AA 5B F6 56 D8 92 A0 BC F3 9A EE 84 21 ..p.[.V........!
    0060: DB FB 03 5D 19 BF F7 29 0E 63 87 82 17 ...]...).c...
    Client Thread, received EOFException: error
    Client Thread, handling exception: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
    Client Thread, SEND TLSv1 ALERT: fatal, description = handshake_failure
    Client Thread, WRITE: TLSv1 Alert, length = 2
    [Raw write]: length = 7
    0000: 15 03 01 00 02 02 28 ......(
    Client Thread, called closeSocket()
    Error: Remote host closed connection during handshake
    Thread-4, handling exception: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake

    (I am the original poster of this message, I had to create a new username though).
    The original problem had to do with incompatibilities with the protocol and/or cipher suites
    used. Now, the client and server perform most of the handshake process, but something
    goes wrong as the server requests the client certificate. In other words, the server requires
    mutual authentication, but for some reason it seems like my JSSE client won't send over
    it's client certificate. I don't get any type of bad certificate exceptions, so I'm not sure
    where the source of the error lies.
    Updated output:
    setting up default SSLSocketFactory
    use default SunJSSE impl class: com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl
    class com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl is loaded
    keyStore is : keystore
    keyStore type is : jks
    keyStore provider is :
    init keystore
    init keymanager of type SunX509
    trustStore is: truststore
    trustStore type is : jks
    trustStore provider is :
    init truststore
    adding as trusted cert:
    Subject: [email protected], CN=Employee, OU=default, O="default Inc.", L=default, ST=AL, C=US
    Issuer: [email protected], CN=default Employee, OU=default, O="default, Inc.", L=default, ST=AL, C=US
    Algorithm: RSA; Serial number: 0xb40b909f74d167ab
    Valid from Tue Sep 12 09:49:12 CDT 2006 until Thu Oct 12 09:49:12 CDT 2006
    adding as trusted cert:
    Subject: [email protected], CN=default-Server, OU=HawkEye, O=default, L=default, ST=AL, C=US
    Issuer: [email protected], CN=default Employee, OU=default, O="default, Inc.", L=default, ST=AL, C=US
    Algorithm: RSA; Serial number: 0xb40b909f74d167ac
    Valid from Tue Sep 12 14:42:28 CDT 2006 until Thu Oct 12 14:42:28 CDT 2006
    adding as trusted cert:
    Subject: [email protected], CN=default Employee, OU=default, O="default, Inc.", L=default, ST=AL, C=US
    Issuer: [email protected], CN=default Employee, OU=default, O="default, Inc.", L=default, ST=AL, C=US
    Algorithm: RSA; Serial number: 0xf6e3ada87dc4004f
    Valid from Tue Sep 12 09:40:32 CDT 2006 until Thu Oct 12 09:40:32 CDT 2006
    init context
    trigger seeding of SecureRandom
    done seeding SecureRandom
    instantiated an instance of class com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl
    %% No cached client session
    *** ClientHello, TLSv1
    RandomCookie: GMT: 1158242806 bytes = { 71, 195, 185, 44, 86, 96, 14, 11, 171, 76, 105, 135, 136, 114, 53, 54, 137, 75, 202, 254, 112, 208, 240, 91, 199, 246, 175, 207 }
    Session ID: {}
    Cipher Suites: [SSL_RSA_WITH_RC4_128_MD5, SSL_RSA_WITH_RC4_128_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_DES_CBC_SHA, SSL_DHE_RSA_WITH_DES_CBC_SHA, SSL_DHE_DSS_WITH_DES_CBC_SHA, SSL_RSA_EXPORT_WITH_RC4_40_MD5, SSL_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA]
    Compression Methods: { 0 }
    Client Thread, WRITE: TLSv1 Handshake, length = 79
    Client Thread, READ: TLSv1 Handshake, length = 74
    *** ServerHello, TLSv1
    RandomCookie: GMT: 1158242807 bytes = { 63, 93, 48, 73, 98, 251, 160, 215, 61, 110, 246, 12, 5, 209, 95, 194, 152, 193, 0, 181, 135, 26, 150, 174, 52, 92, 56, 250 }
    Session ID: {83, 31, 134, 30, 76, 200, 183, 120, 7, 94, 26, 65, 186, 91, 197, 25, 10, 193, 94, 220, 198, 250, 162, 153, 6, 89, 12, 250, 66, 105, 249, 211}
    Cipher Suite: TLS_RSA_WITH_AES_128_CBC_SHA
    Compression Method: 0
    %% Created: [Session-1, TLS_RSA_WITH_AES_128_CBC_SHA]
    ** TLS_RSA_WITH_AES_128_CBC_SHA
    Client Thread, READ: TLSv1 Handshake, length = 1903
    *** Certificate chain
    chain [0] = [
    Version: V3
    Subject: [email protected], CN=Employee, OU=default, O="default, Inc.", L=default, ST=AL, C=US
    Signature Algorithm: SHA1withRSA, OID = 1.2.840.113549.1.1.5
    Key: Sun RSA public key, 1024 bits
    modulus: 164546130673614659100546464587508805401937082626997447139358150641653094778762702643605529386963945060462618417820295217144739538713137107756847225226998964727905246706969036839701385553183842454061172884072035749790213037240682893878786969498404371282074360019097248835858617183835587887295684928062301303789
    public exponent: 65537
    Validity: [From: Tue Sep 12 09:49:12 CDT 2006,
                   To: Thu Oct 12 09:49:12 CDT 2006]
    Issuer: [email protected], CN=default Employee, OU=default, O="default, Inc.", L=default, ST=AL, C=US
    SerialNumber: [    b40b909f 74d167ab]
    Certificate Extensions: 4
    [1]: ObjectId: 2.16.840.1.113730.1.13 Criticality=false
    Extension unknown: DER encoded OCTET string =
    0000: 04 1F 16 1D 4F 70 65 6E 53 53 4C 20 47 65 6E 65 ....OpenSSL Gene
    0010: 72 61 74 65 64 20 43 65 72 74 69 66 69 63 61 74 rated Certificat
    0020: 65 e
    [2]: ObjectId: 2.5.29.14 Criticality=false
    SubjectKeyIdentifier [
    KeyIdentifier [
    0000: C8 EA 02 93 42 9E 44 D1 55 7D 2D 32 4B 9B 1C 6D ....B.D.U.-2K..m
    0010: 63 6B 73 82 cks.
    [3]: ObjectId: 2.5.29.35 Criticality=false
    AuthorityKeyIdentifier [
    KeyIdentifier [
    0000: 2C BC 66 DC 06 BA 62 79 3B 1A 20 92 E0 81 71 A0 ,.f...by;. ...q.
    0010: 0D 05 3C 95 ..<.
    [[email protected], CN=default Employee, OU=default, O="default, Inc.", L=default, ST=AL, C=US]
    SerialNumber: [    f6e3ada8 7dc4004f]
    [4]: ObjectId: 2.5.29.19 Criticality=false
    BasicConstraints:[
    CA:false
    PathLen: undefined
    Algorithm: [SHA1withRSA]
    Signature:
    0000: BF 60 5A 67 3E E6 F0 92 4F E4 81 6D 71 0A 2E E8 .`Zg>...O..mq...
    0010: F3 59 A1 87 7B D1 3A 7A CB FF D6 39 63 79 B6 82 .Y....:z...9cy..
    0020: 2A 22 D0 46 51 30 6B 2A 61 6B A0 4C F0 3B CE 5B *".FQ0k*ak.L.;.[
    0030: 9C 1D 46 CB D7 C2 B2 23 E2 A5 06 CD 12 F8 A9 CB ..F....#........
    0040: B5 A2 43 B1 06 4C 42 B5 67 F2 DF 50 6B BC 8A 5E ..C..LB.g..Pk..^
    0050: 95 0D F3 2A 73 A8 5A C8 55 77 D7 36 74 16 9E 05 ...*s.Z.Uw.6t...
    0060: 85 C6 DC 3C 44 D3 06 5E 47 0C 1F 80 40 30 C7 D8 ...<D..^G...@0..
    0070: 8C 27 FF B9 0C 71 EB D4 31 5C 1F 15 A1 23 6F A2 .'...q..1\...#o.
    chain [1] = [
    Version: V3
    Subject: [email protected], CN=default Employee, OU=default, O="default, Inc.", L=default, ST=AL, C=US
    Signature Algorithm: SHA1withRSA, OID = 1.2.840.113549.1.1.5
    Key: Sun RSA public key, 1024 bits
    modulus: 140862286957037297158683104484469503810921697537964422595574798580128510755934413463045842414762254029728885690233847950678735782281077619629628663140568366247472189890316085560712610474766899389736269383565795688749374256479726939861138704211990111677657317335172626254520371267441364353295155431963634875809
    public exponent: 65537
    Validity: [From: Tue Sep 12 09:40:32 CDT 2006,
                   To: Thu Oct 12 09:40:32 CDT 2006]
    Issuer: [email protected], CN=default Employee, OU=default, O="default, Inc.", L=default, ST=AL, C=US
    SerialNumber: [    f6e3ada8 7dc4004f]
    Certificate Extensions: 3
    [1]: ObjectId: 2.5.29.14 Criticality=false
    SubjectKeyIdentifier [
    KeyIdentifier [
    0000: 2C BC 66 DC 06 BA 62 79 3B 1A 20 92 E0 81 71 A0 ,.f...by;. ...q.
    0010: 0D 05 3C 95 ..<.
    [2]: ObjectId: 2.5.29.35 Criticality=false
    AuthorityKeyIdentifier [
    KeyIdentifier [
    0000: 2C BC 66 DC 06 BA 62 79 3B 1A 20 92 E0 81 71 A0 ,.f...by;. ...q.
    0010: 0D 05 3C 95 ..<.
    [[email protected], CN=default Employee, OU=default, O="default, Inc.", L=default, ST=AL, C=US]
    SerialNumber: [    f6e3ada8 7dc4004f]
    [3]: ObjectId: 2.5.29.19 Criticality=false
    BasicConstraints:[
    CA:true
    PathLen:2147483647
    Algorithm: [SHA1withRSA]
    Signature:
    0000: AB 84 38 1F 7B 71 D8 87 FF 24 DB C2 7E DC D0 0B ..8..q...$......
    0010: 60 60 14 A8 F8 D5 46 AD 6B FC 33 90 6F 43 08 17 ``....F.k.3.oC..
    0020: AE 2B EE 6C 2B 29 85 E2 A6 67 EE 5D A4 61 F3 9E .+.l+)...g.].a..
    0030: E7 CA B1 27 F9 11 36 ED 93 05 7B E1 20 90 57 B5 ...'..6..... .W.
    0040: C6 F9 8A 9D 50 CD B3 4A 54 DC 1B 52 EC EA 7A 0B ....P..JT..R..z.
    0050: B6 E6 95 FD DD 80 BE 66 F0 77 F4 E7 9A 8A A3 EF .......f.w......
    0060: 9B 68 57 0C 9C 4B 4C C0 24 C5 34 16 D3 8E 45 27 .hW..KL.$.4...E'
    0070: CA 23 F1 E0 C5 5E FB FB AA 1C 21 6E CB 5B 57 D9 .#...^....!n.[W.
    Found trusted certificate:
    Version: V3
    Subject: [email protected], CN=Employee, OU=default, O="default, Inc.", L=default, ST=AL, C=US
    Signature Algorithm: SHA1withRSA, OID = 1.2.840.113549.1.1.5
    Key: Sun RSA public key, 1024 bits
    modulus: 164546130673614659100546464587508805401937082626997447139358150641653094778762702643605529386963945060462618417820295217144739538713137107756847225226998964727905246706969036839701385553183842454061172884072035749790213037240682893878786969498404371282074360019097248835858617183835587887295684928062301303789
    public exponent: 65537
    Validity: [From: Tue Sep 12 09:49:12 CDT 2006,
                   To: Thu Oct 12 09:49:12 CDT 2006]
    Issuer: [email protected], CN=default Employee, OU=default, O="default, Inc.", L=default, ST=AL, C=US
    SerialNumber: [    b40b909f 74d167ab]
    Certificate Extensions: 4
    [1]: ObjectId: 2.16.840.1.113730.1.13 Criticality=false
    Extension unknown: DER encoded OCTET string =
    0000: 04 1F 16 1D 4F 70 65 6E 53 53 4C 20 47 65 6E 65 ....OpenSSL Gene
    0010: 72 61 74 65 64 20 43 65 72 74 69 66 69 63 61 74 rated Certificat
    0020: 65 e
    [2]: ObjectId: 2.5.29.14 Criticality=false
    SubjectKeyIdentifier [
    KeyIdentifier [
    0000: C8 EA 02 93 42 9E 44 D1 55 7D 2D 32 4B 9B 1C 6D ....B.D.U.-2K..m
    0010: 63 6B 73 82 cks.
    [3]: ObjectId: 2.5.29.35 Criticality=false
    AuthorityKeyIdentifier [
    KeyIdentifier [
    0000: 2C BC 66 DC 06 BA 62 79 3B 1A 20 92 E0 81 71 A0 ,.f...by;. ...q.
    0010: 0D 05 3C 95 ..<.
    [[email protected], CN=default Employee, OU=default, O="default, Inc.", L=default, ST=AL, C=US]
    SerialNumber: [    f6e3ada8 7dc4004f]
    [4]: ObjectId: 2.5.29.19 Criticality=false
    BasicConstraints:[
    CA:false
    PathLen: undefined
    Algorithm: [SHA1withRSA]
    Signature:
    0000: BF 60 5A 67 3E E6 F0 92 4F E4 81 6D 71 0A 2E E8 .`Zg>...O..mq...
    0010: F3 59 A1 87 7B D1 3A 7A CB FF D6 39 63 79 B6 82 .Y....:z...9cy..
    0020: 2A 22 D0 46 51 30 6B 2A 61 6B A0 4C F0 3B CE 5B *".FQ0k*ak.L.;.[
    0030: 9C 1D 46 CB D7 C2 B2 23 E2 A5 06 CD 12 F8 A9 CB ..F....#........
    0040: B5 A2 43 B1 06 4C 42 B5 67 F2 DF 50 6B BC 8A 5E ..C..LB.g..Pk..^
    0050: 95 0D F3 2A 73 A8 5A C8 55 77 D7 36 74 16 9E 05 ...*s.Z.Uw.6t...
    0060: 85 C6 DC 3C 44 D3 06 5E 47 0C 1F 80 40 30 C7 D8 ...<D..^G...@0..
    0070: 8C 27 FF B9 0C 71 EB D4 31 5C 1F 15 A1 23 6F A2 .'...q..1\...#o.
    Client Thread, READ: TLSv1 Handshake, length = 13
    *** CertificateRequest
    Cert Types: RSA, DSS,
    Cert Authorities:
    *** ServerHelloDone
    *** Certificate chain
    *** ClientKeyExchange, RSA PreMasterSecret, TLSv1
    Random Secret: { 3, 1, 27, 159, 38, 131, 132, 24, 47, 148, 161, 90, 7, 39, 189, 28, 178, 156, 20, 151, 220, 192, 239, 182, 115, 234, 99, 225, 68, 250, 199, 173, 96, 181, 78, 180, 238, 37, 243, 72, 19, 91, 249, 11, 49, 83, 1, 150 }
    Client Thread, WRITE: TLSv1 Handshake, length = 141
    SESSION KEYGEN:
    PreMaster Secret:
    0000: 03 01 1B 9F 26 83 84 18 2F 94 A1 5A 07 27 BD 1C ....&.../..Z.'..
    0010: B2 9C 14 97 DC C0 EF B6 73 EA 63 E1 44 FA C7 AD ........s.c.D...
    0020: 60 B5 4E B4 EE 25 F3 48 13 5B F9 0B 31 53 01 96 `.N..%.H.[..1S..
    CONNECTION KEYGEN:
    Client Nonce:
    0000: 45 09 62 F6 47 C3 B9 2C 56 60 0E 0B AB 4C 69 87 E.b.G..,V`...Li.
    0010: 88 72 35 36 89 4B CA FE 70 D0 F0 5B C7 F6 AF CF .r56.K..p..[....
    Server Nonce:
    0000: 45 09 62 F7 3F 5D 30 49 62 FB A0 D7 3D 6E F6 0C E.b.?]0Ib...=n..
    0010: 05 D1 5F C2 98 C1 00 B5 87 1A 96 AE 34 5C 38 FA .._.........4\8.
    Master Secret:
    0000: 0E 63 38 16 86 A1 84 72 33 2C D7 07 D7 C3 AC E0 .c8....r3,......
    0010: AD 5B CD 3B 2E 2A 02 91 1E FE 17 97 4E 3B 56 C3 .[.;.*......N;V.
    0020: 5D 0F 7A 99 90 0D 3D 4E 5F 39 C5 EB 6E AD DA 71 ].z...=N_9..n..q
    Client MAC write Secret:
    0000: 99 32 FA 60 0B 88 36 CD 88 02 D5 4A CA D2 A6 49 .2.`..6....J...I
    0010: 69 60 42 B6 i`B.
    Server MAC write Secret:
    0000: 43 3F 85 72 FB 6D 28 1C BA 1E 8A 26 56 DE 18 FB C?.r.m(....&V...
    0010: 01 83 20 7F .. .
    Client write key:
    0000: 6F 58 29 AB B3 8C F5 75 3C 70 04 DF 9D 01 43 F5 oX)....u<p....C.
    Server write key:
    0000: 4A D7 E9 63 53 32 78 DF E0 99 89 60 A4 1A 3C E7 J..cS2x....`..<.
    Client write IV:
    0000: 24 FB 0E 12 AB D2 70 6D 80 B1 B2 BC 78 1A 55 88 $.....pm....x.U.
    Server write IV:
    0000: E4 75 62 25 46 95 0F 7A 44 16 E2 39 38 AD 29 CD .ub%F..zD..98.).
    HawkEye Client Thread, WRITE: TLSv1 Change Cipher Spec, length = 1
    *** Finished
    verify_data: { 98, 254, 245, 75, 252, 23, 91, 164, 67, 197, 69, 44 }
    Client Thread, WRITE: TLSv1 Handshake, length = 48
    Client Thread, READ: TLSv1 Alert, length = 2
    Client Thread, RECV TLSv1 ALERT: fatal, handshake_failure
    Client Thread, called closeSocket()
    Client Thread, handling exception: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
    Error: Received fatal alert: handshake_failure
    Thread-4, handling exception: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure

  • How to call a text FTP proxy service from a Java client ?

    Greetings,
    I've configured a text FTP proxy service which downloads files from a FTP server. It pols a directory on the FTP server and, as soon as a file respecting a given pattern apears it is downloaded. I tested the service in the test console and by putting some test files onto the FTP server. Now, I need to be able to test it from a Java client. How may I do that ? I need to write a Java client to connect to the OSB and to tell to it to use the FTP proxy in order to download a given file, from a given location and to put it in a given location on the client machine. Many thanks in advance for any help. A sample would be great !
    Kind regards,
    Nicolas

    Ok, I understand. The crucial question here is "what is a caller that you refer to?"
    Don't get me wrong, but the problem here is that you probably don't understand, what OSB is good for. OSB is an event-driven system. The event in your case is a new message in remote FTP server. You have to define what should happen when that event is fired. And that's all. You don't have to involve other client (or caller) for this case.
    You should define your FTP proxy to retrieve all relevant files from FTP server and then you should route them based on their name/content/encoding/whatever to different consumers. You can also have many proxies if you want - one for each name. It's up to you. But you don't have any "callers" in either case.

  • Error while running EJB from java client on JBOSS

    Hi
    As i am new to EJB i have created a helloworld application in ejb which is working fine when i try to call it from servlet but when i try to invoke the same ejb from java client (i.e from diff jvm) on jboss i got the following error:
    javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]]]
         at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1399)
         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:579)
         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
         at javax.naming.InitialContext.lookup(InitialContext.java:351)
         at com.gl.TestClient.main(TestClient.java:39)
    Caused by: javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]]
         at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:254)
         at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1370)
         ... 4 more
    Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]
         at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:228)
         ... 5 more
    Caused by: java.net.ConnectException: Connection refused
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
         at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
         at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
         at java.net.Socket.connect(Socket.java:519)
         at java.net.Socket.connect(Socket.java:469)
         at java.net.Socket.<init>(Socket.java:366)
         at java.net.Socket.<init>(Socket.java:266)
         at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:69)
         at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:62)
         at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:224)
         ... 5 more
    Following is my code:
    Home Interface:
    package com.gl;
    import javax.ejb.CreateException;
    public interface testHome extends EJBHome {
         String JNDI_NAME = "testBean";
         public     test create()
         throws java.rmi.RemoteException,CreateException;
    Remote Interface:
    package com.gl;
    import java.rmi.RemoteException;
    import javax.ejb.EJBObject;
    public interface test extends EJBObject {
         public String welcomeMessage() throws RemoteException;
    Bean:
    package com.gl;
    import java.rmi.RemoteException;
    import javax.ejb.EJBException;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    public class testbean implements SessionBean {
         public void ejbActivate() throws EJBException, RemoteException {
              // TODO Auto-generated method stub
         public void ejbPassivate() throws EJBException, RemoteException {
              // TODO Auto-generated method stub
         public void ejbRemove() throws EJBException, RemoteException {
              // TODO Auto-generated method stub
         public void setSessionContext(SessionContext arg0) throws EJBException,
                   RemoteException {
              // TODO Auto-generated method stub
         public void ejbCreate(){}
         public String welcomeMessage(){
              return "Welcome to the World of EJB";
    ejb-jar.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
    <enterprise-beans>
    <session>
    <ejb-name>testBean</ejb-name>
    <home>com.gl.testHome</home>
    <remote>com.gl.test</remote>
    <ejb-class>com.gl.testbean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    </enterprise-beans>
    </ejb-jar>
    jboss.xml:
    <?xml version='1.0' ?>
    <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.2//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_2.dtd">
    <jboss>
    <enterprise-beans>
    <entity>
    <ejb-name>testBean</ejb-name>
    <jndi-name>testBean</jndi-name>
    </entity>
    </enterprise-beans>
    </jboss>
    Client code:
    package com.gl;
    import java.util.Properties;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.rmi.PortableRemoteObject;
    public class TestClient {
         public static void main(String[] args) throws Exception{
                   try{
                   /*     Properties props=new Properties();
                        props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
                        props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
                        props.put(Context.PROVIDER_URL, "jnp://localhost:1099");
                   Properties props = new Properties();
    props.put(Context.INITIAL_CONTEXT_FACTORY,
    "org.jnp.interfaces.NamingContextFactory");
    props.put(Context.PROVIDER_URL, "localhost:1099");
                        System.out.println("Properties ok");
                        //env.setProperty(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.naming.HttpNamingContextFactory");
                        //env.put(Context.PROVIDER_URL,"http://localhost:8080");
                        //env.put(Context.SECURITY_PRINCIPAL, "");
                        //env.put(Context.SECURITY_CREDENTIALS, "");
                        Context ctx=new InitialContext(props);
                        System.out.println("context ok");
                        //testHome home = (testHome)ctx.lookup("testBean");
                        Object obj = ctx.lookup ("testBean");
                        System.out.println("ojb = " + obj);
                        testHome ejbHome = (testHome)PortableRemoteObject.narrow(obj,testHome.class);
                   test ejbObject = ejbHome.create();
                   String message = ejbObject.welcomeMessage();
                        System.out.println("home ok");
                        System.out.println("remote ok");
                        System.out.println(message);
                        catch(Exception e){e.printStackTrace();}
    I am able to successfully deployed my ejb on JBOSS but i m getting above error when i am trying to invoke ejb from java client.
    kindly suggest me something to solve this issue.
    Regards
    Gagan
    Edited by: Gagan2914 on Aug 26, 2008 3:28 AM

    Is it a remote lookup? Then maybe this will help:
    [http://wiki.jboss.org/wiki/JBoss42FAQ]
    - Roy

  • Creating multiple stateful session beans from a java client. (EJB 3.0)

    I'm having difficulties with the following:
    To access the ShoppingCartBean, I have to put the following annotation in my standalone java client:
    @EJB
    private static ShoppingCartRemote shoppingCartBean;
    The static must be there, thus only one ShoppingCartBean will exist within my java client. But as the ShoppingCartBean is a stateful session bean, I want to be able to get different beans of the same type.
    What is the correct way to do this in EJB 3.0?

    Great question. Because Home interfaces have been removed for the EJB 3.0 simplified
    API, stateful session bean creation happens as a side-effect of injection. However, the
    same is true of EJB 3.0 business interface lookups. The easiest way to create additional
    stateful session beans is to lookup the same dependency that was declared via your
    @EJB annotation.
    E.g.,
    // Assuming the declaring class is pkg1.ShoppingCartClient.java
    InitialContext ic = new InitialContext();
    ShoppingCartRemote scr1 = (ShoppingCartRemote)
    ic.lookup("java:comp/env/pkg1.ShoppingCartClient/shoppingCartBean");
    Note that the name relative to java:comp/env is the default associated with your
    @EJB annotation since the name() attribute wasn't used. Alternatively, you
    could have used :
    @EJB(name="scb") private static ShoppingCartRemote shoppingCartBean;
    InitialContext ic = new InitialContext();
    ShoppingCartRemote scr1 = (ShoppingCartRemote) ic.lookup("java:comp/env/scb");
    Yet another alternative is to declare the @EJB at the class-level. This just defines
    the dependency without any injection, which is fine if you want to create a bunch of
    them via lookup anyway.
    @EJB(name="scb", beanInterface=ShoppingCartRemote.class)
    public class .... {                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to use standalone java client with an enterprise bean in J2EE 1.4

    Hi All,
    I am have deployed a stateless session bean in Sun's J2EE 1.4 Application Server. i am trying to call the bean using a standalone java client. but the client cannot access the bean.
    The error coming is:
    Jan 21, 2004 7:48:27 PM com.sun.corba.ee.impl.legacy.connection.SocketFactoryCo
    nectionImpl <init>
    WARNING: ORBUTIL.connectFailure
    org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No
    at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(
    RBUtilSystemException.java:1739)
    at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(
    RBUtilSystemException.java:1757)
    at com.sun.corba.ee.impl.legacy.connection.SocketFactoryConnectionImpl.
    init>(SocketFactoryConnectionImpl.java:74)
    at com.sun.corba.ee.impl.legacy.connection.SocketFactoryContactInfoImpl
    createConnection(SocketFactoryContactInfoImpl.java:88)
    at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.begi
    Request(CorbaClientRequestDispatcherImpl.java:146)
    at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(Corba
    lientDelegateImpl.java:121)
    at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaCli
    ntDelegateImpl.java:212)
    at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
    at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.jav
    :69)
    at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.ja
    a:58)
    at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:12
    at javax.naming.InitialContext.lookup(InitialContext.java:347)
    at StatelessSessionClient.main(StatelessSessionClient.java:17)
    Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection re
    used: connect
    at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSoc
    etFactory.java:390)
    at com.sun.corba.ee.impl.legacy.connection.SocketFactoryConnectionImpl.
    init>(SocketFactoryConnectionImpl.java:58)
    ... 10 more
    Caused by: java.net.ConnectException: Connection refused: connect
    at sun.nio.ch.Net.connect(Native Method)
    at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:457)
    at java.nio.channels.SocketChannel.open(SocketChannel.java:146)
    at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSoc
    etFactory.java:381)
    ... 11 more
    javax.naming.CommunicationException: Can't find SerialContextProvider
    at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.ja
    a:66)
    at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:12
    at javax.naming.InitialContext.lookup(InitialContext.java:347)
    at StatelessSessionClient.main(StatelessSessionClient.java:17)
    Caused by: org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed
    No
    at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(
    RBUtilSystemException.java:1739)
    at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(
    RBUtilSystemException.java:1757)
    at com.sun.corba.ee.impl.legacy.connection.SocketFactoryConnectionImpl.
    init>(SocketFactoryConnectionImpl.java:74)
    at com.sun.corba.ee.impl.legacy.connection.SocketFactoryContactInfoImpl
    createConnection(SocketFactoryContactInfoImpl.java:88)
    at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.begi
    Request(CorbaClientRequestDispatcherImpl.java:146)
    at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(Corba
    lientDelegateImpl.java:121)
    at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaCli
    ntDelegateImpl.java:212)
    at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
    at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.jav
    :69)
    at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.ja
    a:58)
    ... 3 more
    Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection re
    used: connect
    at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSoc
    etFactory.java:390)
    at com.sun.corba.ee.impl.legacy.connection.SocketFactoryConnectionImpl.
    init>(SocketFactoryConnectionImpl.java:58)
    ... 10 more
    Caused by: java.net.ConnectException: Connection refused: connect
    at sun.nio.ch.Net.connect(Native Method)
    at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:457)
    at java.nio.channels.SocketChannel.open(SocketChannel.java:146)
    at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSoc
    etFactory.java:381)
    ... 11 more
    My java client uses the following code to access the bean:
    Hashtable props = new Hashtable();
    String URL="iiop://localhost:3700";
    props.put("java.naming.factory.initial","com.sun.jndi.cosnaming.CNCtxFactory");
    props.put("java.naming.provider.url", URL) ;
    InitialContext ctx = new InitialContext();
    Object ref = ctx.lookup("ejb/StatelessSessionHome");
    StatelessSessionHome home = (StatelessSessionHome)PortableRemoteObject.narrow(ref,StatelessSessionHome.class);
    StatelessSessionRemote statelessSession = home.create();
    plz help me to locate the error.
    Regards,
    Mohit

    Hi Amol,
    thanks for your suggestion.
    i have deployed the converter application in J2EE1.4 tutorial in Sun AppServer J2EE1.4. the deployment process works smoothly. but accessing the deployed converter bean using standalone client as given in the tutorial gives the following error.
    Caught an unexpected exception!
    javax.naming.NoInitialContextException: Need to specify class name in environmen
    t or system property, or as an applet parameter, or in an application resource f
    ile: java.naming.factory.initial
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
    40)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243
    at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.jav
    a:280)
    at javax.naming.InitialContext.lookup(InitialContext.java:347)
    at ConverterClient.main(ConverterClient.java:14)
    I have set the InitialHost and InitialPort as suggested by you in the client code. the client gets successfully compiled but gives error when executed.
    The client code is:
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.rmi.PortableRemoteObject;
    import java.math.BigDecimal;
    public class ConverterClient {
    public static void main(String[] args) {
    System.setProperty("org.omg.CORBA.ORBInitialHost","localhost");
    System.setProperty("org.omg.CORBA.ORBInitialPort","3700");          
    try {
    Context initial = new InitialContext();
    Object objref = initial.lookup
    ("java:comp/env/ejb/SimpleConverter");
    ConverterHome home =
    (ConverterHome)PortableRemoteObject.narrow(objref,
    ConverterHome.class);
    Converter currencyConverter = home.create();
    BigDecimal param = new BigDecimal ("100.00");
    BigDecimal amount =
    currencyConverter.dollarToYen(param);
    System.out.println(amount);
    amount = currencyConverter.yenToEuro(param);
    System.out.println(amount);
    System.exit(0);
    } catch (Exception ex) {
    System.err.println("Caught an unexpected exception!");
    ex.printStackTrace();
    Please suggest so that i can run the standalone client successfully.
    Regards,
    Mohit Kapoor

  • Invoking a secure web service from a standalone java client

    I am using stand alone java client to invoke a web service. This web service in turn invokes a jcs which is protected ( role based access ).
    I am using a proxy at the client side for web service invocation
    FileSubmission_Impl filesubmission_impl = new FileSubmission_Impl();
    FileSubmissionSoap filesubmissionsoap = filesubmission_impl.getFileSubmissionSoap();
    filesubmissionsoap.processFiles(...)
    This works if there are no security constraints on any of the resources (@common:security).
    I need to pass the username and password from the java client that will be authenticated and allowed to access the protected resources.
    Please let me know as to how this can be achieved ( passing username and password from client )

    Paula,
    I suppose you're using CFINVOKE (http://www.activsoftware.com/code_samples/code.cfm/CodeID/44/ColdFusion/Invoking_SOAP_Web_Services_with_ColdFusion_MX_CFINVOKE_Tag) or are you using a third party tool like CFX_SOAP (http://www.activsoftware.com/products/productdetail.cfm/id/1015)?
    Are you working with WebAS 6.4 or 6.2?
    It works with web services created with WebAS 6.4, but you should generate proxy classes. Check Thomas' weblog (second part of it)->https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1012. [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken]
    The WSDL generated by this method is more standard than the one generated when you just Remote enable an FM and look at the webservice browser.
    Th core of CF MX is Java and that engine is rather strict in standards.
    Eddy

Maybe you are looking for

  • Trying to Define a New Application Server Connection in JDev 10.1.3.0.3

    I am getting the following error stack when I try to test the connection in JDev 10.1.3.0.3 . The application server is standalone oc4j 10.1.3 DP4. Any help is much appreciated. Thanks, Mustafa Error while getting remote MBeanServer for url: ormi://l

  • Is it safe to use iphone 4 without a case

    Is it safe to use iphone 4 without a case

  • Leave color like in AE?

    Hello! I make short films as a hobby with my friends, and there are a few YouTube channels that I make sure to stay up on because they're typically loaded with helpful tips. I just got done watching one that involved him making his green shirt be the

  • Unable to start oc4j in aix

    installation was done on aix server. jdk 1.6 was used with sr8 provide the doc if available for aix 10.1.3.4.1 (64 bit) error :socket is already in use...mentioning the port no. suggest on the same .

  • Buying from the trial version of PSE8

    Hi I recently downloaded PSE 8 for Windows, and have decided to buy the application. The decription on the Adobe site says that one can buy the poduct by using the "buy" button from within the trial version. I have been unable to locate this "button"