RMI call resets Windows error code?

I'm attempting to retrieve a Windows error code from a remote system, using a simple call to the Windows API function getLastError() which is wrapped inside a JNI function on the remote system. getLastError() returns the last error code set for a particular process/thread.
The problem is, it appears that simply making the remote function call clears the error value before it can be returned. I can confirm that the error value was set on the remote system by printing the Process/Thread ID and getLastError() value to a console window on the remote system when one of my remote methods is called with out-of-range data. If I attempt to retrieve the error code, the Process/Thread ID match but the error code is always 0. No other methods were called on the remote system in between the initial error-generating method and the method which returns the error code.
Note that using the same JNI function calls without RMI works fine - I can generate error codes and retrieve them just fine.
Any ideas? Thanks in advance!

You're assuming that no other system calls are
executed between the one that caused the error you are
interested in and your GetLastError(). RMI executes
system calls on its own behalf, both to return the
value from the previous computation that caused the
error and to dispatch the new call into the method
that does GetLastError(). This approach is never going
to work. Why can't you call GetLAstError() straight
after the error happens, in the same remote method?This is what I suspected is happening, and if true, then I will simply have to rewrite my RMI method calls. Currently, they return -1 on error, and the error number is retrieved with a separate getLastError() call. This is done for legacy reasons (I'm calling C functions which were originally developed without Java/RMI in mind). As suggested, I'll have to call getLastError() immediately after an error occurs, and return the negative value of the error code rather than just -1. I've got about 200 remote methods to modify, so I was trying to avoid this, but hey... it's mostly search/replace.
Thanks for the help.

Similar Messages

  • TS1717 When I try and start iTunes after trying to intall the 11.4 update on my Windows 7 laptop, it says to reinstall iTunes and "Windows Error Code 193" I tried ave the same failed response. Can someone help?

    When I try and start iTunes after trying to intall the 11.4 update on my Windows 7 laptop, it says to reinstall iTunes and "Windows Error Code 193" I tried ave the same failed response. Can someone help?

    Hi inharmony35,
    If you are having issues with iTunes after an attempted update, you may want to try the steps in the following articles:
    Apple Support: Removing and reinstalling iTunes and other software components for Windows Vista, Windows 7, or Windows 8
    http://support.apple.com/kb/HT1923
    Apple Support: Issues installing iTunes or QuickTime for Windows
    http://support.apple.com/kb/HT1926
    Regards,
    - Brenden

  • Hi- I applied the iTunes up to my Windows 7 86bit PC last Wednesday and iTunes will not load due to a Runtime error r6034Access to C Runtime Library Incorrectly. Then I get an windows error code 1114. I have tried rollling back and reinstalling but no joy

    Hi- I applied the iTunes up to my Windows 7 86bit PC last Wednesday and iTunes will not load due to a Runtime error r6034Access to C Runtime Library Incorrectly. Then I get an windows error code 1114. I have tried rollling back and reinstalling but no joy

    Hi Keen itunes User,
    Thanks for using Apple Support Communities.  This article has steps you can take for the error you're seeing:
    iTunes 11.1.4 for Windows: Unable to install or open
    http://support.apple.com/kb/TS5376
    Cheers,
    - Ari

  • Error in application accurred please call support quoting error code 2907

    error in application accurred please call support quoting error code 2907

    I suggest you call support and quote error code 2907. 

  • Dear Sir, i have problem in my Iphone 5 that during receiving any calls always appeare message that error in application occurred please call support quoting error code 2907. I need to solve my problem

    Dear Sir, i have problem in my Iphone 5 that during receiving any calls always appeare message that error in application occurred please call support quoting error code 2907. I need to solve my problem.

    The problem this message always appeare when receiving the calls and requesting either accept or cancel.
    Can you advice me if i have wrong application or i need to remove some applications.

  • Error code 2 windows error code 2

    I updated my iphone yesterday to the newest os so I had to update my ITunes as well. In doing so I was left with error code 7 Windows error code 127. I looked through the forums and did what was said. I removed iTunes, bonjour, apple support, apple app support, etc. and now when I reinstall it I get error code 2 Windows error code 2. not really sure what to do now because uninstalling it and reinstalling is not working.

    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down page in case one of them applies.
    Your library should be unaffected by these steps but there is backup and recovery advice elsewhere in the user tip.
    The section Install missing components has advice on breaking down the iTunes installer into the individual .msi files which might prove useful if one component, such as Bonjour, won't install normally.
    tt2

  • What is this? Performance Counter OS (pdh) call failed with error code PDH_INVALID_HANDLE._

    hi    This event is logged in SharePoint 2010 logs often please help trace the issue also it precedes with Project server WCF code execution which alos is quite slow in execution, means PWA site runing slow. why does status read
    provisioning while i am not running anything.
    please help!!!
    10/03/2011 14:39:23.46 w3wp.exe (0x306C)                      
    0x2FC4
    SharePoint Foundation         Topology                      
    e5mc Medium  
    WcfSendRequest: RemoteAddress: 'http://moss:32843/a667a0a96d314e5e9e6c8fe4866c5db4/PSI/PWA.svc' Channel: 'Microsoft.Office.Project.Server.Interfaces.IPWA' Action: 'http://schemas.microsoft.com/office/project/server/webservices/PWA/AdminReadSiteMapTyped'
    MessageId: 'urn:uuid:0751dbdd-76c0-4410-ac73-2f1782e1513b'
    91b87b3b-e9ad-43b9-9e8c-e553ba7e2f6c
    10/03/2011 14:39:23.46 w3wp.exe (0x1B58)                      
    0x1BA0
    SharePoint Foundation         Topology                      
    e5mb Medium  
    WcfReceiveRequest: LocalAddress: 'http://moss.ccl.local:32843/a247f7273c09486999c9f111798cab59/ProfilePropertyService.svc' Channel: 'System.ServiceModel.Channels.ServiceChannel' Action: 'http://Microsoft.Office.Server.UserProfiles/GetProfileProperties'
    MessageId: 'urn:uuid:772a5c58-c0e4-4b0f-9142-f634fee413a9'
    3cd5bfa5-2e40-458e-9718-788887b44dbe
    10/03/2011 14:39:23.46 w3wp.exe (0x1B58)                      
    0x1BA0
    SharePoint Foundation         Monitoring                    
    nasq Medium  
    Entering monitored scope (ExecuteWcfServerOperation)
    3cd5bfa5-2e40-458e-9718-788887b44dbe
    10/03/2011 14:39:23.64 w3wp.exe (0x1B58)                      
    0x1BA0
    SharePoint Foundation         Monitoring                    
    b4ly Medium  
    Leaving Monitored Scope (ExecuteWcfServerOperation). Execution Time=179.589584709789
    3cd5bfa5-2e40-458e-9718-788887b44dbe
    10/03/2011 14:39:23.64 w3wp.exe (0x306C)                      
    0x3170
    SharePoint Foundation         Monitoring                    
    b4ly High    
    Leaving Monitored Scope (ExecuteWcfOperation:http://Microsoft.Office.Server.UserProfiles/GetProfileProperties). Execution Time=205.109867315539
    10/03/2011 14:39:23.64 w3wp.exe (0x306C)                      
    0x3170
    SharePoint Foundation         Monitoring                    
    b4ly High    
    Leaving Monitored Scope (ExecuteOnChannel:GetProfileProperties). Execution Time=206.500546857212
    10/03/2011 14:39:23.74 Microsoft.Office.Project.Server (0x0DAC)
    0x0FA8 Project Server                
    Provisioning                  
    8zdn Medium  
    [SERVICE] ProjectQueueService14: Getting list of Sites for ServiceApp: a667a0a9-6d31-4e5e-9e6c-8fe4866c5db4
    10/03/2011 14:39:23.74 Microsoft.Office.Project.Server (0x0DAC)
    0x0FA8 Project Server                
    Provisioning                  
    128v Medium  
    [SERVICE] ProjectQueueService14: Adding Site: ef3acaf4-3e7a-4819-80e0-8e7a85ca417b to sitelist for ServiceApp: a667a0a9-6d31-4e5e-9e6c-8fe4866c5db4
    10/03/2011 14:39:23.77 Microsoft.Office.Project.Server (0x0CD4)
    0x0FA4 Project Server                
    Provisioning                  
    8zdn Medium  
    [SERVICE] ProjectEventService14: Getting list of Sites for ServiceApp: a667a0a9-6d31-4e5e-9e6c-8fe4866c5db4
    10/03/2011 14:39:23.77 Microsoft.Office.Project.Server (0x0CD4)
    0x0FA4 Project Server                
    Provisioning                  
    128v Medium  
    [SERVICE] ProjectEventService14: Adding Site: ef3acaf4-3e7a-4819-80e0-8e7a85ca417b to sitelist for ServiceApp: a667a0a9-6d31-4e5e-9e6c-8fe4866c5db4
    10/03/2011 14:39:23.99 SPUCHostService.exe (0x22E0)            
    0x300C SharePoint Foundation        
    General                      
    84yj Medium  
    Performance Counter OS (pdh) call failed with error code PDH_INVALID_HANDLE.
    10/03/2011 14:39:23.99 SPUCHostService.exe (0x22E0)            
    0x300C SharePoint Foundation        
    Sandboxed Code Service        
    ei0p Monitorable
    - Unhandled exception System.ComponentModel.Win32Exception: Unknown error (0xc0000bbc)     at Microsoft.SharePoint.Win32.SPPdh.CheckReturnValue(PDH_STATUS status, Boolean throwOnError)     at Microsoft.SharePoint.Utilities.SPPerformanceCounter.NextValue(Int32
    retry, Int32 retryInterval)     at Microsoft.SharePoint.UserCode.SPUserCodePerformanceCounterHelper..ctor(String processName, Int32 processInstanceId) thrown while reading perf counters for process "SPUCWorkerProcess".
    10/03/2011 14:39:23.99 SPUCHostService.exe (0x22E0)            
    0x300C SharePoint Foundation        
    General                      
    84yj Medium  
    Performance Counter OS (pdh) call failed with error code PDH_INVALID_HANDLE.
    10/03/2011 14:39:23.99 SPUCHostService.exe (0x22E0)            
    0x300C SharePoint Foundation        
    Sandboxed Code Service        
    ei0p Monitorable
    - Unhandled exception System.ComponentModel.Win32Exception: Unknown error (0xc0000bbc)     at Microsoft.SharePoint.Win32.SPPdh.CheckReturnValue(PDH_STATUS status, Boolean throwOnError)     at Microsoft.SharePoint.Utilities.SPPerformanceCounter.NextValue(Int32
    retry, Int32 retryInterval)     at Microsoft.SharePoint.UserCode.SPUserCodePerformanceCounterHelper..ctor(String processName, Int32 processInstanceId) thrown while reading perf counters for process "SPUCWorkerProcess".
    10/03/2011 14:39:23.99 SPUCHostService.exe (0x22E0)            
    0x300C SharePoint Foundation        
    General                      
    84yj Medium  
    Performance Counter OS (pdh) call failed with error code PDH_INVALID_HANDLE.

    Hi there,
    A quick search showed the result on fourm thread:
    It's related to SHarePoint foundation error & this issue occurs when the account under which SPUserCodeService is configured to run does not have the necessary permissions to access the performance counters on the server.
    http://social.technet.microsoft.com/Forums/eu/sharepoint2010setup/thread/9fbcf2a3-1b1f-4fd8-a9b4-dc63ed753973
    To read in support article.
    http://support.microsoft.com/kb/983081Thanks, Amit Khare |EPM Consultant| Blog: http://amitkhare82.blogspot.com http://www.linkedin.com/in/amitkhare82

  • Windows error code 14

    Sadly When i try to use spotify since after the update .. which seem to be faulty on my endso i close the progamand get installing spotifybut than the Error 14 pops up The intsller is unable to intall spotify because the files to write are in use by another process. Please make sure spoitify is not running and retry. (Error code 14)  so after bringing up task manager and check for any running spotify apps expept for the intaller and find none..  i hit retry Were it just hangs ... until a reset and it loops al over againis there a way to disable the update ?   

    ERROR 14 FILES IN USE.. this bug is now over 2 years old and still we ave having to do geeky maunal workarounds in windows 7 I have had to manually intervene with 1.01, all the way through to  1.06 and today once more for 1.07 Will spotify ever be arsed to write an updater that just works, and that does not run from appdata or from appdata local, or will we all be on windows 19 before that happens? My current fix is to look for whatever the latset installer is called & for wheretis currently hidden ( the last couple have been hidden in an update sub folder of appdata local spotiy ), and COPY that file to desktop. BEFORE clicking " just restart spotify" and watiching it bomb out with error 14. then kill the failed update with task manager and run the installer from desktop, which then usually works. why we have to go through this rigmarole when any other software on the planet is able to instll updates in windwos 7 sensibly and reliably is beyond me .  could we at least , for variety, have a meaningful error message to entertain ourselves , as that one is just a lie. looking in windows ask manager after 1=error 14 has appeared can proves that no other spotiy processes are runnign and yet RETRY will just cause install to installer to infinitely hang until euthanised. NB the days whtn the installer was always called spotify_new.exe and lived in appdata/spotify are gone. Now each version's installer has a cryptic nom-de-jour,  and a new hiding place in local appdata  , for added hide n seek fun

  • Windows error code -42110

    I just upgraded iTunes software.
    When launching the iTunes version 11.0.2.26 I get a Windows unkown error code :  -42110.
    Anyone who knows about this? Impact and solution? Thanks

    Hello Guys, this upgrade seemngly also killed my iPod Classic 160GB... Both my iPad and iPod were connected to my Windows 7 Home PC. After the iTunes upgrade the same unknown error popped up, immediatel after came something like a "corrupted device". My iPod tried to restart, and seems to be in an infinite restarting loop...the apple logo is on for minutes, then a loud "click" from the HD and it starts again. Nothing helps (middle button+menu reset). Do you have any ideas? Thanks

  • I can't install Itunes 11.1.2 on Windows, Error Code 2324

    I connected my iPhone 4S to my Windows 7 Computer to synch my music. My older iTunes said that i have to update to 11.1.2. So i tried to update it with the apple software updater 4 times, but it did not work. i also tried to load the files only and then install it. It says to me that there is an error code 2324. I am very frustrated, please help me.
    Taxla

    Let's try the fixit from the following Microsoft document with that one:
    Fix problems with programs that can't be installed or uninstalled

  • Windows error code 0xc0000034

    Recently, when I switch on my laptop, this error code appear 0xc0000034.
    My question is, why Windows can fail? I keep my Windows updated, installed anti-virus, scan my laptop every week, de-fragment my hard disk every fortnight.
    Some say my hard disk may have problem, but it is okay. Then I try to repair using Windows Repair Environment. It did the trick but I have no idea how it's fixed.
    Any of you facing the same problem? I search the internet and there appears a lot of people facing this issue. If it is a common problem, why Microsoft fail to fix it?
    Thank goodness my laptop is recoverable, if not, imagine the time I lost just to do a fresh installation to my laptop and copy all my backup.
    Chiyawa

    Solved - for the record - followed the directions in this link:
    http://pcsupport.about.com/od/fixtheproblem/ht/reb​uild-bcd-store-windows.htm

  • My Satellite C wont load Windows - error code 0xcoooooe9

    Hi,
    get a status error come up when the laptop is turned on. The error code is 0xcoooooe9, windows does not load up and the diagnostics tool does not work.
    Tried to recover to factory settings but this crashed out saying partition could not be created and only had an option to turn the laptop off.
    Was bought from argos's ebay store less than 12 months ago and should still be under warranty but can not find out if it is on here.
    Any help please ??
    Message was edited by: MasterG

    On this virtual way it is not easy to say what the problem is but maybe HDD make problems.
    I recommend you to contact nearest Toshiba service provider and ask for help. They can check it.
    At first clarify the warranty and I hope they will fix it for free.
    Phone numbers and addresses you can find on http://www.toshiba.eu/innovation/generic/ASP_SUPPORT/

  • Windows error code 0x800f0922

    I want to install .net framework but i keep getting the same error code. How do i fix it? I've also tried it by the windows feature on and off, same thing, How do i fix this? Need some help....

    Im having the same problem, when i tryed to install Telnet Client using Programs and Features...

  • GetPrinter() call fails with error code 124

    Hi all,
    I am researching whether I can use the Winspool API to print to a printer using the printer's IP address.  So far, I have not had any luck.
    Hopefully, someone can help me understand why I am receiving a 124 error code, or, let me know if what I want to do is possible.
    Any help is appreciated.
    Thanks!
    This is the error I get from GetLastError() after calling GetPrinter() to get the size needed to declare the PRINTER_INFO_2 structure:
    An unexpected error occurred when executing the test.
    Error Code = 124.
    Error Message = The system call level is not correct.
    This is the test code I am using in my research.  OpenPrinter() always succeeds, but, GetPrinter() always fails.
    // Header File
    #include "stdafx.h"
    #include <WinSpool.h>
    void GetPrinterInfoTest(CString printerName);
    void GetFormattedSystemErrorMessage(DWORD errorCode, CString& errorMessage);
    // CPP File
    using namespace std;
    int _tmain(int argc, _TCHAR* argv[])
        UNREFERENCED_PARAMETER(argc);
        UNREFERENCED_PARAMETER(argv);
        GetPrinterInfoTest("\\\\xx.xxx.xx.xx");  // Note: please replace the formatted string with the printer IP address
        return 0;
    void GetPrinterInfoTest(CString printerName)
        HANDLE hPrinter = NULL;
        int length = printerName.GetLength();
        LPTSTR printerNameBuffer = printerName.GetBuffer(length);
        ::OpenPrinter(printerNameBuffer, &hPrinter, NULL);
        DWORD cbNeeded = 0;
        if (!::GetPrinter(hPrinter, 2, NULL, 0, &cbNeeded)) 
            CString errorMessage;
            GetFormattedSystemErrorMessage(::GetLastError(), errorMessage);
            CString testResultMessage;
            testResultMessage.Format("An unexpected error occurred when executing the test. \n%s", errorMessage);
            cout << testResultMessage;
    void GetFormattedSystemErrorMessage(DWORD errorCode, CString& errorMessage)
        // Get system error and convert to message
        LPVOID lpMsgBuf = NULL;
        ::FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
                            NULL,
                            errorCode,
                            MAKELANGID( LANG_NEUTRAL, SUBLANG_DEFAULT ), // Default language
                            (LPTSTR) &lpMsgBuf,
                            0,
                            NULL );
        // Copy to CString to avoid memory leak
        CString formattedMessage( (LPTSTR)lpMsgBuf );
        ::LocalFree( lpMsgBuf );
        errorMessage.Format("Error Code = %lu.  \nError Message = %s",
            errorCode,
            formattedMessage);

    Hi Rupesh, Shu,
    Thank you for taking the time to help me with my questions.  :-)
    Rupesh: Regarding my call to GetPrinter():
      DWORD cbNeeded = 0;
        if (!::GetPrinter(hPrinter, 2, NULL, 0, &cbNeeded)) 
    As I stated before in my first post:
    This is the error I get from GetLastError() after calling GetPrinter() to get the size needed to declare the PRINTER_INFO_2 structure:
    An unexpected error occurred when executing the test.
    Error Code = 124.
    Error Message = The system call level is not correct.
    So, this call I am making to GetPrinter() is not retrieving information about the printer yet.  It is only performed to get the buffer size needed for my subsequent call to GetPrinter().
    Shu: the reason why I pass in NULL into GetPrinter() is because I haven't declared the PRINTER_2_INFO buffer yet.  Once I get the required buffer size from GetPrinter(), I will declare the PRINTER_INFO_2 buffer, and then pass that into
    a second call to GetPrinter() to get detailed information about my printer.

  • The AcquireConnection method call failed with error code 0xC0202009.

    I've seen the previous threads on this (although maybe not all of them). However, i don't think I'm getting the error for the same reason. The full error I'm getting is:
    - Pre-execute (Error)
    Messages
    Error 0xc0202009: {F1B3B35C-FAE3-48F6-A169-4E4D8D99F9B6}: An OLE DB error has occurred. Error code: 0x80004005.
    An OLE DB record is available.  Source: "Microsoft JET Database Engine"  Hresult: 0x80004005  Description: "Unspecified error".
     (SQL Server Import and Export Wizard)
    Error 0xc020801c: Data Flow Task: The AcquireConnection method call to the connection manager "DestinationConnectionExcel" failed with error code 0xC0202009.
     (SQL Server Import and Export Wizard)
    Error 0xc004701a: Data Flow Task: component "Destination 64 - production_effectivities" (7042) failed the pre-execute phase and returned error code 0xC020801C.
     (SQL Server Import and Export Wizard)
    The entire package is running on one machine. The data source is SQL Server 2005 and the destination (this happens with both of them) is Excel or Access. Either way I cannot get the package which the wizard generated to run at all. This error occurs after the first table is exported. I'm running on WinXP SP2 with 2005 Developer and ALL components installed except analysis services.
    Anyone else have this problem or know the solution?
    Jeff

    I am getting the same error. My Destination and source both are on SQL Server 2005 on the same box.
    I am using SQL- Code for Source and and table as destination. When the package runnes under Transaction- TransactionOption-Supported then the packages excuted fine but it fails when i change the Transaction- TransactionOption to Required.
    It fails with following error code.
    [OLE DB Destination [22]] Error: The AcquireConnection method call to the connection manager "FMFCLSQADB01.DWH_Rakesh" failed with error code 0xC0202009.
    [DTS.Pipeline] Error: component "OLE DB Destination" (22) failed the pre-execute phase and returned error code 0xC020801C.
    [Connection manager "FMFCLSQADB01.DWH_Rakesh"] Error: The SSIS Runtime has failed to enlist the OLE DB connection in a distributed transaction with error 0x8004D00A "Unable to enlist in the transaction.".
    [Connection manager "FMFCLSQADB01.DWH_Rakesh"] Error: An OLE DB error has occurred. Error code: 0x8004D00A.
    When i change the source SQL query to Table or View then it works fine.
    Thanks for any suggestion.
    Regards
    Rakesh
    Now, my issues related to “SSIS Runtime has failed to enlist the OLE DB connection in a distributed transaction with error 0x8004D00A "Unable to enlist in the transaction."…..”. are fixed.
    This is one of the very common errors that comes up in SSIS (SQL Server Integration service) 
    I have faced this issue for at-least two occasions. Both of them have one common setting: “TransactionOption” was set to “Required”.
    In first case, I had multiple dataflow tasks but there were no sequence given. There were no error if I ran the package with TransactionOption=Supported. But when I ran the package in TransactionOption= Required, it got failed.
    To fix the issue I have changed my package and put the entire dataflow task one after another (connected thru Constraint).  
    In another case, where I was doing data transfer from one server to another, I had to configure the MSDTC.

Maybe you are looking for

  • 101 error - file is downloaded, i see it on my pc but can not open it

    Please, do not send me to this link ; http://helpx.adobe.com/creative-suite/kb/troubleshoot-download-assistant.html as it does not answer any question. I downloaded via assistant the program, Photoshop cs6, I even found it on my computer, not in prog

  • DOWN PAYMENT AMOUNT FIELD NEEDS TO BE NOT MODIFIABLE IN PAYMENT REQUEST

    Hi In SAP, when Down Payment is called through Payment Request, the "amount" field will be changeable mode. My client requirement is that, the amount field should be in "not modifiable" status. Is there anyway that we can do this...using EXIT or some

  • Problu00E8me calling sendmail under windows

    Hello, <br> when i use send mail from OS it works but when i create RFC and i call it from it, it gives me time out error with the bellow trace file content :<br><br> Trace file opened at 20100127 015854 Romance Standar, REL 46D,0,2257, VER 3 MT-SL<b

  • Re: customer service number???

    Agree....very frustrating and this is the most unbelievable BS service to date. You can even do online chat unless you are a premium. I paid for a skype in number and pay for call credit yet you can get any help. SUCKS big time. I paid for our skype

  • Ad hoc distribution / .mobileprovision error...?

    Using the Ad hoc distribution / .mobileprovision capability (with the test users required UDID already added to our Apple Dev account) our test user is dragging the .mobileprovision file onto his iPad listed in iTunes but is getting this error messag