Can't use RemoteException.getCause() instanceof MyException !!

Hi there, please help me out on this one, I just can't figure out the problem!
I have a swing client and a Session EJB that will throw a DataNotFoundException (subclass of EJBException) if the supplied id was not found in the database:
And as the EJBException is a RuntimeException, it will be autowrapped in RemoteException by the EJB container. Now, on the client we use RemoteException.getCause() to get this DataNotFoundException. getCause returns a Throwable (highest in hierarchy). Now, shouldn't I be able to use instanceof DataNotFoundException?? I mean, it is indeed an exception of this type! But the comparison gives FALSE! However, using (...instanceof Throwable) gives TRUE, as does comparing with Exception!
Anyone knows why I don't get true on (re.getCause() instanceof DataNotFoundException) ??
I'd be very pleased if someone knows the answer!!
Best regards,
AC
(I posted this question on SUN/java language forum too, but got no answers yet!)
try{
filmEJB.insertOrder(orderVO,number);
}catch(RemoteException re){
if (re.getCause() instanceof DataNotFoundException)//returns false!!!
System.out.println("CAUGHT DataNotFoundException");
re.printStackTrace();
//etc, etc

Hi,
Is DataNotFoundException is your own exception class defined!
If so try using the initCause() in your constructor to propagate the exception's cause!
Cheers,
Dwaraka.

Similar Messages

  • Can i use SAX,DOM or JDOM within JAX-RPC ?

    Dear all,
    Im trying to create a web service , with methods that recive Element parameters (which i changed to strings) , and then parsing my xml node and returning objects. Im facing this error while creating the web service files: "java.loang.StackTraceElement does not have a public accessible empty constructor" .... This error appears with using one of the XML parsers ... an example of one method:
    public QuizInfo readXmlFile(int id, String clientId, String distId) throws RemoteException,org.jdom.JDOMException, Exception
          QuizInfo QuizObj = new QuizInfo();
           SAXBuilder builder = new SAXBuilder();
           Document doc = builder.build(new File( "c:quiz.xml"));
           Element firstNode = doc.getRootElement();
    .....can I use any xml parser within a method that i will use in my JAX-RPC web service ? and if , can anyone show me how ?
    thanx in advance

    Dear all ..... I found it !!!
    first of all , make sure that all the names of your methods used in your web service begins with a small letter !! thats one ... another thing is that i made another class that only calls the methods of the original class with the implementation , example of what im saying , remember the readXmlFile in the original class ... ok .. make another class, lets say its called CallServiceClass , with a method that calls the readXmlFile method in the originalService
    public QuizInfo readXmlFile(int id, String clientId, String distId) throws Exception{
              return originalService.readXmlFile( id,  clientId,  distId);
         }and then create the web service from the new class CallServiceClass !
    note that i threw an Exception , not a JDomException ... also note that for some IDEs , it will require that the method is a static method.

  • Can we use IF statement in PDF templates

    Hi,
    I developed a PDF template. I need to underline ang bold the records based on a specific condition. Can we use IF conditon in PDF templates. Please suggest.
    Thanks...

    Billy  Verreynne  wrote:
    The case syntax is a bit funny though as there's not a single condition evaluation (like a DECODE or case structs from some other languages).
    This is what I would expect a typical case struct to look like - evaluating a single condition:
    case <condition>
    when <value-1> then return <result-1>
    when <value-n> then return <result-n>
    else
    return <return-z>
    end
    ?:| You mean like this...?
    SQL> ed
    Wrote file afiedt.buf
      1  select empno, ename, deptno
      2        ,case deptno
      3           when 10 then 'This is Department 10'
      4           when 20 then 'And department 20'
      5           when 30 then 'And of course department 30'
      6         else
      7           'Blimey it is something else!'
      8         end as dept_desc
      9* from emp
    SQL> /
         EMPNO ENAME          DEPTNO DEPT_DESC
          7369 SMITH              20 And department 20
          7499 ALLEN              30 And of course department 30
          7521 WARD               30 And of course department 30
          7566 JONES              20 And department 20
          7654 MARTIN             30 And of course department 30
          7698 BLAKE              30 And of course department 30
          7782 CLARK              10 This is Department 10
          7788 SCOTT              20 And department 20
          7839 KING               10 This is Department 10
          7844 TURNER             30 And of course department 30
          7876 ADAMS              20 And department 20
          7900 JAMES              30 And of course department 30
          7902 FORD               20 And department 20
          7934 MILLER             10 This is Department 10
    14 rows selected.

  • In alv report can i use control break events? if no .whay?

    Hi all,
    in alv report can i use control break events? if no .whay?

    hi,
    you can use control break statements in ALV report.
    for example: if one PO is having more than one line item, that time you need to display PO only once.

  • HT1751 I need to uninstall and reinstall iTunes (it won't let me update). So, how do I copy or back up my iTunes library of over 1,500 songs? Can I use a Flash Drive to do so?

    I need to uninstall and reinstall iTunes (it won't let me update). I have IE 8 on Windows XP, and iTunes 10 something. In my Program files list I see iTunes and iTunes (2) and even iPod and iPod (2) where a tech had to back up and do this for me before. I'm just trying to fix it all. I keep getting the "The feature you are trying to use is on a network resource that is unavailable. Click OK to try again, or enter an alternate path to a folder containing the installation package 'iTunes.msi' in the box below." I can even run a search and find the folder, but it gives me the same error message. I was planning on using the Microsoft Fix-It tool  to help uninstall then Reinstall iTunes. But I need to backup my library. So, how do I copy or back up my iTunes library of over 1,500 songs? Can I copy the folder to desktop or can I use a Flash Drive to backup my music? I don't want to do anything until I know for sure how I can backup my songs, and then reinstall them into iTunes. Thanks for any help.

    Ok, thanks that helps. I don't have an external hard drive though. What about backing up through 'the cloud'? I'm just wondering since my husband syncs his iPod to the PC through iTunes and he's worried that he will lose all the songs on his iPod if the library is lost from iTunes and he tries to 'sync' it up again. I'm not exactly sure how to  'copy the entire iTunes folder' either. I kinda suck at this unless I have step by step instructions, which I haven't found yet on iTunes help or other sources.
    The only way I know how to back anything up is by going back to a restore point, etc. (as stated before, we don't have an external hard drive.)
    Thanks for the info.

  • How can I use 2 Apple IDs in Itunes? I have 2 IOS Devices. They each have there own AppleID. What is the proper way to sync both of them to Itunes?

    How can I use 2 Apple IDs in Itunes? I have 2 IOS Devices. They each have there own AppleID. What is the proper way to sync both of them to Itunes? I wanted my teenager's AppleID to be different from mine so that she couldn't charge stuff to my AppleID, therefore I created me another one. Now when I go to Sync either device, it tells me that this IOS device can only be synced with one AppleID. Then I get a message to erase it, not going to do that, lol. If I logout as one ID and login as the other, will it still retain all synced information on the PC from the first IOS device? If I can just log in out of the AppleID, then I have no problem doing that as long as the synced apps, music, etc stays there for both. I am not trying to copy from one to the other, just want to make sure I have a backup for the UhOh times. If logging in and out on the same PC of multiple AppleIDs is acceptible then I need to be able to authorize the PC for both devices. Thanks for the help. I am new to the iOS world.

    "Method Three
    Create a separate iTunes library for each device. Note:It is important that you make a new iTunes Library file. Do not justmake a copy of your existing iTunes Library file. If iTunes is open,quit it.
    This one may work. I searched and searched on the website for something like this, I guess I just didn't search correctly, lol. I will give this a try later. My daughter is not be back for a few weekends, therefore I will have to try the Method 3 when she comes back for the weekend again. "
    I forgot to mention that she has a PC at her house that she also syncs to. Would this cause a problem. I am already getting that pop up saying that the iPod is synced to another library (even though she is signed in with her Apple ID to iTunes) and gives the pop up to Cancel, Erase & Sync, or Transfer Purchases. My question arose because she clicked on "Erase & Sync" by mistake when she plugged the iPod to her PC the first time. When the iPod was purchased and setup, it was synced to my PC first. When she went home, she hooked it up to her PC and then she erased it by accident. I was able to restore all the missing stuff yesterday using my PC. However, even after doing that it still told me the next time I hooked it up last night that the iPod was currently synced with a different library. Hopefully, you can help me understand all this. She wants to sync her iPod and also backup her iPod at both places. Both PCs have been authorised. Thanks

  • Can I Use iTunes Store without Storing Bank Accounts, etc, in my Profile?

    Hi
    Today a fraudulent charge of $89.99 appeared on my iTunes account. This suggests that a hacker has obtained my password, and hence access to all information in my iTunes account, including credit card or Paypal account information. I can deal with having to claim refunds for fraudulent iTunes purchases, but I cannot afford to risk ID Theft, or to have my back account information in the possession of hackers.
    (1) Is it possible to maintain an iTunes account that does not store bank accounts, and ideally stores no personal information other than my email address?
    (2) If I can do this, I assume I'd then have to enter that information for each purchase. Will this information be expunged once the ourchase is complete? Or would it remain on the system in some form, accessible to hackers?
    (3) If (1) is not possible, how do I cancel my iTunes account? There does not seem to be such an option on the iTunes Account Management screens.
    Thanks,
    Chris

    You can remove your credit card from your account. Go into the account, click "Edit payment information" and you will see the option under credit card to click "None."
    For purchasing, you can either enter the card info per transaction, or you can start using iTunes gift cards which are readily available.

  • How can I use apps downloaded by different users on the same iPad?

    I have a 'work' iPad so the apps on it have been downloaded using two different accounts. Which was fine until I did an update at the weekend and suddenly I can only use the one's I downloaded. Is there anyway of 'sharing' these apps so who logs in can use all the apps?

    No, I don't think there is. As far as I know the iPad is meant to be a 'one per Apple ID' device...and isn't really meant to have multiple Apple ID's  downloading apps to a singular device.
    I think the simplest way around your issue is to use only one Apple ID to download everything.

  • Can i use 2 ipad's on the same itunes account with different apple accounts?

    Both me and partner have an ipad 4. Though we only have one computer, can we use the same itunes but with different apple acount without any issues? We use some of the same apps, but my partner plays fx Baldus Gate and is worries that save files will be corrupted.

    Each iPad should be linked to its owner's personal, private and nonshared AppleID. In the Mac, each one should have a different login account so each has their own iTunes Library containing your iPad's details. When you use iTunes on the Mac, since each logs in with a different login and corresponding Home directory, iTunes picks up the correct AppleID.

  • How can i use my account without the billing info, as i do not have a credit card. and my shipping and billing info is under US. i'm in singapore. how do i change this?

    how can i use my account without the billing info, as i do not have a credit card. and my shipping and billing info is under US. i'm in singapore. how do i change this?

    If you are just visiting Singapore, then leave the account as it is. If you have moved there, then view your account using the iTunes app on a Mac or PC and change the country/region to your current location and address. If you do not have a bank card, you can fund your account using iTunes gift cards if available in Singapore.

  • How many computers can I use my account on

    I have just started a 6 month contracting role as an in house designer.  Can I use my account at this new premisis while still using it at home for my home business?

    Hi All,
    One Creative Cloud Subscription entitles you to install on two computers.
    Can I use the software I download from Creative Cloud on multiple computers?Yes, you can install and activate Creative Cloud desktop applications on two computers, regardless of operating system, for the individual associated with the Creative Cloud membership. See the product license agreements page for more information.
    The above excerpt is from link: 
    http://www.adobe.com/products/creativecloud/faq.html
    You can go through various information regarding the Creative Cloud from this link.
    Regards,
    Rajshree

  • How can I use one background jpeg in my ebook without a large file size

    I'm guessing that by simply adding a background image or watermark by default adds a separate copy to each page. Since I am intending for them to be the same on all pages except for the title page, how do I shrink the final file size of my PDF eBooks so that the image is stored once but shown on all pages?
    Thanks in advance.

    Thank you, I understand, yeah, I knew that, my phone is factory unlocked and I am going home, which is obviously not in the States and I am thinking of buying a local carrier there. However, I still have 2 weeks before I leave and cannnot wait to start using my Iphone 4. I thought at least I could use the mp3 player function. So as far as I understand, I cannot activate it without a sim card. I have been using metropcs for about two years and it does not have a sim card. In this case, do I really not have another choice but wait for two weeks to listen to music? My Mp3 player just failed me and I really need to listen to music but on the other hand, while I can use my iphone as an mp3 player in two weeks, I don't want to spend more money on a new one. So, do you have another suggestion? For instance, can I use a friend's sim card to activate mine? Would this cause any trouble, when I go home and buy a local carrier? I think these questions might kinda sound weird to you, but first time with an Iphone, extremely excited to start using under my circumstances, I need help   thanks,

  • How can I use one photo twice in a slideshow

    I am in iPhoto '11 9.4.3 making a slideshow to send to iDVD for my mother-in-laws funeral next Wednesday.
    How can I use this one particular photo of her several times in the slide show.
    I have tried copy/past and that does not seem to work.
    Thanx in advance

    I would just duplicate the picture several times and keep inserting duplicates ...

  • How can i use microsoft word on ipad 2

    how can i use the microsoft application on my ipad 2?

    The Pages app is also compatible with MS Word. Unlike some of the others mentioned, the document is actually stored on the iPad as opposed to 'the clouds'. Again, most of those mentioned are cut down versions of MS Word.
    Stand back and look at this constructively; do you need to regularly access to the document from more than one computer/device without the need to keep amending your document on your computer and sending it to your iPad? If so, Documente to Go etc may be the best choice.

  • How can I use the credit on my account instead of credit card to buy apps?

    I have a gift card credit on my account but when I want to buy an app it takes me to my credit card details. How can I use my credit on my account instead of credit card?

    You shouldn't have to put in a credit card, no, but from time to time the iTunes Store seems for some reason to try to insist on one. If just confirming your mailing address doesn't stop it from complaining, go here:
    http://www.apple.com/support/itunes/contact/
    and follow the instructions to report the issue to the iTunes Store.
    Regards.

Maybe you are looking for

  • Automatic PO with versioning

    Hello all,             I want to create a PO and its GR automatically at time of invoice receipt.             The problem is that we have activated versioning in our system.             My question is: Is there a way to create a PO automatically in t

  • Apple Wireless Keyboard 'o' key not working

    I have recently acquired a pre-owned wireless keyboard which was working fine until a few days ago. Now the 'o' key has stopped working and some keys do not work with the left shift key - they work fine with the right-shift key and other keys work wi

  • On my windows xp i cannot open my itunes at all

    So I just recently bought a Windows XP computer.  I've heard that they don't quite sync with everything now, but I thought I'd be able to still use my itunes.  I had it working before and I was in the middle of downloading music from my iPhone to my

  • Terminated by signal SIGSEGV (Address boundary error)

    Hi, I was doing a bit of multitasking, and the kernel ran out of SWAP and crashed. After reboot everything is borked. Every program I had open prior to crash wont start or crashes soon after opening. (Chromium, Clementine, Terminal, Smuxi, VMware...)

  • Temporary Blocking of Texts and Messages

    I used to be able to temporarily block texts and messages from my iphone. I went to block a number today and now I get the description of the service with the ending "Not available for this cell phone number". There is a blue question mark at the end