Determine the type of the caught exception

Hi!
Here is my problem :
I'm using a web service and the method I call throws different types of Exception (RemoteException, ServiceException, etc...)
And, the reaction to the caught exception depends on its type, that's why I need to determine what type of exception i've caught. I know that with C# I use the boolean function is :
if (exception is TypeOfException1)
    // associated reaction
else if(exception is TypeOfException2)
   // associated reaction
}Is there any method or any other way in Java to do that?
Thanks a lot,
Gan�che.

>
Here is my problem :
I'm using a web service and the method I call throws different types of Exception (RemoteException, ServiceException, etc...)
And, the reaction to the caught exception depends on its type, that's why I need to determine what type of exception i've caught. >
try {
  // stuff that may cause exceptions..
} catch(RemoteException re) {
  // deal with this re
} catch(ServiceException se) {
  // deal with this se
} catch (Throwable didNotExpectThis) {
  // exceptional!
  didNotExpectThis.printStackTrace();
}

Similar Messages

  • The item could not be indexed successfully because the item failed in the indexing subsystem. ( The item could not be indexed successfully because the item failed in the indexing subsystem.; Caught exception when preparing generation GID[351]: (Indexer fa

    Hi guys, I'm getting this error from the crawler. Any ideas at all what might be causing it?
    The item could not be indexed successfully because the item failed in the indexing subsystem. ( The item could not be indexed successfully because the item failed in the indexing subsystem.; Caught exception when preparing generation GID[351]: (Indexer failed
    to prepare generation.); Aborting insert of item in Link Database because it was not inserted to the Search Index.; )

    Hi,
    Please check if adding more disk space to the location of the Index Partition could resolve the issue.
    Here is a thread with similar issue:
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/d06c9b2c-0bc1-44c6-b83a-2dc0b70936c4/the-item-could-not-be-indexed-successfully-because-the-item-failed-in-the-indexing-subsystem?forum=sharepointsearch
    Then reset the index and start a full crawl.
    Regards,
    Rebecca Tu
    TechNet Community Support

  • WCF :Consider marking the type with the CollectionDataContractAttribute attribute or the SerializableAttribute attribute or adding a setter to the property

    Hi All,
    Currently I am working in a WCF project here when I try to send data from WCF Project 1 to WCF project 2 I am getting the below error.
    The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/:subscriber. The InnerException message was 'The use of type 'Integra.Business.ICC.ObjectChangeTracker'
    as a get-only collection is not supported with NetDataContractSerializer.  Consider marking the type with the CollectionDataContractAttribute attribute or the SerializableAttribute attribute or adding a setter to the property.'.  Please see InnerException
    for more details.
    I don't understand what issue this is since I am new to WCF. Please help me on this thanks in advance.

    You've posted to a forum for Microsoft Project - a project management program.  Please re-post your question to the WCF forum:
    http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=wcf
    Sorry - I cannot seem to move your post for you.
    Julie

  • The type and the length of the members of the structures

    I am making the BC-XAL program.
    Reading `XAL_Interface_Documentation_11.pdf', now I succeeded in "Reading All Saved Monitor Sets" and "Reading All Monitors of a Monitor Set". but I can't find the type and the length of the member of the Structure BAPITNDEXT, so I cannot get the Monitoring Tree of a Monitor.
    where can I get any documents or information ?

    This is how it looks in my 46c system.
    MTSYSID         SYSYSID         CHAR      8     0R/3 System, name of R/3 System                                 
    MTMCNAME        ALMCNAME        CHAR     40     0Alert: name of monitoring context                              
    MTNUMRANGE      ALTIDNUMRG      CHAR      3     0Alert: monitoring type number range (perm., temp, ...)         
    MTUID           ALTIDUID        CHAR     10     0ALert: Unique Identifier for  Monitoring Types (used in TID)   
    MTCLASS         ALTIDMTCL       CHAR      3     0Alert: monitoring type class (perf., single msg.,...)          
    MTINDEX         ALTIDINDEX      CHAR     10     0Alert: internal handle for TID                                 
    EXTINDEX        ALTIDINDEX      CHAR     10     0Alert: internal handle for TID                                 
    ALTREENUM       ALTREENUM       INT4     10     0Alert: MT Tree info: Number of tree                            
    ALIDXINTRE      ALIDXINTRE      INT4     10     0Alert: Tree Info: Index of MT in Tree                          
    ALLEVINTRE      ALLEVINTRE      INT4     10     0Alert: Tree Info: Level of MTE in Tree                         
    ALPARINTRE      ALPARINTRE      INT4     10     0Alert: Tree Info: Index of Parent of MT in Tree                
    OBJECTNAME      ALMOBJECT       CHAR     40     0Alert: Name of Monitoring Object                               
    MTNAMESHRT      ALMTNAMESH      CHAR     40     0Alert: Short Name of Monitoring Type                           
    CUSGRPNAME      ALCUSGROUP      CHAR     40     0Alert: Customization: Name of Customization Group              
    DELIVERSTA      ALDELIVSTA      INT4     10     0Alert: MT Val: Delivery Status                                 
    HIGHALVAL       ALVALUE         INT4     10     0Alert: alert value (1 = green, 2 = yellow, ....)               
    HIGHALSEV       ALSEVERITY      INT4     10     0Alert: severity (alerts, monitoring type custom..)             
    ALSYSID         SYSYSID         CHAR      8     0R/3 System, name of R/3 System                                 
    MSEGNAME        ALMSEGNAME      CHAR     40     0Alert: name of monitoring segment                              
    ALUNIQNUM       ALAIDUID        CHAR     10     0Alert: Unique Identifier to be used in AID (char10)            
    ALINDEX         ALINDEX         CHAR     10     0Alert: internal handle                                         
    ALERTDATE       ALDATE          DATS      8     0Alert: date                                                    
    ALERTTIME       ALTIME          TIMS      6     0Alert: Time value in timeformat                                
    DUMMYALIGN      ALDUMMYC2       CHAR      2     0Alert: Dummy field. Purpose: Alignment of date/time 16 byte    
    LASTVALDAT      ALDATE          DATS      8     0Alert: date                                                    
    LASTVALTIM      ALTIME          TIMS      6     0Alert: Time value in timeformat                                
    LASTVALDUM      ALDUMMYC2       CHAR      2     0Alert: Dummy field. Purpose: Alignment of date/time 16 byte    
    ACTUALVAL       ALVALUE         INT4     10     0Alert: alert value (1 = green, 2 = yellow, ....)               
    ACTUALSEV       ALSEVERITY      INT4     10     0Alert: severity (alerts, monitoring type custom..)             
    VALSYSID        SYSYSID         CHAR      8     0R/3 System, name of R/3 System                                 
    VMSEGNAME     ALMSEGNAME     CHAR     40     0     Alert: name of monitoring segment                                  
    VALUNIQNUM     ALAIDUID     CHAR     10     0     Alert: Unique Identifier to be used in AID (char10)                                  
    VALINDEX     ALINDEX     CHAR     10     0     Alert: internal handle                                  
    VALERTDATE     ALDATE     DATS     8     0     Alert: date                                  
    VALERTTIME     ALTIME     TIMS     6     0     Alert: Time value in timeformat                                  
    VALERTDUM     ALDUMMYC2     CHAR     2     0     Alert: Dummy field. Purpose: Alignment of date/time 16 byte                                  
    COUNTOFACT     ALCNTACTAL     INT4     10     0     Alert: MT Val: Count of active Alerts                                  
    COUNTSUM     ALCNTSUMAL     INT4     10     0     Alert: MT Val: Sum of Alerts in MT                                  
    VISUSERLEV     ALVISILEVL     INT4     10     0     Alert: MTE type dev cust: Visible on user level (op,exp,dev)                                  
    TDSTATUS     ALTDSTATUS     INT4     10     0
         Alert: MT: Type Def Status
    Welcome to SDN.
    Regards,
    Rich Heilman

  • How to find out the type of the value stored in a string variable?

    Hi,
    How do i find out the type of the value stored in a string variable?
    for example,
    I have a string variable str, in which the following type of values wil be stored
    1) Intger
    2) Long
    3) boolean
    4) Char
    Is there any method to find out the type of the value, anything like str.getType()?. Please kindly help me. Thanks in advance.

    Hi All, i'm sorry for the double posting, by mistake it occured.
    Thanks for your replies, i have a string variable str, in which the value is stored and i have another string variable type, in which the type of the value is stored.
    For example,
    String str = "15";
    String type = "Integer";
    Is there any way to verify whether the value stroed in str is of type stored in the variable 'type'. I want to write a method of type boolean, it will throw true of the value stored in str is of type 'type'. Thanks

  • How to find out the type of the object ?

    how would i find out the type of an object reference variable ?
    it would be nice if there was some sort of getType() method that would return a string to tell me the type of the object -- just for testing purposes

    try
    Object.getClass().getName();
    or just
    Object.getClass().toString();
    so something like this in your code:
    Object obj = new Foo();
    System.out.println(""+obj.getClass());
    etc.

  • The types of the parameter field and parameter field current values are not compatible.----

    HI,
    I am attempting to set report parameters in my .jsp code via URL parameters.
    I am able to set the report name, server connection dynamically however when attempting to set the Parameters I receive:
    com.crystaldecisions.sdk.occa.report.lib.ReportSDKParameterFieldException: The types of the parameter field and parameter field current values are not compatible.---- Error code:-2147213303 Error code name:invalidParameterField
    The parameter on the report is a String Type, named for this example p1.
    The value that p1 represents is LERAD
    My code:
    String stringValue = request.getParameter("p1");
    CRJavaHelper.addDiscreteParameterValue( clientDoc, "","p1", stringvalue);
    returns the above mentioned error.
    I have tried:
    String stringValue = (String)request.getParameter("p1");
    which returns the above error
    And;
    String stringValue = new String(request.getParameter("p1")).toString();
    which returns
    java.lang.NullPointerException
    java.lang.String.<init>(Unknown Source)
    org.apache.jsp.callReport_jsp._jspService(callReport_jsp.java:105)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    I notice that the CRjavaHelper.java declares this addDiscreteParameterValue as accepting an Object type for the newValue.
    Any ideas???

    Hi,
    nevermind.
    case sensitivty strikes again.
    my URL param was P1 ( case sensitive)

  • The type of the database table and work area (or internal table)...

    Hello
    I am trying to use a database and select all records from it and store them into an internal table.
    My code:
    Select * from xixi_dbcurrency into table gt_currency.
    The error:
    "The type of the database table and work area (or internal table) "GT_CURRENCY" are not Unicode-convertible . . . . . . . . . .     "
    Any suggestions?
    Thank you

    Hi Thomas,
    Thank you for your inputs above.
    But as you suggested is we use INTO CORRESPONDING FIELDS OF TABLE then it resolve the error.
    But I have below piece of code:
    DATA:    it_new_source TYPE STANDARD TABLE OF _ty_s_sc_1,
                  wa_source TYPE _ty_s_sc_1,
                  wa_new_source TYPE _ty_s_sc_1,
                  ls_target_key TYPE t_target_key.
    SELECT * INTO CORRESPONDING FIELDS OF TABLE it_new_source
           FROM /bic/afao06pa100
           FOR ALL ENTRIES IN SOURCE_PACKAGE
           where /bic/fcckjobno = SOURCE_PACKAGE-/bic/fcckjobno
           and /bic/fcckjitid = SOURCE_PACKAGE-/bic/fcckjitid.
    But since this is reading into corresponding fields of table the data load from one DSO to other DOS is running for long more that 15 hours and still not getting completed and giving dump.
    So if I switch the search to below:
    SELECT * FROM /bic/afao06pa100
       INTO TABLE it_new_source
           FOR ALL ENTRIES IN SOURCE_PACKAGE
           where /bic/fcckjobno = SOURCE_PACKAGE-/bic/fcckjobno
           and /bic/fcckjitid = SOURCE_PACKAGE-/bic/fcckjitid.
    Then I am getting below error:E:The type of the database table and work area (or internal table) "IT_NEW_SOURCE" are not Unicode convertible.
    Can you please advice on this, as performance need to improve in start routine code.
    Thank You.

  • The type of the database table and work area are not Unicode convertible

    ***Data declaration
    TYPES : BEGIN OF t_zle_lagerplanung,
                       SEl, "stores which row user has selected
                       kdauf TYPE zle_lagerplanung-kdauf,
                       kdpos TYPE zle_lagerplanung-kdpos,
                       etenr TYPE zle_lagerplanung-etenr,
                       papiermaschine TYPE zle_lagerplanung-papiermaschine,
                       runnr TYPE zle_lagerplanung-runnr,
                       prio TYPE zle_lagerplanung-prio,
                       werk TYPE zle_lagerplanung-werk,
                       durchmesser TYPE zle_lagerplanung-durchmesser,
                       breite TYPE zle_lagerplanung-breite,
                       anzle TYPE zle_lagerplanung-anzle,
                       lgpla TYPE zle_lagerplanung-lgpla,
                       lgtyp TYPE zle_lagerplanung-lgtyp,
                       art TYPE zle_lagerplanung-art,
                       anzhoehe TYPE zle_lagerplanung-anzle,
                       fa TYPE zle_lagerplanung-fa,
    END OF t_zle_lagerplanung.
    DATA : it_zle_lagerplanung TYPE STANDARD TABLE OF t_zle_lagerplanung INITIAL SIZE 0,
                wa_zle_lagerplanung TYPE t_zle_lagerplanung.
    Here I am getting the data in internal table by using thiis select statement.
    SELECT kdauf kdpos etenr papiermaschine runnr prio werk durchmesser breite
                  anzle lgpla lgtyp art anzhoehe fa
    FROM    zle_lagerplanung INTO CORRESPONDING FIELDS OF TABLE it_zle_lagerplanung
    WHERE  kdauf IN s_kdauf
    AND       KDPOS IN s_kdpos
    AND      werk = p_werks.
    But while updating the particular field in zle_lagerplanung using this statement
    UPDATE zle_lagerplanung from table it_zle_lagerplanung.
    it is giving syntax error
    "The type of the database table and work area (or internal table)
    "IT_ZLE_LAGERPLANUNG" are not Unicode convertible. "
    Could any one help me out how to resolve this problem....
    Thanks in advance

    Dear Shayamal,
    XXX....are not Unicode convertible
    This  error comes while inserting or updating database and the fields are not matching between  data base table and structure .
    Check you fields of data base table and  "zle_lagerplanung" and struture "it_zle_lagerplanung" . There fields must match.
    thanks and regrds,
    Anup Banerjee

  • Unable to create the type with the name 'MSORA'. (Microsoft.SqlServer.ManagedDTS)

    I am attempting to use the Integration Services Import Project Wizard within Microsoft Visual Studio and am getting this error
    Unable to create the type with the name 'MSORA'. (Microsoft.SqlServer.ManagedDTS)
    upon Import.
    Can anyone shed some light for me on this cryptique error message?
    Thanks for your review and am hopeful for a reply.

    If you have the SSIS and SSDT (BIDS) installed then
    I believe the DTS assemblies got derigistered, a typical outcome of corrupted software, so a full re-install would be the best option. VS +SQL Server  + more
    Otherwise, as a quick fix try to
    reference the SSIS assemblies, like Microsoft.SQLServer.ManagedDTS.dll + more.
    They are by default in C:\Program Files\Microsoft SQL Server\<number>\SDK\Assemblies.
    Arthur
    MyBlog
    Twitter

  • Unable to create the type with the name 'ODATA'

    On a test server with VS 2012 and SQL 2012 installed, I have created an SSIS project in project deployment mode. In the packages of the project I use the Odata source for SSIS. The packages run fine in VS 2012. But when I deploy the package to the Integration
    Services catalog on the same server as where I am running VS 2012 I get a deployment error:
    ‘Failed to deploy project. For more information, query the operation_messages view for the operation identifier '25084'.  (Microsoft SQL Server, Error: 27203)'
    When I read this message from the SSISDB database, I see the problem with ODATA.
    use SSISDB
    go
    select * from catalog.operation_messages where operation_id = 25084
    --Failed to deploy the project. Fix the problems and try again later.:Unable to create the type with the name 'ODATA'.
    As I said: the packages with the Odata run without error when tested from within VS2012 on the SAME server. When I deploy the project from Visual Studio I get the error. 
    For completeness: I have also tried deployment from VS2012 to another server where the SSIS Odata source has bene deployed. Also to no avail.
    Jan D'Hondt - SQL server BI development

    The next possiblity for me was to convert the project to Package deployment and see what the result I get. I have converted my project with package connections from project deployment to Package deployment. Then I deployed the package on the server in MSDB
    catalog from SSIS. I.e. I connect with SSMS to Integration Services as an administrator and under the MSDB folder I added a new folder for my package. I then imported the dtsx into the mdsb package store. The Import worked. Still from within SSMS and connected
    to the Integration Services, i right-clicked on the package in the MSDB store and selected 'Run package'. In the Execute Package dialog window, I clicked on 'Execute' and the package actually ran. The Odata connector was opened, it read the data and imported
    into my database.
    This experience made me realize what the real culprit  was: The OData connector is a 32-bit connector in SQL Server 2012. 
    To prove this: with SSMS I connected to the SQL database server and in the Integration services catalog, i right-clicked on the package that was deployed in Project deployment mode, then selected 'Execute...'. In the execute dialog windo in the 'Advanced'
    tab I checked 32-bit runtime. And the package ran.
    To wrap it all up:
    The Project deployment will work, but not with the Odata source as project connection. The Odata connection must be defined in each package as a package connection.
    Run the deployed packages in 32-bit mode on the server
    Jan D'Hondt - SQL server BI development

  • At times, the type in the bookmarks toolbar as well as the tabs changes to white with a drop shadow on a white background, making it very difficult to read. I do not know what it causing the colors to change. Is there any way to fix this?

    At times, the type in the bookmarks toolbar as well as the tabs changes to white with a drop shadow on a white background, making it very difficult to read. I do not know what it causing the colors to change. Is there any way to fix this?

    quick test based on screendump from your picture
    1: hue & saturation : master sat -100
    2:levels : input white=67
    OK ?

  • Given a XSD, and a XPath- ways to find the type of the XPath leaf element

    Given a XSD, and an XPath (refering to an element in a XML document
    satifying that XSD), is there an utility which return the "type" of the given XPath
    element.
    One approach just to traverse the XSD tree, generated by the XSDBuilder,
    as per the elements specified in the XPath, until you find the type of the leaf
    element in the XPath.
    Is there an API/ utility which does this currently?
    Thanks
    PS:
    For example given an XSD :
    <element myTypeElem type="myType/>
    <complexType name="myType">
    <sequence>
    <element firstElem type="integer"/>
    <<element secondElem type="string"/>
    </sequence>
    </complexType>
    Then the type of XPath : /myTypeElem/firstElem ---> integer
    and type of XPath : /myTypeElem/secondElem ---> string

    Unfortunately,
    XPath is currently unaware of XML Schemas and as such cannot tell anything about the type of an element. XPath 2.0 is supposed to fix this in due time.
    Cheers.
    Rob

  • Creating a structure, knowing the name and the type of the components

    hi, following problem:
    i have uploaded an excel file from a different system with the information about the names and the types of the components of several structures.
    how can i create a structure with this informatin on my system?

    ok, i think i have to give you some more details:
    i want to update a table from a table saved on another system using a report.
    (only inserts are important, no updates)
    the problem is, that tables may not have the same components.
    therefore i have created several excel sheets with following content (using mehtod gui_download):
    name1      ; name2        ; name3....                 | name of the component
    typ1         ;  typ2           ; typ3 ...                     | type of the component
    content11 ;  content12   ; content13
    content21 ;  content22   ; content23
    uploading the file into table <uploadtable>
    now need dynamic structure:  let' s say dynamicwa
    name1   typ1
    name2   type2
    then: loop at <uploadtable> into dynamicwa.
                move-corresponding dynamicwa to destinationwa.
                insert destination_wa into destination_table.
            endloop.
    but how can i create this dynamicwa?
    Message was edited by: Michael
            Michael  Dirndorfer

  • The type of the value being assigned to variable ... differs from the current variable type

    I am trying to load a variable on SSIS Execute SQL Task with a string value. I keep on getting an error message :-
    “The type of the value being assigned to variable “User::LegacyColumns” differs from the current variable type”.
    Below are the settings on my package:
    Execute SQL Task Result Set –
    Single Row
    Variable Data Type –
    String
    The data to be loaded on the variable is a single row shown below:
    FirstName,LastName,MiddleName,PatientType,Title
    Can someone kindly help me to solve this as I’m lost for ideas.
    Thanks,
    Mpumelelo

    Thank you Sorna. I think I have managed to solve it. After a long search I have found a solution which advises that I should use a Foreach Loop Container. The help is on this link:
    https://social.msdn.microsoft.com/Forums/en-US/f46dea91-c26b-4ffe-ab1c-ebeef57c90b6/error-0xc001f009-at-mypackage-the-type-of-the-value-being-assigned-to-variable?forum=sqlintegrationservices
    Mpumelelo

  • Why is the type in the navigation bars so tiny?

    The type in the menu bar and navigation bar is so small that I can't read it without bringing my face very close to the screen. I have tried increasing font size on "Options" but it just increases font sizes on the content of the page. The print in the navigation bar is little more than a blur. How do I change this?

    Try:
    *Theme Font & Size Changer: https://addons.mozilla.org/firefox/addon/theme-font-size-changer/

Maybe you are looking for

  • G4 Digital Audio has no  sound, screen, or chime on start-up!

    It was working just fine then out of the blue it smelled hot and shut down completely in a fraction of a second. I rebooted it and it started up normally until the blue loading line was about 1/2 inch and then it just shut down completely again. So I

  • What are the recovery files in the trash

    I like to keep the trach taken out and notice every now and then their has been something put in it that I did not move there.  It is a file called Recovery and has some sub folders in the main one and one of the documents seems to be witten in code.

  • Finder Screen sharing Unavailiable

    I have a Mac mini and right now I'm on a Macbook. When I go into Finder, I CAN see the Shared menu, that's not my problem, but what is unavailable is the option to Share Screen. While on the Macbook, I can see the option to Share Screen with my Mac m

  • Lion on MacMini server fails on mirrored drives

    Hello last year I bought an MacMini server (10.6). Which I installed with mirrored harddrives (2 partitions, one partition for OS and one for the ServiceData). Everything worked fine. Upgrading to Lion messed up the whole system so i decided to start

  • Use another partition for Home directory?

    I upgraded my Power Mac G5 to Leopard and it recognized that I use a separate partition for my home directory. My MacBook didn't have enough space on my system partition to upgrade, so I did a clean install. Now I'm stuck using a home directory on th