Handling Java Exception via WSIF

Hi all,
On BPEL, I want to catch exception thrown by Java method exposed via WSIF so that I can propagate the error message to BPEL client, but it seems that instead of getting my exception, BPEL keeps getting remoteException, is it possible at all ?
Below is my Java class:
public class InvalidParameterException extends Exception
  public InvalidParameterException(String string)
    super(string);
public final class CommonUtil
   public static String formatMSISDN(String rawMSISDN) throws InvalidParameterException
      throw new InvalidParameterException("test");
      return "test2";
}And below is part the WSDL:
  <message name="RawMSISDNMessage">
    <part name="rawMSISDN" type="xsd:string"/>
  </message>
  <message name="FormattedMSISDNMessage">
    <part name="formattedMSISDN" type="xsd:string"/>
  </message>
  <message name="InvalidParameterException">
    <part name="message" type="xsd:string"/>
  </message>
  <portType name="CommonUtilityPT">
    <operation name="formatMSISDN">
      <input name="FormatMSISDNRequest" message="tns:RawMSISDNMessage"/>
      <output name="FormatMSISDNResponse" message="tns:FormattedMSISDNMessage"/>
      <fault name="FormatMSISDNFault" message="tns:InvalidParameterException"/>
    </operation>
  </portType>
  <binding name="JavaBinding" type="tns:CommonUtilityPT">
    <java:binding/>
    <format:typeMapping encoding="Java" style="Java">
      <format:typeMap typeName="xsd:string" formatType="java.lang.String"/>
    </format:typeMapping>
    <operation name="formatMSISDN">
      <java:operation methodName="formatMSISDN" methodType="static"
                      parameterOrder="rawMSISDN" returnPart="formattedMSISDN"/>
      <input name="FormatMSISDNRequest"/>
      <output name="FormatMSISDNResponse"/>
      <fault name="FormatMSISDNFault"/>
    </operation>
  </binding>
  <service name="CommonUtility">
    <port name="JavaPort" binding="tns:JavaBinding">
      <java:address className="com.visitek.xlpoc.CommonUtil"/>
    </port>
  </service>
...Any help would be greatly appreciated.
Best Regards,
James
Edited by: user543925 on May 25, 2010 5:06 AM

Hi,
After restarting SOA Suite, it seems that the expected fault is returned (InvalidParameterException). But this time another exception is thrown which indicates as if fault handler for InvalidParameterException was not specified, while I've done so in BPEL:
  <faultHandlers>
    <catch faultName="ns3:InvalidParameterException">
      <sequence name="Sequence">
        <assign name="AssignOutput">
          <copy>
            <from expression="ora:getFaultName()"/>
            <to variable="outputVariable" part="payload"
                query="/client:processResponse/client:message"/>
          </copy>
        </assign>
        <reply name="ReplyOutput" variable="outputVariable"
               partnerLink="allowexistofferbpel_client"
               portType="client:AllowExistOfferBPEL" operation="process"/>
        <terminate name="ExitBPEL"/>
      </sequence>
    </catch>
  </faultHandlers>
...And below is the exception stacktrace:
com.visitek.xlpoc.InvalidParameterException: The length of parameter 'rawMSISDN' should be between 9 and 15
     at com.visitek.xlpoc.CommonUtil.formatMSISDN(Unknown Source)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:597)
     at oracle.integration.wsif.providers.java.WSIFOperation_Java.executeRequestResponseOperation(WSIFOperation_Java.java:1048)
<May 27, 2010 5:52:12 PM WIT> <Error> <oracle.soa.bpel.engine.ws> <BEA-000000> <<WSInvocationManager::invoke> got RuntimeException
oracle.fabric.common.FabricException: oracle.fabric.common.BusinessFaultException
     at oracle.integration.platform.blocks.wsif.WsifReference.request(WsifReference.java:705)
     at oracle.integration.platform.blocks.mesh.SynchronousMessageHandler.doRequest(SynchronousMessageHandler.java:139)
Caused By: oracle.fabric.common.BusinessFaultException
     at oracle.integration.platform.blocks.wsif.WsifReference.request(WsifReference.java:657)
     at oracle.integration.platform.blocks.mesh.SynchronousMessageHandler.doRequest(SynchronousMessageHandler.java:139)
<May 27, 2010 5:52:12 PM WIT> <Error> <oracle.soa.bpel.engine> <BEA-000000> <<CubeEngine::handleWorkItem> This exception occurred because the fault thrown in the BPEL flow was not handled by any fault handlers and reached the top-level scope. Root cause : com.oracle.bpel.client.BPELFault: faultName: {InvalidParameterException}
parts: {{
exception=<exception xmlns="http://visitek.co.id/xlpoc/">
   <tns:faultstring xmlns:tns="http://visitek.co.id/xlpoc/">The length of parameter 'rawMSISDN' should be between 9 and 15</tns:faultstring>
   <tns:detail xmlns:tns="http://visitek.co.id/xlpoc/">com.visitek.xlpoc.InvalidParameterException: The length of parameter 'rawMSISDN' should be between 9 and 15</tns:detail>
</exception>
>
Not fatal connection error ... not retrying.
<May 27, 2010 5:52:13 PM WIT> <Error> <oracle.webservices.service> <OWS-04115> <An error occurred for port: FabricProvider: javax.xml.rpc.soap.SOAPFaultException.>
...And this is the response message:
<messages>
<input>
<InvokeFormatMSISDN_formatMSISDN_InputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="rawMSISDN">
<rawMSISDN>test</rawMSISDN>
</part>
</InvokeFormatMSISDN_formatMSISDN_InputVariable>
</input>
<fault>
<bpelFault>
<faultType>
<message>0</message>
</faultType>
<InvalidParameterException xmlns="">
<part name="exception">
<exception xmlns="http://visitek.co.id/xlpoc/">
<tns:faultstring xmlns:tns="http://visitek.co.id/xlpoc/">The length of parameter 'rawMSISDN' should be between 9 and 15</tns:faultstring>
<tns:detail xmlns:tns="http://visitek.co.id/xlpoc/">com.visitek.xlpoc.InvalidParameterException: The length of parameter 'rawMSISDN' should be between 9 and 15</tns:detail>
</exception>
</part>
</InvalidParameterException>
</bpelFault>
</fault>
<faultType>
<message>0</message>
</faultType>
</messages>
...The attribute xmlns in InvalidParameterException is empty, this could be the problem, but I don't why.
Any help would be greatly appreciated.
Regards,
James

Similar Messages

  • Returning complex types with arrays (Java / EJB via WSIF)

    Hi all,
    I'm writing some WSIF bindings for existing EJBs, and I've struck a bit of a problem. Basically I've got complex types that contain arrays, and while instances of these types can be passed to the EJBs, return variables typed similarly cause the following fault:
    org.collaxa.thirdparty.apache.wsif.WSIFException: com.collaxa.cube.ws.wsif.providers.ejb.WSIFOperation_EJB@1a372e0 : Could not invoke 'concatString'; nested exception is:
         org.collaxa.thirdparty.apache.wsif.WSIFException: Class 'ejbinterfacetest.StringReturnArray' is not compatible; nested exception is:
         oracle.xml.parser.v2.XMLDOMException: cannot add a node belonging to a different document
         at com.collaxa.cube.ws.wsif.providers.ejb.WSIFOperation_EJB.executeRequestResponseOperation(WSIFOperation_EJB.java:1305)
         at com.collaxa.cube.ws.WSIFInvocationHandler.invoke(WSIFInvocationHandler.java:431)
         at com.collaxa.cube.ws.WSInvocationManager.invoke2(WSInvocationManager.java:416)
    The Java class StringReturnArray is a serializable JavaBean with one property, a String[] called strings. The corresponding complexType (that works when used as a method parameter type) is stringReturnArrayType:
    <complexType name="stringArrayType">
    <sequence>
    <element name="str" type="string" maxOccurs="unbounded" />
    </sequence>
    </complexType>
    <complexType name="stringReturnArrayType">
    <sequence>
    <element name="strings" type="tns:stringArrayType" />
    </sequence>
    </complexType>
    and I've type mapped in the binding with
    <format:typeMap typeName="typens:stringReturnArrayType" formatType="ejbinterfacetest.StringReturnArray" />
    Anyone know why this would be? Is there any way I can get more information out of BPEL or OC4J regarding the fault? (I've already turned the BPEL domain logging to All)
    Cheers,
    Chris.

    Any luck with this? I am running into the same error. Apparently, this is not an issue with Java binding, but when invoking remote EJBs, we run into this. I am running 10.1.3.1 and the error is:
    <fault>
    <bindingFault xmlns="http://schemas.oracle.com/bpel/extension">
    <part name="summary">
    <summary>
    com.collaxa.cube.ws.wsif.providers.ejb.WSIFOperation_EJB@e26dbf : Could not invoke 'getIdentityInfo'; nested exception is:
         org.collaxa.thirdparty.apache.wsif.WSIFException: Class 'ca.bc.gov.pssg.c3.webservices.identitymanagement.Identity' is not compatible; nested exception is:
         oracle.xml.parser.v2.XMLDOMException: cannot add a node belonging to a different document
    </summary>
    </part>
    <part name="detail">
    <detail>
    org.collaxa.thirdparty.apache.wsif.WSIFException: Class 'ca.bc.gov.pssg.c3.webservices.identitymanagement.Identity' is not compatible; nested exception is:
         oracle.xml.parser.v2.XMLDOMException: cannot add a node belonging to a different document
    </detail>
    </part>
    </bindingFault>
    </fault

  • Handling/passing Java exceptions to JavaFX

    My Java class has a try/catch statement indicating a communication error to MySQL server. I want to add a user-friendly dialog box in my JavaFX application in the event my java class cannot access the database.
    What's the best way of handling Java exceptions within JavaFX?
    Cheers!

    Rethrow an exception and catch it in the call in JavaFX code?

  • Handling Java Mapping Exception in BPM Transformation step

    Dear SDN members,
    I have developed a File to File scenario using BPM as follows.
    Step 1:
    Sender file adapter picks the file from FTP server and using file content conversion mapped to XML structure.
    Step 2:
    BPM will recieve the XML payload , immediately in the block a transformation step is called with an interface mapping. In the interface mapping a Java mapping will be executed with certain data validations on the XML payload. If found any invalid data is there a suitable excptions will be raised . Here the transformation step should be catch the error and control should be sent to exception block to place the recived file as a error file.
    else if the transformation is executed with out any issues, the file will be placed in success folder.
    But in the transformation step, though java mapping thorwing exceptions, the control not going into exception block, instead it is continuing to next step i.e the file is placing in the success folder.
    Can anybody tell me, how to handle the exceptions raised in java mapping in the BPM transformation step?
    I have refered all the SDN blogs, forums related to this issue, but could not able to find the answer. Please help me?
    Thanks & Regards
    Vijayanand Poreddy

    Hi Abhishek,
    Once the file is picked from FTP server then sent to BPM,
    the BPM steps
    Step1:
    -->Recive
    Step 2:
    Block Starts
       ---Block Start: New Transaction
       ---Block End : New Transaction
       ---Exception : Error
    Step 3 
    Inside the Block
    Transformation Step
       --Interface Mapping: <IM Name>
       -- Check box ticked for Create New Transcation
       -- Exceptions
          --System Error: Error
       --Source Message: Message recieved in Recieve Step (Step 1)
    Step 4:
      --Send
      --Source Maessage: Output message from the Transformation Step
    Block End
    Inserted a Exception Branch for Block
    Steps inside Exception Branch
      -Control
        --Throw Alert
       --Alert Name
    In the above scenario
    The transformation step is not throwing error even my interface mapping going to error. The same transformation step if i place outside the block next to recieve step, then the transformation step is throwing error and BPM stops the process.
    Also, when transformation is inside the block, i have used the exception handling on the send step inside the block. here it is throwing error as the source message payload is empty. because in the preceding transformation step the interface mapping is failed due to which there the target will not be filled. But even though it is not entered into exception block.
    Regards
    Vijayanand Poreddy

  • Is there a way to handle custom java exception in OSB?

    For example, i created a exception that extends RuntimeException.
    My exception has a new field called "code".
    I want to handle this exception in Oracle Service Bus process and retrieve this code to throws another exception with a XML structure that includes the code.
    Is there a way to do that ?
    <con:fault xmlns:con="http://www.bea.com/wli/sb/context">
         <con:errorCode>BEA-382515</con:errorCode>
         <con:reason>Callout to java method "public static org.apache.xmlbeans.XmlObject ...</con:reason>
         <con:java-exception xmlns:con="http://www.bea.com/wli/sb/context">
             <con:java-content ref="jcid:33a6c126:14006f3df18:-7fd9"/>
         </con:java-exception>
         <con:location xmlns:con="http://www.bea.com/wli/sb/context">
             <con:node>optmusPipeline</con:node>                    
             <con:pipeline>optmusPipeline_request</con:pipeline>
             <con:stage>processStage</con:stage>
             <con:path>request-pipeline</con:path>   
         </con:location>
    </con:fault>
    it is not enough to recover the information i needed.

    Hi Sandro,
    I've got the same situation. I agree that returning xml from function is not a best choice as you have to manually check if return status is an error or not. Processing exception in error handler is better and this is how I do it:
    I am doing a java callout to a function that can throw exception. Then I add ErrorHandler to stage containing this callout (all the exception are caught here).
    In the error handler I check if $fault/ctx:java-exception is not null. If not then I pass thrown exception to my utility function that converts it to xml similar to yours:
    import org.apache.xmlbeans.XmlException;
    import org.apache.xmlbeans.XmlObject;
    public static XmlObject exceptionToXML(Throwable exception)
      throws XmlException {
      String xmlString = exceptionToString(exception);
      return XmlObject.Factory.parse(xmlString);
    public static String exceptionToString(Throwable exception) {
      String cause = "";
      if (exception.getCause() != null) {
      cause = exceptionToString(exception.getCause());
      return String
      .format("<exception><name>%s</name><description>%s</description>%s</exception>",
      exception.getClass().getName(), exception.getMessage(),
      cause);
    Calling exceptionToXML with $fault/ctx:java-exception/ctx:java-content returns:
    <exception>
         <name>pl.app.MyException</name>
         <description>Exception message</description>
    </exception>
    Then you can check the exception class (IF action: $exception/name/text() = "pl.app.MyException") and handle it accordingly.
    Good luck,
    Krzysiek

  • Advantage of Java Exceptions over C error handling.

    I understand the advantages of Java Exception handling(as against C) when it comes to the ability to define exclusive Exception types or reuse exceptions, documentation benefits of the throws clause, advantages due to OO etc. But some people say that using exceptions in Java it is possible to recover from an exceptional condition and that's an advantage over how errors are dealt in C.
    Is that really an advantage? (I mean is that true?)AFAIK in C errors can be handled using perror or errno.h. For every error code generated there seems to be a description. And by checking the return values from functions we could see if there had been an exceptional condition and if there really had been one take appropriate action and recover from the error. So how is it that Java can recover from exceptions while in C it is not possible to recover from errors?
    Thank you very much.

    I'm waiting in my cold cell when the bell begins to chime
    Reflecting on my past life and it doesn't have much time
    Cos at 5 o'clock they take me to the Gallows Pole
    The sands of time for me are running low
    When the priest comes to read me the last rites
    I take a look through the bars at the last sights
    Of a world that has gone very wrong for me
    Can it be there's some sort of error
    Hard to stop the surmounting terror
    Is it really the end not some crazy dream
    Somebody please tell me that I'm dreaming
    It's not so easy to stop from screaming
    But words escape me when I try to speak
    Tears they flow but why am I crying
    After all I am not afraid of dying
    Don't believe that there is never an end
    As the guards march me out to the courtyard
    Someone calls from a cell "God be with you"
    If there's a God then why has he let me die?
    As I walk all my life drifts before me
    And though the end is near I'm not sorry
    Catch my soul cos it's willing to fly away
    Mark my words please believe my soul lives on
    Please don't worry now that I have gone
    I've gone beyond to see the truth
    When you know that your time is close at hand
    maybe then you'll begin to understand
    Life down there is just a strange illusion.
    Yeah, yeah, yeah, Hallowed be thy name
    Yeah, yeah, yeah, Hallowed be thy name

  • Handling apllication java.Exceptions

    I've developed an Weblogic WebService Application with several webservices inside.
    They are working fine but when a WebService throws a java Exception this exception is putted inside a SoapFaultException.
    After some research I figured that I should create my own Exceptions that inherits from SoapFaultException to best format the exception message
    my clients will receive, ok it is done and it's working. Now I need to handle all java Exceptions (witch were not throw by me) to put it in my own Exceptions witch inherits from soapFaultException. Does anybody know if I can implement an Exception handler that will capture all java Exceptions unhandled by my applicatio.
    I'm using WLS 9.2.

    Rethrow an exception and catch it in the call in JavaFX code?

  • Handling Java runtime exception on Vista OS

    Hello Forum members,
    This is regarding the handling of runtime exception on Vista machine with JRE 1.4.2_14.
    Iam working on client / server scenario where i need handle the run time exception say SocketExcpetion or IOException like "No Route to Host " exception whenever there is network connection problem with the server.
    Problem:
    On Windows 2000 and Windows XP OS , Iam able to get the Socket Exception from the server when there is network connection problem and based on this Iam displaying some error message to the user but on Vista am not able to catch these runtime exception since Vista OS is blocking the runtime excpetion thrown from the server or network.
    Please let me know how to configure the Vista OS to allow the runtime exception to be thrown to the user or how to handle the programmatically (using java ) on Vista OS to throw exception.
    Any suggestion is welcome
    Best regards,
    Sudhir

    I have heard that on Vista machine , by default the windows firewall will block all the runtime exceptions (especially the ones which are thrown from the server).
    This problem is with respect to Client/server scenario where the server will throw SocketException when there is network connection problem and on the client side i need to catch and handle this exception to display appropriate message to the end user.
    Background: Iam able to handle exception thrown from the server on Windows 2000 and Windows XP but on Vista am facing the above said problem i.e. am not able to get any exception from the server.

  • Java Exception handling framework

    Please suggest some frameworks for Java Exception handling

    http://java.sun.com/docs/books/tutorial/essential/exceptions/
    http://forum.java.sun.com/thread.jsp?forum=31&thread=173005
    http://www.tfh-berlin.de/~knabe/java/multex/
    http://www.impetus.com/comp_jeh.htm
    http://www.softwaresummit.com/1998/1998/speakers/haggar.htm

  • Java Exception handling incorrect ?

    Check this program out:
    I tried it on 3 different machines but the result is the same
    class TestEx extends Exception
    class Excp
    void test() throws Exception
    throw new TestEx();
    public static void main(String args[])
         Excp e = new Excp();
         try
         e.test();
         catch(Throwable ee)
              System.out.println("Exception caught");
    Compile it and then delete TestEx.class. What should happen ? In all of the 3 machines the NoClassDeffoundError (thrown on TestEx.class) was not caught at the 'catch (Throwable ee)' although to me it seems it should be.
    Martin.

    I am clear about the loading and linking phases.
    So this statement "...It is pretty clear that when a class is first loaded and linked, all classes that it refers to are loaded (but not necessarily linked)..."
    it not necessarily true.
    When a class is loaded, all superclasses/interfaces are loaded. The time of linking is not really specified. It could be early linking or late linking, specifically the resolving part of the linking phase, since that is the issue here (not the verification or preparation). A VM should always make sure it looks like late resolving since a statement that could create error might never be executed.
    In most cases, the VM does not try and should not to load all classes in constant pool when it does the linking phase. It should do so when that class is resolved (on the many bytecodes that do so).
    So the case above. Yes, when Excp is loaded and linked it could preload TestEx, but this is not really relevant here. Next, when the 'new' bytecode is executed in test() on TestEx, it knows the TestEx is missing and at this point it must create NoClassDefFoundError instance and throw it. Up to here the behavior is clear.
    What happens after the new is executed and now we know we have NoClassDefFoundError, what happens now is the question. The user might still want to handle this exception. Of course it is quite rare, but should be possible.
    thx,
    Martin.

  • Java Exception in Main/Menu/Reporting Tools/XML Publisher/Report Definition

    Hi ,
    One know this error :
    Java Exception: java.lang.NoSuchMethodError: oracle.xml.parser.schema.XSDBuilder.build(Ljava/io/InputStream;Ljava/net/URL;)Loracle/xml/parser/schema/XMLSchema;: during call of com.peoplesoft.pt.xmlpublisher.PSXPXsdUtils.getLevel0ColNames. (2,763) PSXPRPTDEFN_WRK.FUNCLIB.FieldFormula Name:GetBurstFieldValues PCPC:3211 Statement:48
    Called from:PSXPRPTDEFN_WRK.FUNCLIB.FieldFormula Name:SetBurstFieldValues Statement:81
    Called from:PSXPRPTDEFN_WRK.FUNCLIB.FieldFormula Name:LoadReportDefn Statement:660
    Called from:PSXPRPTDEFN_WRK.FUNCLIB.FieldFormula Name:SelectReportDefn Statement:744
    Called from:PSXPRPTDEFN.GBL.PostBuild Statement:36 The noted Java error was thrown during a call of the given method.
    It's if i Add a New Value in the report definition (Peoplesoft 8.5 , CRM ) : No customization in this
    Thanks in advance..

    Judging by the error, it looks like the xsd can not be constructed.
    I would start of by checking if the target location is defined in the Intergration Broker.
    PeopleBooks > PeopleTools 8.52: PeopleSoft Integration Broker Administration > Configuring PeopleSoft Integration Broker for Handling Services > Using the Target Locations Page to Set Target Locations for Services
    http://docs.oracle.com/cd/E28394_01/pt852pbh1/eng/psbooks/tiba/book.htm?File=tiba/htm/tiba08.htm#H3007

  • "ORA-29532: Java call terminated by uncaught Java exception

    Dear Oracle:
    I am trying to establish an HTTPS connection from a Java stored
    procedure that is wrapped in a PL/SQL procedure and loaded into a
    Package. We are running on Oracle 8.1.7.
    My Java code compiles and runs fine when run stand-alone outside
    Oracle; I can establish the connection to a secure server and talk to
    the server. However when I load this Java class (using the loadjava
    utility) this class can no longer run and I get a the following
    exception:
    "ORA-29532: Java call terminated by uncaught Java exception:
    javax.net.ssl.SSLException: SSL handshake failed:
    X509CertChainIncompleteErr"
    I have tried loading the JSSE from Sun and I still get the same error.
    Searching in the Discussing Forums I found the following link (which
    describes a procedure that logs into the UPS secure server site and
    grabs some XML) http://osi.oracle.com/~mbpierma/SSL_Java_DB.html .
    This code works ok if we try to connect to UPS server. However this
    code doesn't work if we try to log in to a different server (such as
    ???). If I modify this code slightly and try to log to any other
    sever server I get the same error as the one above. Investigation
    lead us to understand that the certificate at the UPS web site is a
    self-signed certificate -- not one generated by a major 'recognized'
    authority such as Verisign or Thawte.
    Further research pointed me to the following URL
    http://www.znow.com/sales/oracle/network.816/a76932/appf_ora.htm#619367
    This URL has the documentation for JAVA SSL for 8.1.6 which I figure
    I could read and try to make it work in 8.1.7.
    I looked at your Secure Hello World example, however the code is
    missing the most critical parts of the whole example, it does not
    specify where the certificate or any of the security settings come
    from (see the attached JavaCertExample.txt file).
    So, my questions are the following:
    1) What should I do to avoid the error mentioned above?
    2) Do you have a sample piece of code that describes how to make a
    HTTPS connection using a Java stored procedure?
    3) Can I make the HTTPS connection using a URL class and not using
    sockets directly?
    4) Do I need to load the JSEE provided by Sun?
    5) Will the solution be different for Oracle 9i?
    // SecureHelloClient.java
    import java.net.*;
    import java.io.*;
    import java.util.*;
    import javax.net.ssl.*;
    import javax.security.cert.X509Certificate;
    import oracle.security.ssl.OracleSSLCredential;
    import oracle.security.ssl.OracleSSLSocketFactory;
    import oracle.security.ssl.OracleSSLProtocolVersion;
    import oracle.security.ssl.OracleSSLSession;
    public class SecureHelloClient
    public static void main(String argv[])
    String hostName = "localhost";
    if(argv.length != 0)
    String hostName = argv[0];
    // Set the SSLSocketFactoryImpl class as follows:
    java.util.Properties prop = System.getProperties();
    prop.put("SSLSocketFactoryImplClass",
    "oracle.security.ssl.OracleSSLSocketFactoryImpl");
    try
    // Get the default socket factory
    OracleSSLSocketFactory sSocFactory
    = (OracleSSLSocketFactory)SSLSocketFactory.getDefault();
    sSocFactory.setSSLProtocolVersion(OracleSSLProtocolVersion.SSL_Version_3_0);
    OracleSSLCredential sslCredObj = new OracleSSLCredential();
    // Where did these values come from? caCert, userCert, trustedCert,
    // Set the certificate chain and private key if the
    // server requires client authentication
    sslCredObj.addCertChain(caCert)
    sslCredObj.addCertchain(userCert)
    sslCredObj.setPrivateKey(userPvtKey, userPassword)
    // Populate credential object
    sslCredObj.addTrustedCert(trustedCert);
    sSocFactory.setSSLCredentials(sslCredObj);
    // Create the socket using factory
    SSLSocket jsslSoc =
    (SSLSocket)sSocFactory.createSocket(hostName, 8443);
    String [] ciphers = jsslSoc.getSupportedCipherSuites() ;
    // Select the ciphers you want and put them.
    // Here we will put all availabel ciphers
    jsslSoc.setEnabledCipherSuites(ciphers);
    // We are creating socket in client mode
    jsslSoc.setUseClientMode(true);
    // Do SSL handshake
    jsslSoc.startHandshake();
    // Print negotiated cipher
    System.out.println("Negotiated Cipher Suite: "
    +jsslSoc.getSession().getCipherSuite());
    System.out.println("");
    X509Certificate[] peerCerts
    = ((javax.net.ssl.SSLSocket)jsslSoc).getSession().getPeerCertificateChain();
    if (peerCerts != null)
    System.out.println("Printing server information:");
    for(int i =0; i ? peerCerts.length; i++)
    System.out.println("Peer Certificate ["+i+"] Information:");
    System.out.println("- Subject: " + peerCerts.getSubjectDN().getName());
    System.out.println("- Issuer: " + peerCerts[i].getIssuerDN().getName());
    System.out.println("- Version: " + peerCerts[i].getVersion());
    System.out.println("- Start Time: " + peerCerts[i].getNotBefore().toString());
    System.out.println("- End Time: " + peerCerts[i].getNotAfter().toString());
    System.out.println("- Signature Algorithm: " + peerCerts[i].getSigAlgName());
    System.out.println("- Serial Number: " + peerCerts[i].getSerialNumber());
    else
    System.out.println("Failed to get peer certificates");
    // Now do data exchange with client
    OutputStream out = jsslSoc.getOutputStream();
    InputStream in = jsslSoc.getInputStream();
    String inputLine, outputLine;
    byte [] msg = new byte[1024];
    outputLine = "HELLO";
    out.write(outputLine.getBytes());
    int readLen = in.read(msg, 0, msg.length);
    if(readLen > 0)
    inputLine = new String(msg, 0, readLen);
    System.out.println("");
    System.out.println("Server Message:");
    System.out.println(inputLine );
    else
    System.out.println("Can't read data from client");
    // Close all sockets and streams
    out.close();
    in.close();
    jsslSoc.close();
    catch(SSLException e)
    System.out.println("SSL exception caught:");
    e.printStackTrace();
    catch(IOException e)
    System.out.println("IO exception caught:");
    e.printStackTrace();
    catch(Exception e)
    System.out.println("Exception caught:");
    e.printStackTrace();

    Hi,
    I have the same problem.
    Is some ORACLE guru that can help us ?
    We need to communicate with some servlet
    via POST method of https (SSL3)
    and with using private certificate on the client site.
    We need furthermore allow using of some proxy.
    Client site is realized as set of stored procedures within ORACLE 8.1.7
    In this time I am able to communicate with server without SSL and certificate
    using package utl_tcp
    (but with this solution without certificate is our customer not satisfied -:))
    ORACLE help us please !
    Pavel Pospisil
    [email protected]

  • How to handle multiple exception types in JSF 2?

    I'm trying to handle multiple exception types in JSF2, including a default error page for any unexpected exception types. The problems I'm having are:
    1) ViewExpiredException is handled only when no generic exception handler is specified
    2) "Regular" exceptions like NullPointerException are never handled
    My managed bean:
    @Named
    @SessionScoped
    public class MyController implements Serializable {
    /* A method that does nothing */
    public void doNothing() {
        //do nothing
    /* Generate a null pointer exception on purpose */
    public void generateNpe() throws NullPointerException {
        Object x = null;
        x.toString();
    My test page to generate the exception:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Test page</title>
    </h:head>
    <h:body>
        <h:form>
            <h:commandButton id="button1" value="do nothing" action="#{myController.doNothing}" />
            <h:commandButton id="button2" value="generate NPE" action="#{myController.generateNpe}" />
        </h:form>
    </h:body>
    </html>
    My web.xml:
    <!-- Redirect all NPEs to this page; this never works! -->
    <error-page>
        <exception-type>java.lang.NullPointerException</exception-type>
        <location>/error/error003.jsf</location>
    </error-page>
    <!-- Redirect all VEEs to this page; this works fine if the next section is excluded -->
    <error-page>
        <exception-type>javax.faces.application.ViewExpiredException</exception-type>
        <location>/error/error002.jsf</location>
    </error-page>
    <!-- This grabs everything, even with the previous sections defined.  If I exclude this error-page section, VEE works fine but NPE still does not get redirected -->
    <error-page>
        <exception-type>java.lang.Exception</exception-type>
        <location>/error/error001.jsf</location>
    </error-page>My questions are as follows:
    1) How can we handle "regular" java exceptions like NPE?
    2) How can we define a catch-all for unexpected exception types, while still respecting specific exception handlers for VEE, etc?
    Thanks,
    Benjamin

    Is your data model right? If you are adding in one and deleting in another it sounds to me more like a process that an entity, in which case you may revisit your data model and simplify it, add in a session bean with the process method to co-ordinate between the two.
    However, if you want to map multiple different tables within a single entity bean it is possible and just part of the mapping. How you actualyl specify it depends on which implementation you are working with.
    Cheers,
    Peter.

  • Error: ORA-29532: Java call terminated by uncaught Java exception:

    Anyone have this similar problem of
    ORA-29532: Java call terminated by uncaught Java exception:
    javax.xml.rpc.soap.SOAPFaultException: Caught exception while handling request:
    deserialization error: XML reader error: unexpected character content:
    "A"
    The service is running fine in a browser and returns the date. When I run it using the PL/SQL it has the error mentioned above.
    I am running the following:
    CREATE OR REPLACE FUNCTION GetDate_wb( p_dummy IN VARCHAR2 )
    RETURN DATE
    AS
    l_service sys.UTL_DBWS.service;
    l_call sys.UTL_DBWS.call;
    l_result ANYDATA;
    l_wsdl_url VARCHAR2(1024);
    l_service_name VARCHAR2(200);
    l_operation_name VARCHAR2(200);
    l_input_params sys.UTL_DBWS.anydata_list;
    l_port sys.UTL_DBWS.qname := 8988;
    BEGIN
    l_wsdl_url := 'http://org-lblakisa1:8988/BPEL_OD-LoginWS-context-root/getDate1SoapHttpPort?WSDL';
    l_service_name := 'getDate1';
    l_operation_name := 'getDate';
    l_service := sys.UTL_DBWS.create_service (
    wsdl_document_location => URIFACTORY.getURI(l_wsdl_url),
    service_name => l_service_name);
    l_call := sys.UTL_DBWS.create_call (
    service_handle => l_service,
    port_name => NULL,
    operation_name => l_operation_name);
    l_input_params(1) := ANYDATA.ConvertVarchar2(p_dummy);
    l_result := sys.UTL_DBWS.invoke (
    call_handle => l_call,
    input_params => l_input_params);
    sys.UTL_DBWS.release_call (call_handle => l_call);
    sys.UTL_DBWS.release_service (service_handle => l_service);
    RETURN ANYDATA.AccessDate(l_result);
    END;
    /

    Problem is resolved... We had a version issue in that 10.1.3 web service is not compatible. 10.1.2 worked.

  • LSOCP 200 Content Player Java Exception

    Dear Collegues,
    I am encountering an issue with the LSOCP 200.
    Our client's infrastructure as follows:
    SAP R/3 Enterprise 4.7 Ext 2.00
    LSO         200     0029     SAPK-200PTINLSO     LSO 200 (Learning Solution - Back End) I
    LSOFE     200     0027     SAPK-200PRINLSOFE     LSOFE 200 (Learning Solution - Front End
    SAP EP 6.0
    I have done all the required configuration in R/3 by pointing to the content server and pointing to the Content Player in the respective IMG Tasks.
    Now, when I log on as a learner and attempt to start a course, I receive a Java Exception:
    *Errors occurred
    Incomplete or incorrect data:
    com.sap.hcm.ls.lms.servlets.exceptions.InvalidArgumentException course update failed  :
         at com.sap.hcm.ls.lms.servlets.control.CourseUpdater.update(CourseUpdater.java:78)
         at com.sap.hcm.ls.lms.servlets.control.EventDispatcher.updateModels(EventDispatcher.java:116)
         at com.sap.hcm.ls.lms.servlets.control.RequestProcessor.doProcess(RequestProcessor.java:98)
         at com.sap.hcm.ls.lms.servlets.control.RequestProcessor.process(RequestProcessor.java:83)
         at com.sap.hcm.ls.lms.servlets.control.Mediator.processRequest(Mediator.java:221)
         at com.sap.hcm.ls.lms.servlets.control.Mediator.doGet(Mediator.java:150)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java(Compiled Code))
         at java.security.AccessController.doPrivileged1(Native Method)
         at java.security.AccessController.doPrivileged(AccessController.java(Compiled Code))
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java(Compiled Code))
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java(Compiled Code))
    CAUSED BY: com.sap.hcm.ls.lms.courseengine.EngineException: failed to get macrostrategy with token=
         at com.sap.hcm.ls.lms.courseengine.steamengine.SteamEngine.getSteamMacroStrategyByToken(SteamEngine.java:180)
         at com.sap.hcm.ls.lms.courseengine.steamengine.SteamCourse.(SteamCourse.java:108)
         at com.sap.hcm.ls.lms.courseengine.steamengine.SteamEngine.loadCourse(SteamEngine.java:303)
         at com.sap.hcm.ls.lms.courseengine.steamengine.SteamEngine.loadCourse(SteamEngine.java:313)
         at com.sap.hcm.ls.lms.data.session.SessionFacade.loadCourse(SessionFacade.java:587)
         at com.sap.hcm.ls.lms.data.session.CourseStateUpdater.loadCourseFromPath(CourseStateUpdater.java:354)
         at com.sap.hcm.ls.lms.data.session.CourseStateUpdater.loadCourse(CourseStateUpdater.java:176)
         at com.sap.hcm.ls.lms.data.session.CourseStateUpdater.update(CourseStateUpdater.java:120)
         at com.sap.hcm.ls.lms.servlets.control.CourseUpdater.update(CourseUpdater.java:74)*
    The content plays on the local Content player on the desktop but the moment I attempt to play content with the server content player, this is what i get.
    Could you please let me know if you have come across this problem.
    Thanks and regards,
    Ronald Meyer

    Hi Abhiram,
    Please get in the IMG
    Training and Event Management -> SAP Learning Solution -> Learning Portal -> Select Learning Strategies
    Here you need to update your strategies defined.
    Regards,
    Jorge

Maybe you are looking for

  • Switching back to Mail from Outlook (for Mac)

    I've had my Mac for only about 8 months now and was happy with Apple Mail - at first. Then I got a hold of MS Outlook 2011 (for Mac) and switched. Now, with the impending revamping of Mail with Mac OS X Lion, I want to switch back to Mail but there d

  • How do I back my iphone  music up to a new computer

    I previously had the music on my iPhone 5 backed up to my old computer, this computer has now crashed and I can't access anything off it. Is there a way I can get this music from my library?

  • Setting Up Data Source In Reporting Services

    I know how to set up a data source using SQL Server Authentication by filling in this part: However, when I try to use Windows Authentication here, it says "Log on failed.  Ensure the user name and password are correct". When I use my Windows Authent

  • .Mac Gallery sort order

    Is there any way to influence the sort order of my galleries posted on .Mac? It seems the last one published is shown first, but I'd like to get them in chronological order. Thanks.

  • Space bar off

    When trying to compose a new document I find the space bar is not working properly. Sometimes when I hit the it, it does not go forward but goes back several letters and makes a space there. It is impossible to control. I don't know if this is a good