Unable to invoke endpoint URI:  java.security.NoSuchAlgorithmException

Help me!! Please!! I´m traying to invoke https service from SOA composite but I have this error. I installed SSL certificate in DemoTrus.jks in WebLogic. 
<summary>
oracle.fabric.common.FabricInvocationException: Unable to invoke endpoint URI "https://190.187.158.19/ServicioSIP/Service1.svc" successfully due to: javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Message send failed: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext)
</summary>
</part>
-<part name="detail">
<detail>
Unable to invoke endpoint URI "https://190.187.158.19/ServicioSIP/Service1.svc" successfully due to: javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Message send failed: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext)
</detail>
</part>
-<part name="code">
<code>null</code>
Regards,

Before I set the "-Djavax.net.ssl.trustStore=<path of soa-trust.jks> -Djavax.net.ssl.trustStorePassword=<soa-trust.jks password>" to start the Manage Node, I got following error:
<?xml version="1.0" encoding="UTF-8"?><bpelFault>
   <faultType>0</faultType>
   <remoteFault xmlns="http://schemas.oracle.com/bpel/extension">
      <part name="summary">
         <summary>oracle.fabric.common.FabricInvocationException: Unable to invoke endpoint URI "https://myserver:myport/Agile/integration/services/ChangeABS" successfully due to: javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Message send failed: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target</summary>
      </part>
      <part name="detail">
         <detail>Unable to invoke endpoint URI "https://myserver:myport/Agile/integration/services/ChangeABS" successfully due to: javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Message send failed: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target</detail>
      </part>
      <part name="code">
         <code>null</code>
      </part>
   </remoteFault>
</bpelFault>

Similar Messages

  • Unable to invoke endpoint uri : 415 unsupported media type

    Hi all,
    I'm trying to invoke a HTTP Binding with POST where the endpoint is a RESTFUL webservice that takes in an XML message and sends an email.
    I'm using JDeveloper 11g to create the composite where it'll have an exposed HTTP Binding POST and an external reference which is also a HTTP Binding POST that calls a RESTFUL Webservice endpoint . In the BPEL process, i'm just doing a simple receive from the exposed HTTP Binding and then using the input to invoke the External References HTTP Binding.  However, I'm always getting an error at the invoke phase :
    <part  name="summary">
    <summary>oracle.fabric.common.FabricInvocationException: Unable to invoke endpoint URI "http://xxxxxxxxx/xxxx/xxxx/sendEmail" successfully due to: javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Bad response: 415 Unsupported Media Type from url http://xxxxxxxxx/xxxx/xxxx/sendEmail</summary> 
    </part>
    <part  name="detail">
    <detail>Unable to invoke endpoint URI "http://xxxxxxxxx/xxxx/xxxx/sendEmail" successfully due to: javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Bad response: 415 Unsupported Media Type from url http://xxxxxxxxx/xxxx/xxxx/sendEmail</detail> 
    </part>
    <part  name="code">
    <code>415</code> 
    </part>
    I'm guessing that it's because my payload is lacking the HTTP header content-type : application/xml. The webservice endpoint itself is working fine as I'm able to test it through other means such as POSTMan and soapUI.
    Is there a way to set the HTTP header content-type of the payload? Is there anyway to check or verify? Any help would be greatly appreciated.
    Regards,
    Mark

    Hi all,
    I'm trying to invoke a HTTP Binding with POST where the endpoint is a RESTFUL webservice that takes in an XML message and sends an email.
    I'm using JDeveloper 11g to create the composite where it'll have an exposed HTTP Binding POST and an external reference which is also a HTTP Binding POST that calls a RESTFUL Webservice endpoint . In the BPEL process, i'm just doing a simple receive from the exposed HTTP Binding and then using the input to invoke the External References HTTP Binding.  However, I'm always getting an error at the invoke phase :
    <part  name="summary">
    <summary>oracle.fabric.common.FabricInvocationException: Unable to invoke endpoint URI "http://xxxxxxxxx/xxxx/xxxx/sendEmail" successfully due to: javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Bad response: 415 Unsupported Media Type from url http://xxxxxxxxx/xxxx/xxxx/sendEmail</summary> 
    </part>
    <part  name="detail">
    <detail>Unable to invoke endpoint URI "http://xxxxxxxxx/xxxx/xxxx/sendEmail" successfully due to: javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Bad response: 415 Unsupported Media Type from url http://xxxxxxxxx/xxxx/xxxx/sendEmail</detail> 
    </part>
    <part  name="code">
    <code>415</code> 
    </part>
    I'm guessing that it's because my payload is lacking the HTTP header content-type : application/xml. The webservice endpoint itself is working fine as I'm able to test it through other means such as POSTMan and soapUI.
    Is there a way to set the HTTP header content-type of the payload? Is there anyway to check or verify? Any help would be greatly appreciated.
    Regards,
    Mark

  • Unable to invoke endpoint URI

    Hi,
    we are finding this end point url issue on initial load from ebiz to OTM.
    We are integrating EBIZ and OTM 6.3.2
    error: Unable to invoke endpoint URI "http://testotm.poweredbyclear.com:7001/GC3Services/IntGtmXmlService/call" successfully due to: javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Bad response: 403 Forbidden from url http://testotm.poweredbyclear.com:7001/GC3Services/IntGtmXmlService/call
    Kunal

    Hi,
    we are finding this end point url issue on initial load from ebiz to OTM.
    We are integrating EBIZ and OTM 6.3.2
    error: Unable to invoke endpoint URI "http://testotm.poweredbyclear.com:7001/GC3Services/IntGtmXmlService/call" successfully due to: javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Bad response: 403 Forbidden from url http://testotm.poweredbyclear.com:7001/GC3Services/IntGtmXmlService/call
    Kunal

  • Java.security.NosuchAlgorithmException: Algorithm DESede not available

    Dear All,
    I have created an adapter module using 3DES encryption/decryption algorithm for File/FTP adapter configuration and have deployed it at J2EE server of respective XI system.
    The alogorithm and adapter module are working fine in DEV & QA environments but in Mirror system(which is similar to Prod), I have been encountering Error:-
    java.security.NosuchAlgorithmException: Algorithm DESede not available
    Code snippet for reference:-
    // Convert the raw bytes to a secret key
    DESedeKeySpec keyspec = new DESedeKeySpec(rawkey);
    SecretKeyFactory keyfactory = SecretKeyFactory.getInstance("DESede");SecretKey key = keyfactory.generateSecret(keyspec);
    return key;
    Can you please suggest what could be issue here? Any inputs will be highly appreciated.
    Thanks and Best Regards
    Prashant Rajani

    Hi prometheuzz,
    Thanks for your inputs.
    Please find below the results we received on comparing the files on QA & mirror systems:-
    GXB - QA
    baup22g0:gxbdb:gxbadm 13> ls -lrt
    total 104
    -rwxr-xr-x 1 bin bin 2212 May 12 2004 local_policy.jar
    -rwxr-xr-x 1 bin bin 2199 May 12 2004 US_export_policy.jar
    -rwxr-xr-x 1 bin bin 6593 Oct 16 19:49 java.security
    -rwxr-xr-x 1 bin bin 2652 Oct 16 19:49 java.policy
    -rwxr-xr-x 1 bin bin 30337 Oct 16 19:49 cacerts
    GXC-Mirror
    bauc52g0:gxcdb:gxcadm 2> ls -lrt
    total 104
    -rwxr-xr-x 1 bin bin 2212 May 12 2004 local_policy.jar
    -rwxr-xr-x 1 bin bin 2199 May 12 2004 US_export_policy.jar
    -rwxr-xr-x 1 bin bin 6593 Oct 16 19:49 java.security
    -rwxr-xr-x 1 bin bin 2652 Oct 16 19:49 java.policy
    -rwxr-xr-x 1 bin bin 30337 Oct 16 19:49 cacerts
    bauc52g0:gxcdb:gxcadm 3>
    The results seem identical. Can you please let us know where we should target exactly?
    Thanks & Best Regards
    Prashant

  • Jsse error -- java.security.NoSuchAlgorithmException:Algorithm TLS

    I tried using the sample codes given at the JSSE1.0.2 web site, but I am encountering the folowing problem:
    java.security.NoSuchAlgorithmException: Algorithm TLS not available
    PLEASE ADVICE ME.
    Thanks,
    Shafique Razzaque,
    SCPJ2,
    Singapore.

    My email : [email protected]
    Hi
    I�m a student working on a Sun JSSE Samples for many weeks and I couldn�t run anyone ..!
    I am using the last JSSE 1.02 , the jdk 1.31, working on Jbuilder4
    I am working on both RMI and sockets samples.
    On the RMI sample I got this Exception : no such algorithm �TSL�
    �TSL� not supported
    I searched in the posted messages in the forum and I found someone had the same problem
    I followed all what he did but no way �!
    I don�t know what I forget to do, see what I did and tell me please what is wrong.
    I installed the JSSE as followed in the install file. I am sure that it is well installed
    How to compile???!!!
    1.I configured the rmic parameters to generate only the stub compatible only with java 2
    2.I compiled the project I got the stub
    3.I put theses parameters in
    Project Properties /Run/ field : VM parameters
    -Djava.rmi.server.codebase=file:/c:/windows/jbproject/Sunrmissl/classes/ -Djava.security.policy=file:/c:/windows/jbproject/Sunrmissl/policy.policy -Djavax.net.ssl.trustStore=file:/c:/windows/jbproject/Sunrmissl/testkeys.key
    4.I run the rmiregistry
    5.i run the HelloImp but every time exceptions :
    C:\JBUILDER4\JDK1.3\bin\javaw -classpath "C:\WINDOWS\jbproject\Sunrmissl\classes;C:\jsse-1_0_2-gl\jsse1.0.2\lib\jcert.jar;C:\jsse-1_0_2-gl\jsse1.0.2\lib\jnet.jar;C:\jsse-1_0_2-gl\jsse1.0.2\lib\jsse.jar;C:\JBUILDER4\JDK1.3\demo\jfc\Java2D\Java2Demo.jar;C:\JBUILDER4\JDK1.3\jre\lib\i18n.jar;C:\JBUILDER4\JDK1.3\jre\lib\jaws.jar;C:\JBUILDER4\JDK1.3\jre\lib\rt.jar;C:\JBUILDER4\JDK1.3\jre\lib\sunrsasign.jar;C:\JBUILDER4\JDK1.3\lib\dt.jar;C:\JBUILDER4\JDK1.3\lib\tools.jar" -Djava.rmi.server.codebase=file:/c:/windows/jbproject/Sunrmissl/classes/ -Djava.security.policy=file:/c:/windows/jbproject/Sunrmissl/policy.policy -Djavax.net.ssl.trustStore=file:/c:/windows/jbproject/Sunrmissl/testkeys.key sunrmissl.HelloImpl
    java.security.NoSuchAlgorithmException: Algorithm TLS not available
         at com.sun.net.ssl.b.a([DashoPro-V1.2-120198])
         at com.sun.net.ssl.SSLContext.getInstance([DashoPro-V1.2-120198])
         at sunrmissl.RMISSLServerSocketFactory.createServerSocket(RMISSLServerSocketFactory.java:39)
         at sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(TCPEndpoint.java:559)
         at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:200)
         at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:172)
         at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:319)
         at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:119)
         at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:125)
         at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:109)
         at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:278)
         at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:209)
         at java.rmi.server.UnicastRemoteObject.<init>(UnicastRemoteObHelloImpl err: null
    ject.java:100)
         at sunrmissl.HelloImpl.<init>(HelloImpl.java:27)
         at sunrmissl.HelloImpl.main(HelloImpl.java:41)
    java.lang.NullPointerException
         at sunrmissl.RMISSLServerSocketFactory.createServerSocket(RMISSLServerSocketFactory.java:51)
         at sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(TCPEndpoint.java:559)
         at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:200)
         at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:172)
         at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:319)
         at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:119)
         at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:125)
         at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:109)
         at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:278)
         at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:209)
         at java.rmi.server.UnicastRemoteObject.<init>(UnicastRemoteObject.java:100)
         at sunrmissl.HelloImpl.<init>(HelloImpl.java:27)
         at sunrmissl.HelloImpl.main(HelloImpl.java:41)

  • Java.security.NoSuchAlgorithmException: Cannot find any provider supporting

    Why I got following error:
    java.security.NoSuchAlgorithmException: Cannot find any provider supporting DESede/ECB/PKCS5Padding
           at javax.crypto.Cipher.getInstance(DashoA6275)
           at helpdesk.connection.ChangeSecurity.initDecrypt(ChangeSecurity.java:125)
           at helpdesk.connection.DbConnection.createPools(DbConnection.java:171)
           at helpdesk.connection.DbConnection.init(DbConnection.java:209)
           at helpdesk.connection.DbConnection.(DbConnection.java:49)
           at helpdesk.connection.DbConnection.getInstance(DbConnection.java:39)
           at helpdesk.db.db_user.getUser(db_user.java:596)
           at _0002fLoginCheck_0002ejspLoginCheck_jsp_5._jspService(_0002fLoginCheck_0002ejspLoginCheck_jsp_5.java:208)
           at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
           at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:174)
           at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:261)
           at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:369)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
           at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
           at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
           at org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:156)
           at org.apache.tomcat.service.TcpWorkerThread.run(PoolTcpEndpoint.java:366)
           at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:411)
           at java.lang.Thread.run(Thread.java:534)
    java.lang.SecurityException: The provider SunJCE may not be signed by a trusted party
           at javax.crypto.SunJCE_b.a(DashoA6275)
           at javax.crypto.Cipher.a(DashoA6275)
           at javax.crypto.Cipher.getInstance(DashoA6275)
           at helpdesk.connection.ChangeSecurity.initDecrypt(ChangeSecurity.java:127)
           at helpdesk.connection.DbConnection.createPools(DbConnection.java:171)
           at helpdesk.connection.DbConnection.init(DbConnection.java:209)
           at helpdesk.connection.DbConnection.(DbConnection.java:49)
           at helpdesk.connection.DbConnection.getInstance(DbConnection.java:39)
           at helpdesk.db.db_user.getUser(db_user.java:596)
           at _0002fLoginCheck_0002ejspLoginCheck_jsp_5._jspService(_0002fLoginCheck_0002ejspLoginCheck_jsp_5.java:208)
           at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
           at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:174)
           at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:261)
           at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:369)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
           at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
           at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
    & nbsp;     at org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:156)
           at org.apache.tomcat.service.TcpWorkerThread.run(PoolTcpEndpoint.java:366)
           at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:411)
           at java.lang.Thread.run(Thread.java:534)this is my code
    public String initEncrypt ( String s) throws Exception
            String plaintext = s;
            String rs = "";
            Provider sunJCE = null;
                     //Class providerClass = Class.forName ("com.sun.crypto.provider.SunJCE");
                // Security.addProvider ( (Provider)providerClass.newInstance() );
                 //Security.addProvider(
                 //            new com.sun.crypto.provider.SunJCE());
                 Provider[] providers = Security.getProviders();
                 for (int i = 0; i < providers.length; i++)
                 System.out.println("===>"+providers);
         try
         ObjectInputStream in = new ObjectInputStream(new FileInputStream(FILE_PATH));
         key = (Key) in.readObject();
         in.close();
    catch(FileNotFoundException fn)
         //try
         KeyGenerator keyGenerator = KeyGenerator.getInstance ( "DESede");
         keyGenerator.init(168);
         key = keyGenerator.generateKey();
         ObjectOutputStream out = new ObjectOutputStream( new FileOutputStream (FILE_PATH));
         out.writeObject(key);
         out.close();
         //} catch ( Exception ex )
         // ex.printStackTrace();
              try
         //chipher ������ ������
         cipher = javax.crypto.Cipher.getInstance("DESede/ECB/PKCS5Padding");
         cipher.init ( Cipher.ENCRYPT_MODE, key );
    String encrypted = encryptStringBase64 ( plaintext );
    rs = encrypted;
    }catch ( NoSuchAlgorithmException aaa )
         aaa.printStackTrace();
    }catch ( Exception ex )
    ex.printStackTrace();
    return rs;

    Crossposted, with answers:
    http://stackoverflow.com/questions/10193567/java-security-nosuchalgorithmexception-cannot-find-any-provider-supporting-aes

  • Error in weblogic7.0 :java.security.NoSuchAlgorithmException:

    Hi All
    thanks in advance.
    i am facing a peculiar problem while using SunJce provider
    i have some classes to encrypt& decrypt some information using
    DeffieHellman protocol.
    Problem 1
    while i am running those classes in command prompts
    some time it gives me correct results where as other time during decryption i am unable to get the plaintext (i am getting some junk character),where as some time it gives me Badpadding exception
    I am using JDK1.3 which comes with weblogic and jce1.2.2
    for classpath and path setting
    set path=D:\bea\jdk131_03\bin
    set classpath=%classpath%; D:\bea\jdk131_03\jre\lib\ext\ jce1_2_2.jar
    set classpath=%classpath%; D:\bea\jdk131_03\jre\lib\ext\sunjce_provider.jar
    set classpath=%classpath%; D:\bea\jdk131_03\jre\lib\ext\local_policy.jar
    set classpath=%classpath%; D:\bea\jdk131_03\jre\ext\US_export_policy.jar
    my BEA_HOME=d\bea and JAVA_HOME=D:\bea\jdk131_03\jre
    Problem 2
    While i am using those classes in servlet and jsp which are deployed in weblogic 7
    Some time i am getting correct results
    but as i stop and start the weblogic server ,i am getting .NoSuchAlgorithmException.
    So mainly i am having two classes DiffieHellmanKeyGeneRation and DHEncryptDecrypt given below
    import java.io.*;
    import java.math.BigInteger;
    import java.security.*;
    import java.security.spec.*;
    import java.security.interfaces.*;
    import javax.crypto.*;
    import javax.crypto.spec.*;
    import javax.crypto.interfaces.*;
    import com.sun.crypto.provider.SunJCE;
    public class DiffieHellmanKeyGeneRation {
    PublicKey alicePubKey=null;
         PublicKey bobPubKey=null;
         KeyAgreement aliceKeyAgree =null;
         KeyAgreement bobKeyAgree =null;
    * DiffieHellmanKeyGeneRation() constructor -Set the mode and call run method to generate Keypairs
    * and assigns it to the instance variables .
    * @param nil
    * @returns nil
    public DiffieHellmanKeyGeneRation(){
         try {
    String mode = "GENERATE_DH_PARAMS";
                   run(mode);
    } catch (Exception e) {
    System.err.println("Error: " + e);
    System.exit(1);
    * getAlicePubKey() -Return the Instance Variable alicePubKey
    * @param nil
    * @returns PublicKey
    public PublicKey getAlicePubKey()
    return alicePubKey;
    * getBobPubKey() -Return the Instance Variable bobPubKey
    * @param nil
    * @returns PublicKey
    public PublicKey getBobPubKey()
    return bobPubKey;
    * getAliceKeyAgree() -Return the Instance Variable aliceKeyAgree
    * @param nil
    * @returns KeyAgreement
         public KeyAgreement getAliceKeyAgree()
    return aliceKeyAgree;
    * getBobKeyAgree() -Return the Instance Variable bobKeyAgree
    * @param nil
    * @returns KeyAgreement
    public KeyAgreement getBobKeyAgree()
    return bobKeyAgree;
    *run() method -Generate Algorithm instance,KeySpec,and keypair
    * and assigns it to the instance variables .
    * @param String
    * @returns nil
    private void run(String mode) throws Exception {
    DHParameterSpec dhSkipParamSpec=null;
    // System.out.println("Creating Diffie-Hellman parameters (takes VERY long) ...");
    AlgorithmParameterGenerator paramGen=AlgorithmParameterGenerator.getInstance("DH");
    paramGen.init(512);
    AlgorithmParameters params = paramGen.generateParameters();
    dhSkipParamSpec = (DHParameterSpec)params.getParameterSpec(DHParameterSpec.class);
    * Alice creates her own DH key pair, using the DH parameters from
    * above
    // System.out.println("ALICE: Generate DH keypair ...");
    KeyPairGenerator aliceKpairGen = KeyPairGenerator.getInstance("DH");
    aliceKpairGen.initialize(dhSkipParamSpec);
    KeyPair aliceKpair = aliceKpairGen.generateKeyPair();
    // Alice creates and initializes her DH KeyAgreement object
    // System.out.println("ALICE: Initialization ...");
    aliceKeyAgree = KeyAgreement.getInstance("DH");
    aliceKeyAgree.init(aliceKpair.getPrivate());
    // Alice encodes her public key, and sends it over to Bob.
    byte[] alicePubKeyEnc = aliceKpair.getPublic().getEncoded();
    * Let's turn over to Bob. Bob has received Alice's public key
    * in encoded format.
    * He instantiates a DH public key from the encoded key material.
    KeyFactory bobKeyFac = KeyFactory.getInstance("DH");
    X509EncodedKeySpec x509KeySpec = new X509EncodedKeySpec(alicePubKeyEnc);
    alicePubKey = bobKeyFac.generatePublic(x509KeySpec);
    * Bob gets the DH parameters associated with Alice's public key.
    * He must use the same parameters when he generates his own key
    * pair.
    DHParameterSpec dhParamSpec = ((DHPublicKey)alicePubKey).getParams();
    // Bob creates his own DH key pair
    // System.out.println("BOB: Generate DH keypair ...");
    KeyPairGenerator bobKpairGen = KeyPairGenerator.getInstance("DH");
    bobKpairGen.initialize(dhParamSpec);
    KeyPair bobKpair = bobKpairGen.generateKeyPair();
    // Bob creates and initializes his DH KeyAgreement object
    // System.out.println("BOB: Initialization ...");
    bobKeyAgree = KeyAgreement.getInstance("DH");
    bobKeyAgree.init(bobKpair.getPrivate());
    // Bob encodes his public key, and sends it over to Alice.
    byte[] bobPubKeyEnc = bobKpair.getPublic().getEncoded();
    * Alice uses Bob's public key for the first (and only) phase
    * of her version of the DH
    * protocol.
    * Before she can do so, she has to instanticate a DH public key
    * from Bob's encoded key material.
    KeyFactory aliceKeyFac = KeyFactory.getInstance("DH");
    x509KeySpec = new X509EncodedKeySpec(bobPubKeyEnc);
    bobPubKey = aliceKeyFac.generatePublic(x509KeySpec);
    2)
    import java.io.*;
    import java.math.BigInteger;
    import java.security.*;
    import java.security.spec.*;
    import java.security.interfaces.*;
    import javax.crypto.*;
    import javax.crypto.spec.*;
    import javax.crypto.interfaces.*;
    import sun.misc.*;
    import com.sun.crypto.provider.SunJCE;
    public class DHEncryptDecrypt {
    PublicKey alicePubKey=null;
         PublicKey bobPubKey=null;
         KeyAgreement aliceKeyAgree =null;
         KeyAgreement bobKeyAgree =null;
         SecretKey bobDesKey = null;
         SecretKey aliceDesKey =null;
    * DHEncryptDecrypt constructor -it intancetiate DiffieHellmanKeyGeneRation object to get Public key of both party and Shared Secrete
    * and assigns it to the instance variables .
    * @param nil
    * @returns nil
         public DHEncryptDecrypt()
              try{
              init();
         }catch(Exception e){e.printStackTrace();}
    * init() -it DiffieHellmanKeyGeneRation object to get Public key of both party and Shared Secrete
    * and assigns it to the instance variable ds.
    * @param nil
    * @returns nil
    private void init() throws Exception
         System.out.println("Initialising...");
                   DiffieHellmanKeyGeneRation dhPubKey=new DiffieHellmanKeyGeneRation();
                   alicePubKey=dhPubKey.getAlicePubKey();
                   bobPubKey=dhPubKey.getBobPubKey();
    aliceKeyAgree=dhPubKey.getAliceKeyAgree();
                   bobKeyAgree=dhPubKey.getBobKeyAgree();
    //System.out.println("ALICE: Execute PHASE1 ...");
    aliceKeyAgree.doPhase(bobPubKey, true);
         * Bob uses Alice's public key for the first (and only) phase
         * of his version of the DH
         * protocol.
    // System.out.println("BOB: Execute PHASE1 ...");
    bobKeyAgree.doPhase(alicePubKey, true);
    * At this stage, both Alice and Bob have completed the DH key
    * agreement protocol.
    * Both generate the (same) shared secret.
    byte[] aliceSharedSecret = aliceKeyAgree.generateSecret();
    int aliceLen = aliceSharedSecret.length;
    byte[] bobSharedSecret = new byte[aliceLen];
    int bobLen;
    /* try {
    // show example of what happens if you
    // provide an output buffer that is too short
    bobLen = bobKeyAgree.generateSecret(bobSharedSecret, 1);
    } catch (ShortBufferException e) {
    System.out.println(e.getMessage());
    // provide output buffer of required size
    bobLen = bobKeyAgree.generateSecret(bobSharedSecret, 0);
              if (!java.util.Arrays.equals(aliceSharedSecret, bobSharedSecret))
    throw new Exception("Shared secrets differ");
    //System.out.println("Shared secrets are the same");
    // System.out.println("Return shared secret as SecretKey object ...");
    // Bob
    // Note: The call to bobKeyAgree.generateSecret above reset the key
    // agreement object, so we call doPhase again prior to another
    // generateSecret call
    bobKeyAgree.doPhase(alicePubKey, true);
    bobDesKey = bobKeyAgree.generateSecret("DES");
    // Alice
    // Note: The call to aliceKeyAgree.generateSecret above reset the key
    // agreement object, so we call doPhase again prior to another
    // generateSecret call
    aliceKeyAgree.doPhase(bobPubKey, true);
    aliceDesKey = aliceKeyAgree.generateSecret("DES");
    * encrypt() - Alice encrypts, using DES in ECB mode
    * and assigns it to the instance variable ds.
    * @param String
    * @returns String
              public String encrypt(String ClearText) throws Exception
         String CipherText=null;
                   try{
                   // byte[] iv = {(byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF,(byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF};
              Cipher aliceCipher = Cipher.getInstance("DES/ECB/PKCS5Padding");
         aliceCipher.init(Cipher.ENCRYPT_MODE, aliceDesKey);
                   byte[] cleartext = ClearText.getBytes();
                   //System.out.println("cleartext Array:"+ cleartext.size);
                   byte[] ciphertext = aliceCipher.doFinal(cleartext);
    // BASE64Encoder b64e = new BASE64Encoder();
                   //CipherText = b64e.encode(ciphertext);
                   CipherText = new String(ciphertext);
                   }catch(Exception e){e.printStackTrace();}
         return CipherText;
    * encrypt() - Bob Decrypts, using DES in ECB mode
    * and assigns it to the instance variable ds.
    * @param String
    * @returns String
    public String decrypt(String CipherText) throws Exception
    String Recovered=null;
         try{
              // byte[] iv = {(byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF,(byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF};
    // System.out.println("Length of String is:"+CipherText.length());
                   Cipher bobCipher = Cipher.getInstance("DES/ECB/PKCS5Padding");
              bobCipher.init(Cipher.DECRYPT_MODE, bobDesKey);
                   byte[] CipherTextBytes=CipherText.getBytes();
    byte[] recovered = bobCipher.doFinal(CipherTextBytes);
                   Recovered=new String(recovered);
              // System.out.println("Decryption:"+Recovered+"length:="+Recovered.length());
    }catch(Exception e){e.printStackTrace();}
         return Recovered;
    and i am using following logic to encrypt and decrypt
    String MyPlainText ="sm_user=residential&csol_account=383784";
    //String MyPlainText ="This is my message";
         System.out.println("\nPlain Text:="+MyPlainText+"\n\n");
    try{
         DHEncryptDecrypt ed=new DHEncryptDecrypt();
    String CipherText=(ed.encrypt(MyPlainText));
                   BASE64Encoder b64e = new BASE64Encoder();
                   String CipherText1 = b64e.encode(CipherText.getBytes());
    System.out.println("\n\nUserInfo="+CipherText1);
         String DecryptedMessage=ed.decrypt(CipherText);
    System.out.println("\n\nDecrypedMessage=:"+DecryptedMessage);
         }catch(Exception e){e.printStackTrace();}
    and my java.security file in D:\ bea\jdk131_03\jre\lib\security
    is changed to add the provider as
    # List of providers and their preference orders (see above):
    security.provider.1=sun.security.provider.Sun
    security.provider.2=com.sun.crypto.provider.SunJCE
    security.provider.3=com.sun.rsajca.Provider
    # Class to instantiate as the system Policy. This is the name of the class
    # that will be used as the Policy object.
    policy.provider=sun.security.provider.PolicyFile
    Pls help me to resolve the magic shown by these classes.....some time right and some time worng
    mainly i need help in
    Badpadding Exception and NosuchAlogorithm exception in weblogic
    Thanks
    And regards
    Arati

    replace all calls of getBytes() and new String(text) with the versions where you can state a charset: getBytes(charset), new String(text, charset). i use "iso-8859-1" as the charset.
    this should at least fix your "Badpadding exception" problem (it did fix it for me).

  • Java.security.PrivilegedActionException while invoking web service on OC4J

    Hi,
    I have a developed web service in Jdeveloper which is hosted on OC4J app server. I am able to invoke it properly and get results using the web service end point in browser window.
    Now I created a java proxy for this WS in Jdeveloper and tried invoking it inside another web service. I get the following error while the 1st WS is invoked:
    2010-03-09 17:15:04.607 WARNING Unable to connect to URL: <internal web service URL> due to java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: Connection refused: connect
    10/03/09 17:15:04 java.rmi.RemoteException: ; nested exception is:
         HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: Connection refused: connect
    10/03/09 17:15:04      at autoauthorise.runtime.VehicleTypeSpecsWSSoapHttp_Stub.getVehicleTypeSpecs(VehicleTypeSpecsWSSoapHttp_Stub.java:91)
    10/03/09 17:15:04      at com.bt.vehtype.ws.VehicleTypeSpecsWSSoapHttpPortClient.getVehicleTypeSpecs(VehicleTypeSpecsWSSoapHttpPortClient.java:40)
    10/03/09 17:15:04      at com.bt.fleet.willow.ws.AutoAuthorise.autoAuthorise(AutoAuthorise.java:20)
    10/03/09 17:15:04      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    10/03/09 17:15:04      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    10/03/09 17:15:04      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    10/03/09 17:15:04      at java.lang.reflect.Method.invoke(Method.java:585)
    10/03/09 17:15:04      at oracle.j2ee.ws.server.ImplInvocationHandler.invoke(ImplInvocationHandler.java:126)
    10/03/09 17:15:04      at $Proxy0.autoAuthorise(Unknown Source)
    10/03/09 17:15:04      at com.bt.fleet.willow.ws.runtime.AutoAthoriseWSSoapHttp_Tie.invoke_autoAuthorise(AutoAthoriseWSSoapHttp_Tie.java:62)
    10/03/09 17:15:04      at com.bt.fleet.willow.ws.runtime.AutoAthoriseWSSoapHttp_Tie.processingHook(AutoAthoriseWSSoapHttp_Tie.java:161)
    10/03/09 17:15:04      at oracle.j2ee.ws.server.StreamingHandler.handle(StreamingHandler.java:287)
    10/03/09 17:15:04      at oracle.j2ee.ws.server.JAXRPCProcessor.doEndpointProcessing(JAXRPCProcessor.java:356)
    10/03/09 17:15:04      at oracle.j2ee.ws.server.WebServiceProcessor.invokeEndpointImplementation(WebServiceProcessor.java:283)
    10/03/09 17:15:04      at oracle.j2ee.ws.server.JAXRPCProcessor.doRequestProcessing(JAXRPCProcessor.java:272)
    10/03/09 17:15:04      at oracle.j2ee.ws.server.WebServiceProcessor.processRequest(WebServiceProcessor.java:94)
    10/03/09 17:15:04      at oracle.j2ee.ws.server.JAXRPCProcessor.doService(JAXRPCProcessor.java:128)
    10/03/09 17:15:04      at oracle.j2ee.ws.server.WebServiceServlet.doPost(WebServiceServlet.java:170)
    10/03/09 17:15:04      at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
    Please help, I cant see any problem.
    Edited by: Ankit_Screen on Mar 11, 2010 6:27 AM

    can't anybody help me?

  • Java.security.ProviderException: unable to parse algorithm params.

    java.security.ProviderException: unable to parse algorithm params.
    Anyone any idea how to get around this problem? Is it something to do with the java.security file?

    i may or may not be very helpful depending on your setup.
    1. when you say "this works fine for sun plugins, but not for the MS JVM", what do you mean? where is the Sun VM used (client or server side) and where is the MS VM used (client or server side)?
    2. how are you obtaining the binary key encoding (that is then BASE64-encoded)? i assume you are calling java.security.Key.getEncoded. are you getting a standard PKCS8Encoding for a private key? you can check via Key.getFormat. make sure if you are switching between VM's, that both VM's are encoding the key in a format that you expect. in particular, if they both claim to export into PKCS8, then make sure the encoded bytes are identical.
    3. how are you re-constituting the key? are you using the java.security.spec.KeySpec APIs? i believe these were added in J2SE 1.2, which means i don't believe they are available in the MS VM (which is only 1.1.X-compliant if i recall correctly).
    based on all of the above, i don't think the java.security file is the culprit - but perhaps incompatible key encodings between different vendor VM's.

  • OSB : Endpoint URI problem in business service

    I have to invoke a http service from OSB where endpoint uri is http://<ip>:<port>/Resource.
    At invocation time OSB is adding "?" to the end of URI, in that case http message is becoming like following:
    POST /Resource? HTTP/1.1
    External service is considering it as a bad request and giving 500 response code with following comments:
    Error occured: 500, Cannot find local resource: /Resource?
    But I am getting proper response when I am calling from java program with http message POST /Resource HTTP/1.1
    It is not possible to change the external system, now how can I solve the problem??
    Please help.
    Thanks
    Afzal
    Edited by: uttam on May 2, 2012 9:49 PM

    Open your business service and navigate to HTTP Transport configuration page and check what is the http type is enabled.
    Look to me its with GET method, change it to POST and re-try.
    If the above solution is not helping, try to check the Follow HTTP redirects check box below the Advanced Setting in same page.
    Thanks,
    Vijay

  • Generated Web Service Client giving java.security.PrivilegedActionException

    I generated a Web Service Proxy using jdev but when I run the client I get a hand shake error. I dont get this error in eclipse but happens when I try to run it in JDev. Is there some certificate setting or KeyStore setting I need to do to make this error go away:
    Do I need to add the KeyStore or Certificate from the site I am accessing to oracle application server or jdeveloper... whats the procedure for that..
    WARNING: Unable to connect to URL: https://mytest.test.com/WebService/MyTest_1.0/soap.soap due to java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: Connection refused: connect
    java.rmi.RemoteException: ; nested exception is:
         HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: Connection refused: connect
         at project7.proxy.runtime.MyTestSoapBinding_Stub.echoOfficeLocation(MyTestSoapBinding_Stub.java:11977)
         at project7.proxy.MyTestClient.echoOfficeLocation(MyTestClient.java:1276)
         at project7.proxy.MyTestClient.main(MyTestClient.java:38)
    Caused by: HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: Connection refused: connect
         at oracle.j2ee.ws.client.http.HttpClientTransport.invokeImpl(HttpClientTransport.java:174)
         at oracle.j2ee.ws.client.http.HttpClientTransport.invoke(HttpClientTransport.java:150)
         at oracle.j2ee.ws.client.StreamingSender._sendImpl(StreamingSender.java:176)
         at oracle.j2ee.ws.client.StreamingSender._send(StreamingSender.java:113)
         at project7.proxy.runtime.MyTestSoapBinding_Stub.echoOfficeLocation(MyTestSoapBinding_Stub.java:11961)
         ... 2 more
    Process exited with exit code 0.

    hi Kimberly
    It looks like you're getting some feedback in this forum thread:
    "how do you add an existing certificate or keystore to jdev to access WS"
    how do you add an existing certificate or keystore to jdev to access WS
    regards
    Jan Vervecken

  • Java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Unab

    Hi
    I deployed an ESB service.
    I am trying to test it from Server Enterprise Manager, Webservices feature.
    I wrapped up my original message with SOAP 1.1 and 1.2 specifications.
    When I invoke the service, I am getting
    java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Unable to get header stream in saveChanges error.
    Any idea how to get rid of that ?
    Thanks
    Praveen

    The current version of ESB does not support SOAP 1.2. You need to make sure your message contains the correct SOAP 1.1 namespace so ESB uses the correct SOAP version:
    SOAP 1.1: http://schemas.xmlsoap.org/soap/envelope/
    SOAP 1.2: http://www.w3.org/2003/05/soap-envelope
    Kind Regards,
    Andre Jochems

  • Unable to invoke a EJB from a BPEL process

    I am unable to invoke a EJB from a BPEL process. Whenever I try to test it from the oracle EM, I get the below exception. I am using WebLogic 10.3.3, SOA suite 11.1.1.3 and JDev 11.1.1.3 .
    This is what I see from the EM....
    Non Recoverable System Fault :
    javaInterface attribute for the binding is missing or the inteface class is not available.
    Below is a part of the stack trace from the soa server log…
    Caused By: oracle.classloader.util.AnnotatedClassNotFoundException:
    Missing class: com.abc.GreetingEJBBean
    Dependent class: oracle.integration.platform.blocks.ejb.SDOEjbReferenceD
    elegateImpl
    Loader: sun.misc.Launcher$AppClassLoader@20929799
    Code-Source: /C:/Oracle_latest/Middleware/home_11gR1/Oracle_SOA1/soa
    /modules/oracle.soa.fabric_11.1.1/fabric-runtime.jar
    Configuration: /C:/Oracle_latest/Middleware/home_11gR1/Oracle_SOA1/soa
    /modules/oracle.soa.fabric_11.1.1/fabric-runtime.jar
    Piece of xml from the composite.xml
    <reference name="GreetingService"
    ui:wsdlLocation="http://123.45.218.140:7001/GreetingEJBBean/GreetingEJBBeanService?wsdl">
    <interface.wsdl interface="http://abc.com/#wsdl.interface(GreetingEJBBean)" />
    <binding.ejb uri="GreetingEJB-GreetingEJB-GreetingEJB"
    javaInterface="com.abc.GreetingEJB"/>
    </reference>
    Looks like its not able to find the javaInterface mentioned above.
    I have a simple EJB with one business method and a very simple BPEL process.
    @Stateless(name = "GreetingEJB", mappedName = "GreetingEJB-GreetingEJB-GreetingEJB")
    @WebService
    public class GreetingEJBBean implements GreetingEJB {
    public GreetingEJBBean() {
    public String greetUser(String name){
    return ("Hello " + name);
    Any help would be greatly appreciated.

    I haven't tried from a BPEL process, but I have had success (as in Lucas's blogs) of using services and references as EJB Java Interface. This is with EJB java interfaces solely of base types (i.e. String foo(String s)).
    At high level here's what I have noted so far:
    1. Per Lucas's blog, @javaInterface is not being added to the ejb.binding automatically but it's not clear to me when this is and is not required given that interface.java is specified for the reference or service. Would interface.java and @javaInterface ever be different? I've been adding @javaInterface manually anyways since Lucas is a smart guy and I'd rather avoid errors. :-)
    2. Dropping an EJB interface jar in SCA-INF/lib works, but I've had the problem that the JDeveloper SOA Plugin doesn't see those classes until I stop and restart JDeveloper. Until then, I'm confronted with the java->wsdl mapping error. I was sort of primed to figure this one out since I ran into similar issues with SOA SpringBean components.
    3. Dropping EJB interface source in SCA-INF/src is more reliable, because then I can build the project (i.e. create SCA-INF/classes) and the JDeveloper SOA Plugin seems to resolve these brand new classes immediately.
    4. I've tried to invoke an EJB java-interface reference with a slightly complicated java interface (a class parameter with some fields, one of which is an array of another class). The auto-generated WSDL doesn't look exactly right to me (but I'm new to JAXB). Mediator maps to it just fine and the project compiles and deploys normally but fails at runtime. I have not researched in depth. It's not clear to me from the documentation and release notes whether I should expect for it to work, or whether I should expect to have to create my own JAXB mapping. If the latter, I really need a good example!

  • HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: String index out of range: -7

    All -
    I'm new to consuming web services in JDeveloper. I'm using Oracle JDEV 10.1.3.3/OC4J.  I'm using this version since it is compatible with Oracle EBS 12.1.3.  My intent is to pull data from our third party recruitment app (Success Factors) and load that data into Oracle HRIS.  I'm already doing this through a .NET application.  I'm converting it to be a Java Concurrent Program in EBS.  The code listed below is a stub call to verify I'm on the right track. I created a JDeveloper Web Services proxy project.  I'm testing it locally on my windows desktop.  When I'm able to consume the service successfully, then I'll think about moving it to the EBS server.
    I'm getting the following error when I invoke the following service:
    HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: String index out of range: -7
    End point is: https://api4.successfactors.com/sfapi/v1/soap?wsdl
    Any help/assistance would be much appreciated. 
    Below is my code and output of my test:
    package emsc.oracle.apps.emscper.sfapi.proxy;
    import HTTPClient.HTTPConnection;
    import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.IsValidSession;
    import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.IsValidSessionResponse;
    import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.Login;
    import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.LoginResponse;
    import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.LoginResult;
    import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.Logout;
    import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.LogoutResponse;
    import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.SFCredential;
    import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.SFParameter;
    import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.Error;
    import java.io.File;
    import javax.xml.rpc.ServiceFactory;
    import java.util.ArrayList;
    import java.util.List;
    import java.util.Date;
    import javax.xml.ws.BindingProvider;
    import javax.xml.soap.SOAPException;
    import java.util.Map;
    import oracle.security.ssl.OracleSSLCredential;
    public class SFAPITest {
        // Declare members:      
        private String companyId;
        private String userName;
        private String password;
        private String developerKey;
        private Date   effDt;
        private String greaterThanEffDt;
        private String lessThanEffDt;
        // Declare constants:      
        final static private String breakLine = "+---------------------------------------------------------------------------+";
        final static private String format    = "yyyy-mm-dd";      
        private enum ReqId {
            PrimaryReq(25),
            PrimaryReqCEO(26),
            EmCarePrimary(27),
            RTI(28),
            EmCareClinical(29);
            private int reqId; 
            private ReqId() {
            private ReqId(int value) {
                reqId = value;
            public int getReqId() {
                return reqId;
        // Getters and Setters:  
        protected String getCompanyId() {
           return this.companyId;
        protected void setCompanyId(String value) {
           this.companyId = value;                 
        protected String getUserName() {
           return this.userName;
        protected void setUserName(String value) {
           this.userName = value;                 
        protected String getPassword() {
           return this.password;
        protected void setPassword(String value) {
           this.password = value;                 
        protected String getDeveloperKey() {
           return this.developerKey;
        protected void setDeveloperKey(String value) {
           this.developerKey = value;                 
        protected Date getEffDt() {
            return this.effDt;
        protected void setEffDt(Date value) {
            this.effDt = value;                 
        protected String getGreaterThanEffDt() {
           return this.greaterThanEffDt;
        protected void setGreaterThanEffDt(String value) {
           this.greaterThanEffDt = value;                 
        protected String getLessThanEffDt() {
           return this.lessThanEffDt;
        protected void setLessThanEffDt(String value) {
           this.lessThanEffDt = value;                 
        public void runProgram()
            SFAPIService mySFAPIService;
            String CompletionText = "";
            String effDtStr2 = null;
        /* Code your program logic here.
        * Use getJDBCConnection method to get the connection object for any
        * JDBC operations.
        * Use CpContext provided commit,rollback methods to commit/rollback
        * data base transactions.
        * Don't forget to release the connection before returning from this
        * method.
        /* Call setCompletion method to set the request completion status and
        * completion text.
        * Status values are ReqCompletion.NORMAL,ReqCompletion.WARNING,
        * ReqCompletion.ERROR.
        * Use Completion text message of length 240 characters. If it is more
        * than 240 then full string will appear in log file and truncated 240
        * characters will be used as request completion text.
        try
            ServiceFactory factory = ServiceFactory.newInstance();
            mySFAPIService = (emsc.oracle.apps.emscper.sfapi.proxy.SFAPIService)factory.loadService(emsc.oracle.apps.emscper.sfapi.proxy.SFAPIService.class);      
            SFAPI api = mySFAPIService.getSFAPI();
           /// SFAPI api = new SFAPI();
            //Map<String, Object> requestContext = ((BindingProvider) api).getRequestContext();
            //requestContext.put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true);
            System.out.println("ServiceName => " + mySFAPIService.getServiceName().toString());
            System.out.println("End Point   => " + mySFAPIService.getServiceName().toString());
            System.out.println(breakLine);
            // Authentication: Login to SFAPI:
            SFCredential credential = new SFCredential();
            // Fake credentials being passed in for this post:   
            credential.setCompanyId("XXX");
            credential.setUsername("XXX");
            credential.setPassword("XXX");
            credential.setDeveloperKey("XXX");
            HTTPConnection httpsConnection = null;       
            OracleSSLCredential _credential = new OracleSSLCredential();      
            _credential.setWallet("\\\\\\C:\\Program Files\\Java\\jdk1.6.0_33\\jre\\lib\\security", "ParkEstes3");
            /*System.setProperty("javax.net.ssl.trustStore","C:\\\\\OraHome_1\\jdev\\jdevbin\\jdk\\jre\\lib\\security\\keystore");
            System.setProperty("javax.net.ssl.trustStorePassword","changeit");  
            System.out.println(System.getProperty("javax.net.ssl.trustStore"));*/
            // SFParameter: Define a generic SFParameter List.  This is a necessary parameter
            // to invoking calls in SFAPI:      
             /*System.setProperty("javax.net.ssl.keyStore",
             "file:\\\C:\\jdk1.4.1\\jre\\lib\\security\\client.keystore");
             System.setProperty("javax.net.ssl.keyStorePassword","welcome");         */
            /*  System.setProperty("oracle.net.wallet_location",
                          "(SOURCE=(METHOD=file)(METHOD_DATA=(DIRECTORY=\\\C:\Users\dparrish\Oracle\WALLETS)))");  // (2)                     */
            File kstore = new File("C:\\OraHome_1\\jdev\\jdevbin\\jdk\\jre\\lib\\security\\jssecacerts");
            boolean exists = kstore.exists();
            if (!exists) {
                System.out.println("Keystore does not exist");
            else {
                System.out.println("Keystore does exist");
            System.setProperty("javax.net.ssl.trustStore", kstore.getAbsolutePath());
            System.setProperty("javax.net.ssl.trustStorePassword", "changeit");
            //System.setProperty("proxySet", "false");
            //System.setProperty("http.proxyHost", "127.0.0.1");
            //System.setProperty("http.proxyPort", "8080");
            System.out.println(kstore.getAbsolutePath());
            List<SFParameter> lst = new ArrayList<SFParameter>();
            SFParameter param = new SFParameter();
            param.setName("");
            param.setValue("");
            lst.add(param);      
            SFParameter[] sfParam = lst.toArray(new SFParameter[lst.size()]);
            Login login = new Login();
            try {
                login.setCredential(credential);
                System.out.println("1");
                login.setParam(sfParam);
                System.out.println("2");
                LoginResponse loginResponse = new  LoginResponse();
                LoginResult loginResult = new LoginResult();
                try {
                     loginResponse = api.login(login);               
                catch (Exception e ) {
                    System.out.println(e.getMessage());
                System.out.println("3");
                try {               
                     loginResult = loginResponse.getResult();
                catch (Exception e ) {
                    System.out.println(e.getMessage());
                System.out.println("4");
                IsValidSession vs = new IsValidSession();                  
                IsValidSessionResponse isValidSessionResponse = api.isValidSession(vs);
                System.out.println("5");
                if (isValidSessionResponse.isResult()) {
                     System.out.println("Session is valid");
                     System.out.println("Result => " + loginResult.getSessionId());
                     System.out.println(breakLine);              
                    Logout logout = new Logout();
                    LogoutResponse logoutResponse = api.logout(logout);
                    if (logoutResponse.isResult()) {
                         System.out.println("Logout of SFAPI Successful");
                    else {
                        System.out.println("Logout of SFAPI Unsuccessful");
                else {
                     System.out.println("Session is invalid");
                    List<Error> errors = new ArrayList<Error>();
                    for (int i = 0; i < loginResult.getError().length;  i++) {
                        errors.add(loginResult.getError()[i]);
                    for (int i = 0; i < errors.size(); i++) {
                         System.out.println("Error Indice   => " + i);
                         System.out.println("Error Code:    => " + errors.get(i).getErrorCode());
                         System.out.println("Error Message: => " + errors.get(i).getErrorMessage());
                         System.out.println(breakLine);                                                          
                    } // end for loop of SFObject errors
                } // end InvalidSession
            catch (Exception e)
                 System.out.println("Session Credential Exception");
                 System.out.println("Exception => " + e.getMessage());
                 System.out.println(breakLine);                   
        catch (Exception e)
            System.out.println("Parameter List Exception");
            System.out.println("Exception => " + e.getMessage());
            System.out.println(breakLine);
        }   // end runProgram
        // Constructor:
        public SFAPITest()  {
        } // end constructor
        public static void main (String args[]) {
            try
                SFAPITest test = new SFAPITest();        
                test.runProgram();
            catch (Exception e) {
                System.out.println("main exception => " + e.getMessage());
    } // SFAPITest
    Here is the output with trace:
    WARNING: Unable to connect to URL: https://api4.successfactors.com:443/sfapi/v1/soap due to java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: String index out of range: -7
    Session Credential Exception
    Exception => ; nested exception is:
        HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: String index out of range: -7
    +---------------------------------------------------------------------------+
    Process exited with exit code 0.

    The other end is throwing back a programming error.
    That might be because you are sending incorrect data and the other end fails to validate it.
    You might be able to guess based on your C# code.  But, since you are using soap one generic solution is available to you.
    - Get an http proxy interceptor like wireshark.
    - Run it while your C# app runs, collect the http requests from that.
    - Run it while running your java code, collect the http requests from that.
    Compare the two.

  • Java.security.InvalidKeyException: Illegal key size

    Hi,
    I have developed an adf application using jdeveloper 11g which hosts weblogic 10.3.3.0.
    My adf application has to connect to an external application for credit card validation.
    To achieve this i am using a HTTPURLConnection and passing the external address and attributes that has to be written to it.
    The external application which i am trying to connect is secured starts with https://..
    I get an error as soon i am trying to open the "connection.getOutputStream()".
    Following is the error i am getting
    <Oct 8, 2010 10:32:54 AM CDT> <Notice> <Security> <BEA-090898> <Ignoring the trusted CA certificate "CN=T-TeleSec GlobalRoot Class 3,OU=T-Systems Trust Center,O=T-Systems Enterprise Services GmbH,C=DE". The loading of the trusted certificate list raised a certificate parsing exception PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11.>
    <Oct 8, 2010 10:32:54 AM CDT> <Notice> <Security> <BEA-090898> <Ignoring the trusted CA certificate "CN=T-TeleSec GlobalRoot Class 2,OU=T-Systems Trust Center,O=T-Systems Enterprise Services GmbH,C=DE". The loading of the trusted certificate list raised a certificate parsing exception PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11.>
    <Oct 8, 2010 10:32:54 AM CDT> <Notice> <Security> <BEA-090898> <Ignoring the trusted CA certificate "CN=GlobalSign,O=GlobalSign,OU=GlobalSign Root CA - R3". The loading of the trusted certificate list raised a certificate parsing exception PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11.>
    <Oct 8, 2010 10:32:54 AM CDT> <Notice> <Security> <BEA-090898> <Ignoring the trusted CA certificate "OU=Security Communication RootCA2,O=SECOM Trust Systems CO.\,LTD.,C=JP". The loading of the trusted certificate list raised a certificate parsing exception PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11.>
    <Oct 8, 2010 10:32:54 AM CDT> <Notice> <Security> <BEA-090898> <Ignoring the trusted CA certificate "CN=KEYNECTIS ROOT CA,OU=ROOT,O=KEYNECTIS,C=FR". The loading of the trusted certificate list raised a certificate parsing exception PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11.>
    java.security.InvalidKeyException: Illegal key size
         at javax.crypto.Cipher.a(DashoA13*..)
         at javax.crypto.Cipher.init(DashoA13*..)
         at javax.crypto.Cipher.init(DashoA13*..)
         at com.certicom.tls.provider.Cipher.init(Unknown Source)
         at com.certicom.tls.ciphersuite.SecurityParameters.createWriteCipher(Unknown Source)
         at com.certicom.tls.record.handshake.HandshakeHandler.changeCipherSpec(Unknown Source)
         at com.certicom.tls.record.handshake.ClientStateReceivedCertificate.handle(Unknown Source)
         at com.certicom.tls.record.handshake.HandshakeHandler.handleHandshakeMessage(Unknown Source)
         at com.certicom.tls.record.handshake.HandshakeHandler.handleHandshakeMessages(Unknown Source)
         at com.certicom.tls.record.MessageInterpreter.interpretContent(Unknown Source)
         at com.certicom.tls.record.MessageInterpreter.decryptMessage(Unknown Source)
         at com.certicom.tls.record.ReadHandler.processRecord(Unknown Source)
         at com.certicom.tls.record.ReadHandler.readRecord(Unknown Source)
         at com.certicom.tls.record.ReadHandler.readUntilHandshakeComplete(Unknown Source)
         at com.certicom.tls.interfaceimpl.TLSConnectionImpl.completeHandshake(Unknown Source)
         at com.certicom.tls.record.WriteHandler.write(Unknown Source)
         at com.certicom.io.OutputSSLIOStreamWrapper.write(Unknown Source)
         at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:66)
         at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124)The code i am using to connect to the external website is as follows.
        URL url;  
        HttpURLConnection connection = null; 
        try {    
          //Create connection  
          url = new URL(targetURL); 
          connection = (HttpURLConnection)url.openConnection();   
          connection.setRequestMethod("POST");
          connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
         connection.setRequestProperty("Content-Length", "" + Integer.toString(urlParameters.getBytes().length));
          connection.setRequestProperty("Content-Language", "en-US");  
          connection.setUseCaches (false); 
           connection.setDoOutput(true); 
           DataOutputStream wr = new DataOutputStream (      
               connection.getOutputStream ());
                wr.writeBytes (urlParameters);  
                wr.flush ();  
          wr.close ();   
                //Get Response   
          InputStream is = connection.getInputStream();  
          System.out.println("after getting input stream");
        BufferedReader rd = new BufferedReader(new InputStreamReader(is));  
          System.out.println("after BUffered reader");
        String line;  
        StringBuffer response = new StringBuffer();  
          System.out.println("after String buffer");
        while((line = rd.readLine()) != null) {     
          response.append(line);   
          response.append('\r');  
          }      rd.close();  
        return response.toString();
        } catch (Exception e) { 
          e.printStackTrace();   
          return null; 
          } finally { 
          if(connection != null) {      
            connection.disconnect();  
        }I am currently totally clueless , i dont understand what steps should i take. Is this error due to some keystore stuff??
    I even tried to replace the policy files in jre as per some blogs but it still does not work.
    I have very limited knowledge of the security issues with weblogic , i will really appreciate if i can get any links or any help in this matter.
    Thanks in advance
    ash

    The messages prior to the exception are very significant:
    <Oct 8, 2010 10:32:54 AM CDT> <Notice> <Security> <BEA-090898> <Ignoring the trusted CA certificate "CN=T-TeleSec GlobalRoot Class 3,OU=T-Systems Trust Center,O=T-Systems Enterprise Services GmbH,C=DE". The loading of the trusted certificate list raised a certificate parsing exception PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11.>
    <Oct 8, 2010 10:32:54 AM CDT> <Notice> <Security> <BEA-090898> <Ignoring the trusted CA certificate "CN=T-TeleSec GlobalRoot Class 2,OU=T-Systems Trust Center,O=T-Systems Enterprise Services GmbH,C=DE". The loading of the trusted certificate list raised a certificate parsing exception PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11.>
    <Oct 8, 2010 10:32:54 AM CDT> <Notice> <Security> <BEA-090898> <Ignoring the trusted CA certificate "CN=GlobalSign,O=GlobalSign,OU=GlobalSign Root CA - R3". The loading of the trusted certificate list raised a certificate parsing exception PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11.>
    <Oct 8, 2010 10:32:54 AM CDT> <Notice> <Security> <BEA-090898> <Ignoring the trusted CA certificate "OU=Security Communication RootCA2,O=SECOM Trust Systems CO.\,LTD.,C=JP". The loading of the trusted certificate list raised a certificate parsing exception PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11.>
    <Oct 8, 2010 10:32:54 AM CDT> <Notice> <Security> <BEA-090898> <Ignoring the trusted CA certificate "CN=KEYNECTIS ROOT CA,OU=ROOT,O=KEYNECTIS,C=FR". The loading of the trusted certificate list raised a certificate parsing exception PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11.>
    java.security.InvalidKeyException: Illegal key size
    So there are at least 4 certificates in your server's truststore that are causing issues.
    Is your weblogic server using CustomIdentityAndStandardTrust? If so, the the keystore is the $JAVA_HOME/jre/lib/security/cacerts
    You should familiarize yourself with keytool ( in $JAVA_HOME/bin ) and consider removing entries from your trust store unless you absolutely need them and are willing to trust any cert signed by them. There's been a thread about some newer Certificate Authorities ( CAs ) that were included as part of a recent java upgrade which have caused similar "unknown OID" issues.
    For your specific endpoint, you can use your browser to invoke the services' wsdl; this will cause your browser to fetch the certificate from that server
    You can then see what CA is used to sign it. Then see whether that CA is in your truststore.
    There is also a thread with a very simple class to test the SSL handshake:
    Re: Use Server Cert in Managed server not working

Maybe you are looking for