Exception handling when invoke ejb

Hi,
I call ejb like this:
try {
      MyBeanHome beanHome = .. //jndi lookup 
      MyBean bean = beanHome .create();
      HashMap h = bean.chargeFee(data);
      bean.remove();
} catch (
}there are a lot exceptions: NamingException, CreationException, RemoteException, RemoveException (I don't have application exception).
I am thinking I catch the RemoveException first, since it happened after the chargeFee is called, and chargeFee is already been executed, so I deal it differently with the other Exceptions, since they heppend before or during the chargeFee executed, I treat it as not been executed.
Is it the right way to handle the exceptions? Thanks

It's difficult to answer you question because the intent is not known.
I would suggest to write down all possible exceptions and the actions to be taken. Try to pass on as many exceptions as possible to the client. I know I might be getting a lot for flake for this statement but catching too many exception makes the code look complicated. If you don't know what to do with an exception then just don't catch it.
If Pet Store example is complicated for you then try looking at Avitek Medical records example that comes bundled with BEA weblogic 8.1. You can install it for free and the example is just great.
- Roger

Similar Messages

  • Getting a security exception when invoking EJB from a webservice

    Hi,
    I am getting the following exception when Invoke an EJB from a web service.
    The EJB fails when it tries to access a remote object(RMI).
    When I invoke the EJB directly I dont get this exception.
    Both the EJB and the WS are deployed as part of the same application on weblogic 9.2 .
    the WS was created by jwsc ant task.
    This is the exception:
    java.rmi.ServerException: RemoteException occurred in server thread; nested exce
    ption is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
    tion is:
    java.lang.ClassNotFoundException: com.bea.xml.XmlCalendar (no security m
    anager: RMI class loader disabled)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:292)
    at sun.rmi.transport.Transport$1.run(Transport.java:148)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
    60)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
    .java:701)
    at java.lang.Thread.run(Thread.java:534)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Stream
    RemoteCall.java:247)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:
    223)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
    at com.netcom.server.rmi.RequestHandlerImpl_
    Stub.copy(Unknown Source)
    Message was edited by:
    guyh

    Hi Jitu,
    I changed the wsdl. And so I don�t get the warning anymore. My Webservice also runs well, now. Thanks anyway for the reply.
    There is a nice tech article on the sun network, which solved my problem. The basic idea is to split the wsdl into 2 wsdl documents. one containing all the porttypes messages and so on. And the other wsdl contains the binding and service elements.
    If you are interested check out this link:
    http://java.sun.com/developer/technicalArticles/xml/jaxrpcpatterns/index2.html
    thanks,
    footman

  • Exception handling bug in EJB-s

    Hi,
    My collegue had problems with exceptions in iPlanet EJB-s.
    Exceptions that were inherited from the class that is declared to be
    thrown by a particular method made EJB-s to be destroyed due to an
    unhadled exception. (Eg. NoSuchObjectException is found to be unhandled
    even if FinderException is declared to be thrown.)
    This is a serious malfunction of the container and against the basic
    concept of EJB and also the Java itself.
    The root cause that were found is highlighted in the code example, where
    direct equality is used for testing class instead of the instanceof
    operator. This code has been found in ejb_skel_CLASSNAME.java and has
    been generatd by ejbc iAS6 SP3.
    Regards,
    Gy�rgy Szondy
    Capital Systems Kft.
    Gy�rgy Szondy, Development Team Manager
    Gogol u. 16., 1133 Budapest, Hungary
    Tel: +36 1 288 7036 mailto:[email protected]
    Fax: +36 1 350 8159
    -----Eredeti �zenet-----
    Felad�: Geiszter Gy�rgy
    Elk�ldve: 2001.okt�ber.8. 14:23
    C�mzett: Szondy Gy�rgy
    T�rgy: Exception handling in EJB-s
    public void removePerson(int arg0) throws java.rmi.RemoteException,
    hu.capsys.wwwsol.control.WwwsolException
    Object delegate = super._ns_getDelegateForUpCall();
    try
    nsbeforeUpcall("removePerson", delegate);
    try
    delegate.getClass().getMethod("removePerson", new Class[]{
    Integer.TYPE}).invoke(delegate, new Object[]{
    new Integer(arg0 )});
    } catch
    (java.lang.reflect.InvocationTargetException ex) {
    Throwable th = ex.getTargetException();
    if (th.getClass() ==
    hu.capsys.wwwsol.control.WwwsolException.class){ // HERE IS THE BUG
    nsafterUpcall("removePerson", delegate, th);
    throw (hu.capsys.wwwsol.control.WwwsolException)th ;
    nsafterUpcall("removePerson", delegate, th);
    java.rmi.RemoteException subex = nsinvalidateDelegate(delegate,
    th);
    delegate = null;
    throw subex;
    catch (java.lang.Throwable ex)
    nsafterUpcall("removePerson", delegate, ex);
    java.rmi.RemoteException subex = nsinvalidateDelegate(delegate,
    ex);
    delegate = null;
    throw subex;
    finally
    if(delegate != null)
    nsreleaseDelegateForUpCall(delegate);
    nsafterUpcall("removePerson", delegate, null);
    }

    Hi,
    My collegue had problems with exceptions in iPlanet EJB-s.
    Exceptions that were inherited from the class that is declared to be
    thrown by a particular method made EJB-s to be destroyed due to an
    unhadled exception. (Eg. NoSuchObjectException is found to be unhandled
    even if FinderException is declared to be thrown.)
    This is a serious malfunction of the container and against the basic
    concept of EJB and also the Java itself.
    The root cause that were found is highlighted in the code example, where
    direct equality is used for testing class instead of the instanceof
    operator. This code has been found in ejb_skel_CLASSNAME.java and has
    been generatd by ejbc iAS6 SP3.
    Regards,
    Gy�rgy Szondy
    Capital Systems Kft.
    Gy�rgy Szondy, Development Team Manager
    Gogol u. 16., 1133 Budapest, Hungary
    Tel: +36 1 288 7036 mailto:[email protected]
    Fax: +36 1 350 8159
    -----Eredeti �zenet-----
    Felad�: Geiszter Gy�rgy
    Elk�ldve: 2001.okt�ber.8. 14:23
    C�mzett: Szondy Gy�rgy
    T�rgy: Exception handling in EJB-s
    public void removePerson(int arg0) throws java.rmi.RemoteException,
    hu.capsys.wwwsol.control.WwwsolException
    Object delegate = super._ns_getDelegateForUpCall();
    try
    nsbeforeUpcall("removePerson", delegate);
    try
    delegate.getClass().getMethod("removePerson", new Class[]{
    Integer.TYPE}).invoke(delegate, new Object[]{
    new Integer(arg0 )});
    } catch
    (java.lang.reflect.InvocationTargetException ex) {
    Throwable th = ex.getTargetException();
    if (th.getClass() ==
    hu.capsys.wwwsol.control.WwwsolException.class){ // HERE IS THE BUG
    nsafterUpcall("removePerson", delegate, th);
    throw (hu.capsys.wwwsol.control.WwwsolException)th ;
    nsafterUpcall("removePerson", delegate, th);
    java.rmi.RemoteException subex = nsinvalidateDelegate(delegate,
    th);
    delegate = null;
    throw subex;
    catch (java.lang.Throwable ex)
    nsafterUpcall("removePerson", delegate, ex);
    java.rmi.RemoteException subex = nsinvalidateDelegate(delegate,
    ex);
    delegate = null;
    throw subex;
    finally
    if(delegate != null)
    nsreleaseDelegateForUpCall(delegate);
    nsafterUpcall("removePerson", delegate, null);
    }

  • Utl_file - exception handling when inserted in bulk.

    Hi,
    I am using Oracle 10gR2. I wanted to write data to a file. Due to huge number of records, I am collecting them into a collection, traversing e collection, appending the values in collection to a varchar variable with new line in a loop.If the array size is say 50, I will have 50 values in the Vatchar variable separated by CHR(10). and I will insert the variable using UTL_FILE.PUT so that 50 lines will be inserted with values into the file.
    Now my query is if any one among those 50 values gives an exception, I feel all the 50 values can't be loaded. Please suggest exception handling in this case.
    Regards,
    Naveen Kumar.C.
    Edited by: Naveen Kumar C on Sep 17, 2009 5:23 PM

    You could use a CLOB in conjunction with UTL_FILE to write it out 32K at a time...
    SQL> ed
    Wrote file afiedt.buf
      1  DECLARE
      2    l_file    UTL_FILE.FILE_TYPE;
      3    l_clob    CLOB;
      4    l_buffer  VARCHAR2(32767);
      5    l_amount  BINARY_INTEGER := 32767;
      6    l_pos     INTEGER := 1;
      7  BEGIN
      8    BEGIN
      9      SELECT dbms_xmlgen.getxmltype('select * from emp natural join dept').getclobval()
    10      INTO   l_clob
    11      FROM   dual;
    12    EXCEPTION
    13      WHEN NO_DATA_FOUND THEN
    14        RETURN;
    15    END;
    16    l_file := UTL_FILE.fopen('TEST_DIR', 'Sample2.txt', 'w', 32767);
    17    LOOP
    18      DBMS_LOB.read (l_clob, l_amount, l_pos, l_buffer);
    19      UTL_FILE.put(l_file, l_buffer);
    20      l_pos := l_pos + l_amount;
    21    END LOOP;
    22  EXCEPTION
    23    WHEN NO_DATA_FOUND THEN -- occurs when end of CLOB reached
    24      UTL_FILE.fclose(l_file);
    25    WHEN OTHERS THEN
    26      DBMS_OUTPUT.put_line(SQLERRM);
    27      UTL_FILE.fclose(l_file);
    28* END;
    SQL> /
    PL/SQL procedure successfully completed.
    SQL>

  • Exception Handling - WHEN OTHERS

    Good Day to All,
    When i am running a procedure in TOAD-Expert... it says below message.
    *'Avoid using a WHEN OTHERS clause in an exception section without any other specific handlers.'*
    PROCEDURE...
    IS
    BEGIN
    EXCEPTION
    WHEN OTHERS THEN
    ROLLBACK;
    -- Checking whether cursor is open
       IF cur%ISOPEN THEN
        CLOSE cur;
       END IF;
      UPDATE TABLE
      SET COL..
      WHERE ...
       COMMIT;
       RAISE;
    END procedure;

    The manner in which you are dealing with the exception is not wrong. Your handler does a couple of things:
    - rollbacks the existing transaction as failed
    - attempts resource protection (guard against resource leakage)
    - logs the error
    - re-raises the exception
    None of these are invalid actions when dealing with an exception.
    A suggestion though - move the UPDATE out of the exception and create a procedure that performs the logging for you (as an autonomous transaction). This way you have a reusable logging code unit that can be called from anywhere in your code.
    Resource protection for explicit cursors are also not that critical in PL/SQL - as cursor handles that go out of scope are automatically released. The exception being a ref cursor handle. Of course, you need to resource protect other handles (like socket and file handles). And seeing that PL/SQL does not offer resource protection blocks, the only alternative is to use the "+when OTHERS+" exception handler for that.

  • NoSuchMethodError when invoking EJB Component  From BPM Process

    Hi,
    I created BPM process which contains global creation activity and user interactive activity and catalogued ejb component. In user interactive activity i wrote the Process Business Language to invoke Remote EJB deployed in weblogic server. When i tried to execute user interactive activity, i got the following exception.
    Caused by: java.lang.NoSuchMethodError: weblogic.kernel.KernelStatus.isThinIIOPClient()Z
         at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.readObject(RemoteBusinessIntfProxy.java:192)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
         at java.io.ObjectInputStream.readSerialData(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
         at java.io.ObjectInputStream.readSerialData(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.readObject(Unknown Source)
         at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:195)
         at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:565)
         at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:191)
         at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO.java:62)
         at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:201)
         at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:338)
         at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:252)
         at weblogic.jndi.internal.ServerNamingNode_921_WLStub.lookup(Unknown Source)
         at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:374)
         at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:362)
         at javax.naming.InitialContext.lookup(Unknown Source)
         at fuego.jndi.FaultTolerantContext.lookup(FaultTolerantContext.java:515)
         at fuego.connector.impl.BaseRemoteConnector.getReferencedObject(BaseRemoteConnector.java:116)
         at fuego.connector.impl.BaseRemoteConnector.getReferencedObject(BaseRemoteConnector.java:107)
         at fuego.ejb.EJBConnector.getEJBHome(EJBConnector.java:62)
         at fuego.ejb.EJBConnector.getEJBHome(EJBConnector.java:52)
         at fuego.ejb.EJBConnector.getResource(EJBConnector.java:101)
         at fuego.ejb.EJBConnector.getResource(EJBConnector.java:91)
         at fuego.ejb.EJBConnector.getResource(EJBConnector.java:79)
         at fuego.connector.ConnectorTransaction.getResource(ConnectorTransaction.java:276)
         at fuego.connector.EJBHelper.getEJBHome(EJBHelper.java:36)
         at fuego.connector.EJBHelper.getEJBHome(EJBHelper.java:30)
         at fuego.ejb.EJBHome.locate(EJBHome.java:119)
         at OrderManagement.SampleOrderProcess.Default_1_0.Instance.CIL_submitOrder(Instance.xcdl:1)
         at OrderManagement.SampleOrderProcess.Default_1_0.Instance.CIL_submitOrder(Instance.xcdl)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at fuego.component.ExecutionThreadContext.invokeMethod(ExecutionThreadContext.java:512)
    what i noticed here is in Oracle BPM Studio there is weblogic jar file which contains Kernel status file. The KernelStatus file do not have "isThinIIOPClient method". But in wlclient jar file there is Kernel status class which contains "isThinIIOPClient" method.
    How can I override the weblogic.jar and wlclient.jar for Oracle BPM?
    Please help me to resolve this problem.
    Thanks and Regards
    Mahesh Babu

    I resolved the above issue by generating ejb2.1 session bean and ejb2.1 client. But When i tried to invoke ejb2.1 session bean from process using Process Business Language, it throws the following exception.
    Task failed.
    Caused by: Task '0' in activity '/SampleOrderProcess#Default-1.0/Interactive[SubmitOrder]' for instance '/SampleOrderProcess#Default-1.0/1/0' could not be successfully executed. The task failed while executing method 'submitOrder'.
    Caused by: The method 'CIL_submitOrder' from class 'OrderManagement.SampleOrderProcess.Default_1_0.Instance' could not be successfully executed.
    Caused by: java.lang.IncompatibleClassChangeError
    Caused by: fuego.lang.ComponentExecutionException: The method 'CIL_submitOrder' from class 'OrderManagement.SampleOrderProcess.Default_1_0.Instance' could not be successfully executed.
         at fuego.component.ExecutionThreadContext.invokeMethod(ExecutionThreadContext.java:519)
         at fuego.component.ExecutionThreadContext.invokeMethod(ExecutionThreadContext.java:273)
         at fuego.fengine.FEEngineExecutionContext.invokeMethodAsCil(FEEngineExecutionContext.java:219)
         at fuego.server.execution.EngineExecutionContext.runCil(EngineExecutionContext.java:1280)
         at fuego.server.execution.TaskExecution.invoke(TaskExecution.java:401)
         at fuego.server.execution.InteractiveNormalCilExecution.invoke(InteractiveNormalCilExecution.java:425)
         at fuego.server.execution.TaskExecution.executeCIL(TaskExecution.java:513)
         at fuego.server.execution.TaskExecution.executeTask(TaskExecution.java:697)
         at fuego.server.execution.TaskExecution.executeTask(TaskExecution.java:657)
         at fuego.server.execution.TaskExecution.executeTask(TaskExecution.java:154)
         at fuego.server.execution.microactivity.InteractiveMicroActivity.executeNormalCil(InteractiveMicroActivity.java:501)
         at fuego.server.execution.microactivity.InteractiveMicroActivity.executeItem(InteractiveMicroActivity.java:454)
         at fuego.server.execution.microactivity.InteractiveMicroActivity.execute(InteractiveMicroActivity.java:104)
         at fuego.server.AbstractProcessBean$48.execute(AbstractProcessBean.java:3184)
         at fuego.server.execution.DefaultEngineExecution$AtomicExecutionTA.runTransaction(DefaultEngineExecution.java:304)
         at fuego.transaction.TransactionAction.startBaseTransaction(TransactionAction.java:470)
         at fuego.transaction.TransactionAction.startTransaction(TransactionAction.java:551)
         at fuego.transaction.TransactionAction.start(TransactionAction.java:212)
         at fuego.server.execution.DefaultEngineExecution.executeImmediate(DefaultEngineExecution.java:123)
         at fuego.server.execution.EngineExecution.executeImmediate(EngineExecution.java:66)
         at fuego.server.AbstractProcessBean.runTask(AbstractProcessBean.java:3188)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at fuego.lang.JavaClass.invokeMethod(JavaClass.java:1410)
         at fuego.lang.JavaObject.invoke(JavaObject.java:227)
         at fuego.component.Message.process(Message.java:585)
         at fuego.component.ExecutionThread.processMessage(ExecutionThread.java:780)
         at fuego.component.ExecutionThread.processBatch(ExecutionThread.java:755)
         at fuego.component.ExecutionThread.doProcessBatch(ExecutionThread.java:142)
         at fuego.component.ExecutionThread.doProcessBatch(ExecutionThread.java:134)
         at fuego.fengine.FEngineProcessBean.processBatch(FEngineProcessBean.java:244)
         at fuego.component.ExecutionThread.work(ExecutionThread.java:839)
         at fuego.component.ExecutionThread.run(ExecutionThread.java:408)
    Caused by: java.lang.IncompatibleClassChangeError
         at OrderManagement.SampleOrderProcess.Default_1_0.Instance.CIL_submitOrder(Instance.xcdl:5)
         at OrderManagement.SampleOrderProcess.Default_1_0.Instance.CIL_submitOrder(Instance.xcdl)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at fuego.component.ExecutionThreadContext.invokeMethod(ExecutionThreadContext.java:512)
         ... 34 more
    Please help me to resolve this issue.
    Thanks and Regards
    Mahesh Babu

  • Exception obtained when invoking a web service generated with JDeveloper

    Hello,
    I tried to create a synchronous BPEL process that invokes synchronously a Java Web Service created with the JDeveloper. The web service is wrapped around a regular Java class. The new created BPEL process is successfully compiled and deployed on the server. But when I try to initiate a test instance of the process in the BPEL console, after I fill the input parameter for then process and push the "Post XML Message" button, I obtain the following error:
    Your test request generated the following exception/fault:
    BPEL Fault: {http://oracle.com/cde/util/Top300DAO.wsdl}org.apache.wsif.soap.fault{org.apache.wsif.soap.fault.object=java.net.ConnectException: Connection refused: connect}
    I looked at flow and it throws the exception when it tries to invokes the web service generated with JDeveloper.
    Do you have any hints, ideas? Thanks a lot in advance for your help.
    I want to also say that the proxy settings for the BPEL server and designer are filled. I think that they are ok because I succeeded to start an instance of another process that calls synchronously an external Web Service.
    Regards,
    Marinel

    My guess is that this is caused by the WSDL of your service having an invalid service address. Can you please take a look at the WSDL of your service make sure that the location of the address is valid? (we have seen a couple of instances in the past where the generated url did not have the right port information).
    Update that WSDL, restart the BPEL server or from the BPEL console clear the WSDL cache and re-initiate your flow.
    Best,
    Edwin

  • Fault Handling when Invoke fails

    Hi,
    I have an task in Error Handling. I have a BPEL which has 3 Oracle apps Adapters. I need to handle errors when the invoke to the adapter fails. I have added 3 different scopes anc an empty catch. I dunno how to proceed futher. Please give me some ideas.
    Thanks
    Karthick

    Hi,
    I have handled the remote fault. In the same scope Im trying to handle selection failure fault. But I face this error.
    Error(105): WSDL messageType "{http://schemas.xmlsoap.org/ws/2003/03/business-process/}selectionFailure" of variable "" is not defined in any of the WSDL files
    The same error I faced with remote fault. But I added runtime_fault.wsdl which solved my issue. But the same doesnt help out for the selection failure. Any thoughts on this?
    Thanks
    Karthick

  • Exception Handling Strategy in EJB enviroment

    Hi,
    Im hoping someone has a good solution for this problem...
    I have an EJB that uses some utility classes. We always throw exceptions from the utility classes and handle them in the session bean by logging the exception.
    Now my problem is that there is a particular utility class that extends a class in a 3rdParty package & so the exception thrown by a method in this class is set to be "SQLException".
    But the subclass that I have written can generate SAXException in addition to the SQLException.
    I can think of two ways to deal with this:
    (a) I can Log the exception here and swallow it. The problem here is how do I rollback the transaction? I dont want my utility classes to have transaction code anyway...
    (b) create a new SQLException to wrap the SAXException and rethrow it and handle in the sessionbean like I do for all my other methods. This will work but its kind of weird to wrap a SAXException in a SQLException.
    Any comments on the which would be a better option?
    Thanks!

    I think a better way to do this would be having your own custom exception(s), with proper message (or codes) corresponding to every type of exception you expect your transactions to generate. You would only need to worry about your own exception(s).
    Regards
    $ Carol

  • Mediator exception handling when no data found in database

    hi Guys,
    I am using DB adapter in a composite and using a mediator to invoke them, however not getting how to send the response back,
    in case there is NO_DATA_FOUND error.
    waiting for response
    thanks
    Yatan

    Yatan
    As far as i know a DB adapter will not throw no_data_found exception if it is not able to get rows from database it will just initialize the output variable with null. But yes in case of call to procedure or function it may cause that you should handle then and there only.
    Let us know what exactly is the issue you are facing.
    Thanks
    AJ

  • Event dispatching exception thrown when invoking a webpage in a JEditorPane

    I have a help option in one of the menus of my tool. When this help option is chosen from the menu, the tool invokes a frame which is of JEditorPane type and displays an HTML doc in it. Here is the stack trace I am getting.
    My problem is I get this error only on Unix platforms (Solaris) and despite the exception being thrown the application works alright. Although the help frame has serious performance issues, it takes a while for this frame to load the html doc in it and display it (the html file is about 8 pages long).
    Please let me know how to get rid of this exception. Thanks in advance. Here is the stack trace of the exception I am getting:
    Exception occurred during event dispatching:
    java.lang.NullPointerException
    at javax.swing.text.LabelView.syncFragments(Compiled Code)
    at javax.swing.text.LabelView.getPreferredSpan(Compiled Code)
    at javax.swing.text.ParagraphView.layoutRow(Compiled Code)
    at javax.swing.text.ParagraphView.rebuildRows(Compiled Code)
    at javax.swing.text.ParagraphView.layout(ParagraphView.java:216)
    at javax.swing.text.BoxView.setSize(BoxView.java:259)
    at javax.swing.text.BoxView.layout(Compiled Code)
    at javax.swing.text.BoxView.setSize(BoxView.java:259)
    at javax.swing.text.BoxView.layout(Compiled Code)
    at javax.swing.text.BoxView.setSize(BoxView.java:259)
    at javax.swing.plaf.basic.BasicTextUI$RootView.setSize(Compiled Code)
    at javax.swing.plaf.basic.BasicTextUI.getPreferredSize(Compiled Code)
    at javax.swing.JComponent.getPreferredSize(Compiled Code)
    at javax.swing.JEditorPane.getPreferredSize(JEditorPane.java:991)
    at javax.swing.ScrollPaneLayout.layoutContainer(Compiled Code)
    at java.awt.Container.layout(Compiled Code)
    at java.awt.Container.doLayout(Compiled Code)
    at java.awt.Container.validateTree(Compiled Code)
    at java.awt.Container.validateTree(Compiled Code)
    at java.awt.Container.validateTree(Compiled Code)
    at java.awt.Container.validateTree(Compiled Code)
    at java.awt.Container.validateTree(Compiled Code)
    at java.awt.Container.validate(Compiled Code)
    at java.awt.Window.dispatchEventImpl(Compiled Code)
    at java.awt.Component.dispatchEvent(Compiled Code)
    at java.awt.EventQueue.dispatchEvent(Compiled Code)
    at java.awt.EventDispatchThread.pumpOneEvent(Compiled Code)
    at java.awt.EventDispatchThread.pumpEvents(Compiled Code)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:83)

    I am still at a loss, any help/ tips/ guidance is welcome to solve this problem. thanks in advance.

  • Java.lang.ClassCastException when invoking EJB from BPEL

    Hi,
    We have a EJB deployed in one OC4J instance and the BPEL is deployed in another OC4J instance. ClassCastException occurs when the BPEL invokes the EJB. Any feedback would be appreciated.
    Regards,
    M.Rajesh

    Hi Rajesh,
    I am facing the same issue.
    Did this issue get resolved at your end?
    Thanks,
    Mahendra

  • Exception handling when no execuble bindings available in PageDefinition?

    Currently I'm showcasing a simple authentication example to one of our clients. The example consists of the following :
    * a simple AuthenticationFilter setup in my web.xml
    * a simple (V1 ... not V2) DataAction with a modelReference property pointing to the correct pageModel.
    The pageModel looks like this :
    <?xml version="1.0" encoding="UTF-8" ?>
    <pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel"
    version="10.1.3.36.73" id="indexPageDef"
    Package="my.demo.package.pageDefs">
    </pageDefinition>
    As you can see ... it does not contain any executable bindings.
    The DataAction has a "onLogon(DataActionContext ctx)" method which calls out to a method on my ApplicationModule (pretty similar to the Jheadstart authentication example). The method gets actually called and it performs the authentication perfectly. BUT .. when (for example) the username is not correct, it will throw a JboException.
    When I try to login again (this time with the correct credentials) and no (new) exceptions are thrown, the old exception is still on the stack ! !
    I tried forcing a bindingContainer.resetInputState() but that didn't help. After a period of digging in the source code I found out the following :
    // oracle.adf.model.binding.DCBindingContainer
    public void resetInputState() {
    // other code
    if (mExecutables == null)
    return;
    // other code
    mExcs = null;
    Some extra info : mExcs points to an ArrayList which contains the exceptions in the bindingcontainer. mExecutables point to a HashMap which contains the executable bindings in the bindingcontainer (~PageDef).
    In other words : if the PageDef does not contain any executable bindings, the stack of exceptions is not reset. Which in my case is what's happening.
    If I change the code of de DCBindingContainer to the following :
    public void resetInputState() {
    // other code
    if (mExecutables == null)
    // could not be sooner, because it is used later on...
    mExcs = null;
    return;
    // other code
    mExcs = null;
    If I run my demo again I see that the stack of exceptions is actually cleared even though I do not have any executable bindings in my PageDef.
    So, my question is : is it correct behaviour that resetInputState() does not clear the exceptions if I have an empty PageDefinition ?

    ** bump **

  • Exception Handling when calling a PHP Webservice

    I followed a great tutorial on setting calling PHP services from ABAP ([Accessing arbitrary databases from within ABAP using a PHP data hub and web services|Accessing arbitrary databases from within ABAP using a PHP data hub and web services]).   Unfortunately I'm getting occassional CX_AI_SYSTEM_FAULT exceptions and I don't know how to handle them gracefully.
    I'm calling the web service ABAP code from an RFC function which for some reason doesn't allow TRY/CATCH statements (I get a message saying "During RFC/update, no exception classes can be used".) 
    I'd be happy enough just to ignore the error since it's currently dumping users out of order entry.
    To make matters more complicated, I can't TRY/CATCH my own RFC since I'm calling it from GuiXT
    I'd really appreciate help on this; I'm pretty stumped.
    Thanks,
    Lee

    Well, to answer my own question, I found an ugly workaround.
    Change attribute from "Remote-enabled" to "Normal Function", add the TRY/CATCH logic.  Then call this function from the "real" RFC.
    Off to program like it's 1979!
    Lee

  • Exception raised when invoking MembershipUser.ResetPassword()

    In some cases, MembershipUser.ResetPassword() raises an exception. This only happens for some users, and it's not clear why. There are no inputs to the method, so it seems like a problem internal to Oracle's membership provider implementation.
    The exception text: The provider returned an error that is not described by other MembershipCreateStatus enumeration values.
    The traceback:
    at Oracle.Web.Security.OracleMembershipProvider.ResetPassword(String username, String passwordAnswer)
    at System.Web.Security.MembershipUser.ResetPassword(String passwordAnswer)
    at System.Web.Security.MembershipUser.ResetPassword()
    +...+
    Any idea what could be happening here?

    I don't know why the behavior may be occurring, but to get more information you might want to enable ODP.NET tracing to see if there is any more information there. I suspect an error may have occurred in the odp.net level (or lower) and the aspnet provider wasn't expecting to have to handle that so is failing to return a proper MembershipCreateStatus enumeration.
    http://docs.oracle.com/html/B14164_01/featDebug.htm
    I'd go with trace_level 63.
    You'll need to restart the app after enabling tracing (and to stop tracing after setting level back to 0). You'll want to try to trace ONLY the problem operation if possible to keep things manageable. It wouldnt hurt to enable SQLNET tracing as well while you're at it.
    Hope it helps,
    Greg

Maybe you are looking for