Error when I use JNI

Hi
I�m developming a wrapper in C because I need to call C�methods of the scanner�drivers
but when I run the java�code (the java�code call a JNI function that call the scanner drivers in C)
I get the following error:
C:\Documents and Settings\yamilet\Mis documentos\pruebaJNI\Scanner\escaner>java
Scanner
Valor devuelto por la funcion Open: 0
# An unexpected error has been detected by HotSpot Virtual Machine:
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x02ca55ea, pid=2692, tid=4092
# Java VM: Java HotSpot(TM) Client VM (1.5.0_02-b09 mixed mode, sharing)
# Problematic frame:
# C [LS100.dll+0x55ea]
# An error report file with more information is saved as hs_err_pid2692.log
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
Anybody have any idea about this error?
Please help me
Thank for advance

The problem occurs the same way with or without breakpoints (MessageBoxes) in my code. Without any message boxes in the application, the values sent are retrieved, processed and the result sent back by the native method before the error shows up. I even do a println in the Java code of the result sent back before the error shows up.
It appears that it is something about the creation of the COM component that is causing the JRE to fail. Interestingly, I have been running this appliction (same client code making use of COM components) for some time now using a C++ front end to pass the data with absolutely no problem. The only difference now is that I am using a Java front end and passing the data using JNI. As I wrote earlier, I have used the -Xcheck:jni option with no error reported. I have even use JRE 6 with the
-XX:-RelaxAccessControlCheck option. That does not help.

Similar Messages

  • I am getting a error IO when trying to upload multiple images within wordpress using the flash uploader. I do not get the error when uploading using explorer. The error only appears if I try uploading using firefox....any ideas?

    I am getting a error IO when trying to upload multiple images within wordpress using the flash uploader. I do not get the error when uploading using explorer. The error only appears if I try uploading using firefox....any ideas?

    Logged the call with SAP who directed me to 'Define settings for attachments' in IMG and setting the 'Deactivate Java Applet' & 'Deactivate Attachment versioning' checkboxes - problem solved.

  • Getting errors when iam using  BAPI_PO_CREATE1 for Purchase Order creation

    Hi sap Gurus,
      I am getting Errors when iam using  BAPI_PO_CREATE1 for Purchase Order creation that Material (144) does not exist but it is alreardy maintained in MM01.
    I dont get how it is coming.and what are the mandatory fields in bapi BAPI_PO_CREATE1 in item level .that is too material only.
    pls let me know .
    thanks in advance.

    Hi,
    Check the sample code..
    report  zpo_test             .
    *DATA DECLARATION
    constants : c_x value 'X'.
    *Structures to hold PO header data
    data : header like bapimepoheader ,
    headerx like bapimepoheaderx .
    *Structures to hold PO account data
    data : account like bapimepoaccount occurs 0 with header line ,
    accountx like bapimepoaccountx occurs 0 with header line .
    *Internal Tables to hold PO ITEM DATA
    data : item like bapimepoitem occurs 0 with header line,
    itemx like bapimepoitemx occurs 0 with header line,
    *Internal table to hold messages from BAPI call
    return like bapiret2 occurs 0 with header line,
    *Internal table to hold messages from BAPI call
    pocontractlimits like bapiesucc occurs 0 with header line.
    data : w_header(40) value 'PO Header',
    purchaseorder like bapimepoheader-po_number,
    delivery_date like bapimeposchedule-delivery_date.
    data : ws_langu like sy-langu.
    *text-001 = 'PO Header' - define as text element
    selection-screen begin of block b1 with frame title text-001.
    parameters : company like header-comp_code default '122' ,
    doctyp like header-doc_type default 'NB' ,
    cdate like header-creat_date default sy-datum ,
    vendor like header-vendor default '2000000012' ,
    pur_org like header-purch_org default 'PU01' ,
    pur_grp like header-pur_group default '005' .
    *sociedad like HEADER-COMP_CODE default '122' ,
    *vendedor like HEADER-SALES_PERS default 'sale person'.
    selection-screen end of block b1.
    selection-screen begin of block b2 with frame title text-002.
    parameters : item_num like item-po_item default '00010',
    material like item-material default '12000000' ,
    tipo_imp like item-acctasscat default 'K' ,
    *pos_doc like ITEM-ITEM_CAT default 'F' ,
    shorttxt like item-short_text default 'PRUEBA BAPI' ,
    grup_art like item-matl_group default '817230000' ,
    plant like item-plant default '3001' ,
    mpe like item-trackingno default '9999' ,
    *contrato like ITEM-AGREEMENT default '4904000003' ,
    *quantity like ITEM-QUANTITY default 1 .
    po_unit like item-po_unit default 'EA'.
    selection-screen end of block b2.
    Par?mnetros de imputaci?n
    selection-screen begin of block b3 with frame title text-004.
    parameters : centro like account-costcenter default '1220813150',
    cuenta like account-gl_account default '6631400' ,
    num_pos like account-po_item default '10' ,
    serial like account-serial_no default '01' ,
    ind_imp like account-tax_code default 'I2' .
    selection-screen end of block b3.
    start-of-selection.
    *DATA POPULATION
      ws_langu = sy-langu. "Language variable
    *POPULATE HEADER DATA FOR PO
    *HEADER-COMP_CODE = sociedad .
      header-doc_type = doctyp .
      header-vendor = vendor .
      header-creat_date = cdate .
      header-created_by = 'TD17191' .
      header-purch_org = pur_org .
      header-pur_group = pur_grp .
      header-comp_code = company .
      header-langu = ws_langu .
    *HEADER-SALES_PERS = vendedor .
    *HEADER-CURRENCY = 'DOP' .
    *HEADER-ITEM_INTVL = 10 .
    *HEADER-PMNTTRMS = 'N30' .
    *HEADER-EXCH_RATE = 1 .
    *POPULATE HEADER FLAG.
      headerx-comp_code = c_x.
      headerx-doc_type = c_x.
      headerx-vendor = c_x.
      headerx-creat_date = c_x.
      headerx-created_by = c_x.
      headerx-purch_org = c_x.
      headerx-pur_group = c_x.
      headerx-langu = c_x.
    *HEADERX-sales_pers = c_x.
    *HEADERX-CURRENCY = c_x.
    *HEADER-ITEM_INTVL = c_x.
    *HEADER-PMNTTRMS = c_x.
    *HEADER-EXCH_RATE = c_x.
    *HEADER-EXCH_RATE = c_x.
    *POPULATE ITEM DATA.
      item-po_item = item_num.
      item-quantity = '1'.
    *ITEM-MATERIAL = material .
      item-short_text = 'prueba bapi_po_create1'.
    *ITEM-TAX_CODE = ''.
      item-acctasscat = 'K' .
    *ITEM-ITEM_CAT = 'D' .
      item-matl_group = '817230000' .
      item-plant = '3001' .
      item-trackingno = '99999'.
      item-preq_name = 'test'.
    *ITEM-AGREEMENT = '' .
    *ITEM-AGMT_ITEM = ''.
      item-quantity = '1' .
      item-po_unit = 'EA'.
    *ITEM-ORDERPR_UN = 'EA'.
      item-conv_num1 = '1'.
      item-conv_den1 = '1'.
      item-net_price = '1000000' .
      item-price_unit = '1'.
      item-gr_pr_time = '0'.
      item-prnt_price = 'X'.
      item-unlimited_dlv = 'X'.
      item-gr_ind = 'X' .
      item-ir_ind = 'X' .
      item-gr_basediv = 'X'.
    *ITEM-PCKG_NO = '' .
      append item. clear item.
    *POPULATE ITEM FLAG TABLE
      itemx-po_item = item_num.
      itemx-po_itemx = c_x.
    *ITEMX-MATERIAL = C_X.
      itemx-short_text = c_x.
      itemx-quantity = c_x.
    *ITEMX-TAX_CODE = C_X.
      itemx-acctasscat = c_x.
    *ITEMX-ITEM_CAT = c_x.
      itemx-matl_group = c_x.
      itemx-plant = c_x.
      itemx-trackingno = c_x.
      itemx-preq_name = c_x.
    *ITEMX-AGREEMENT = C_X.
    *ITEMX-AGMT_ITEM = c_x.
      itemx-stge_loc = c_x.
      itemx-quantity = c_x.
      itemx-po_unit = c_x.
    *ITEMX-ORDERPR_UN = C_X.
      itemx-conv_num1 = c_x.
      itemx-conv_den1 = c_x.
      itemx-net_price = c_x.
      itemx-price_unit = c_x.
      itemx-gr_pr_time = c_x.
      itemx-prnt_price = c_x.
      itemx-unlimited_dlv = c_x.
      itemx-gr_ind = c_x .
      itemx-ir_ind = c_x .
      itemx-gr_basediv = c_x .
      append itemx. clear itemx.
    *POPULATE ACCOUNT DATA.
      account-po_item = item_num.
      account-serial_no = serial .
      account-creat_date = sy-datum .
      account-costcenter = centro .
      account-gl_account = cuenta .
      account-gr_rcpt = 'tester'.
      append account. clear account.
    *POPULATE ACCOUNT FLAG TABLE.
      accountx-po_item = item_num .
      accountx-po_itemx = c_x .
      accountx-serial_no = serial .
      accountx-serial_nox = c_x .
      accountx-creat_date = c_x .
      accountx-costcenter = c_x .
      accountx-gl_account = c_x .
      account-gr_rcpt = c_x.
      append accountx. clear accountx.
    *BAPI CALL
      call function 'DIALOG_SET_NO_DIALOG'.
      call function 'BAPI_PO_CREATE1'
        exporting
          poheader         = header
          poheaderx        = headerx
        importing
          exppurchaseorder = purchaseorder
        tables
          return           = return
          poitem           = item
          poitemx          = itemx
          poaccount        = account
          poaccountx       = accountx.
    *Confirm the document creation by calling database COMMIT
      call function 'BAPI_TRANSACTION_COMMIT'
      exporting
      wait = 'X'
    IMPORTING
    RETURN =
    end-of-selection.
    *Output the messages returned from BAPI call
      loop at return.
        write / return-message.
      endloop.
    Regards
    Sudheer

  • Same thing is happening to me. Adobe has not responded to anyone about this error. It appears that Abobe XI is not compatible with IE 11.  I do not get this error when I use Chrome or Firefox. Only IE 11 does this. I have tried clearing cache and cookies.

    Same thing is happening to me. Adobe has not responded to anyone about this error. It appears that Abobe XI is not compatible with IE 11.  I do not get this error when I use Chrome or Firefox. Only IE 11 does this. I have tried clearing cache and cookies. I even uninstalled and re-installed IE 11. It is still doing it.  I am surprized that a company like Adobe would just ignore our posts and leave us hanging this this.
    Error message is FAILED TO GET DISPATCH FROM IBRWSR2.  Then when you click on it the next error message says:  PHTML IS NULL. You have to click this error message twice and then the PDF finally loads. Happened every time
    Does anyone have a solution since Adobe will not respond?
    As a last resort I will try uninstalling the Adobe Reader XI and install Adobe Reader 10 instead. It seems to work ok. But when I try to install version 10 the Adobe site tries to install XI.  Any ideas?
    JimP08758

    It worked just fine for me.
    Many site issues can be caused by corrupt cookies or cache.
    * Clear the Cache and
    * Remove Cookies '''''Warning ! ! '' This will log you out of sites you're logged in to.'''
    Type '''about:preferences'''<Enter> in the address bar.
    * '''Cookies;''' Select '''Privacy.''' Under '''History,''' select Firefox will '''Use Custom Settings.''' Press the button on the right side called '''Show Cookies.''' Use the search bar to look for the site. Note; There may be more than one entry. Remove '''All''' of them.
    * '''Cache;''' Select '''Advanced > Network.''' Across from '''Cached Web Content,''' Press '''Clear Now.'''
    If there is still a problem,
    '''[https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode Start Firefox in Safe Mode]''' {web link}
    While you are in safe mode;
    Type '''about:preferences#advanced'''<Enter> in the address bar.
    Under '''Advanced,''' Select '''General.'''
    Look for and turn off '''Use Hardware Acceleration'''.
    Poke around safe web sites. Are there any problems?
    Then restart.

  • Am getting error  error when am using  wm_concat funcation.

    hi all
    am getting error error when am using wm_concat funcation.
    SQL> DECLARE
    2 ex VARCHAR2(200);
    3 BEGIN
    4 SELECT wm_concat(ename) INTO EX FROM EMP WHERE deptno=30;
    5 DBMS_OUTPUT.PUT_LINE(EX);
    6 END;
    7
    8 .
    SQL>
    SQL> /
    DECLARE
    ERROR at line 1:
    ORA-06550: line 4, column 10:
    PL/SQL: ORA-00904: "WM_CONCAT": invalid identifier
    ORA-06550: line 4, column 3:
    PL/SQL: SQL Statement ignoredThanks for all in advance
    Edited by: maddy on 9 Jan, 2012 10:02 PM

    >
    WM_CONCAT is undocumented and unsupported by Oracle, meaning it should not be used in production systems.
    >
    so change your way
    btw
    for me
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    SQL> set serveroutput on
    SQL> DECLARE
      2   ex varchar2(200);
      3   BEGIN
      4   SELECT wm_concat(ename) INTO EX FROM EMP WHERE deptno=30;
      5   DBMS_OUTPUT.PUT_LINE(EX);
      6   END;
      7  /
    ALLEN,WARD,MARTIN,BLAKE,TURNER,JAMES
    PL/SQL procedure successfully completed.
    SQL> try wmsys.wm_concat

  • Guidelines for when to use JNI

    I didn't find an answer to this in any FAQ or the 2 JNI books I have, so apologies in advance if this is a common question whose answer has already been posted -
    Do any guidelines exist for when, and to what extent, JNI should be used?
    I'm currently working on my second project where the question of whether or not to use it has come up. Both projects were distributed and contained both C++ and Java code in different areas. The issue came up when the need arose to implement a new shared library that had to be used by both C++ and Java code. Logging and configuration services are examples of the new functionality.
    The choice is whether to implement the new libraries primarily in C++ and supply a Java interface, via JNI, for Java code which needs to use it, or to implement the new libraries in both C++ and Java to support both types of clients.
    On the previous project, a team member had extensive JNI experience and recommended the dual language implementation approach instead of JNI. This worked out ok except we did have to have to ensure the new library developer was skilled in both C++ and Java, and he had to be sure to update both when changes to 1 were necessary - a maintenance problem. The experienced JNI developer made this recommendation due to issues he had encountered previously - most notably issues related to errors in the native code which brought down the JVM.
    On the current project, we're opting for base C++ implementations with JNI wrappers. That's making me somewhat nervous since the alternative seems safer.
    What do other developers think?

    Have you checked out www.javaworld.com. They usually have very good and in-depth articles. IMHO, it all depends on the sort of use your library is intended for. If its used extensively by native code, use C++ with a Java wrapper. It its the other way around, implement it in Java and use a JNI interface for native code. I would really consider this carefully before implementing stuff in C++ that is used from Java. First of all, Java is after all much simpler than C++, its a more elgant OO-language and you have the platform neutrality. On the other hand, C++ has its sides. I dont use JNI unless its absolutely neccessary, in situations like using legacy code.
    These are just a few of my thoughts, hope it gives you some hints.

  • Sharepoint-Hosted App giving FORBIDDEN error when i use REST Api

    Hi,
    I have created a sharepoint hosted app which will create Team site on button click.
    I used REST Api  and  NAPA Tool to develop this app.
    Napa tool gives to things ClientWebpart.aspx and Default.aspx.
    When i run my Default.aspx code is working fine but ClientWebpart.aspx is giving FORBIDDEN error when i am trying to create site.
    Below is the code which i used to create site
    code:
    var hostweburl;
    var appweburl;
    $(document).ready(function () {
    hostweburl= decodeURIComponent(getQueryStringParameter("SPHostUrl"));
    appweburl = decodeURIComponent(getQueryStringParameter("SPAppWebUrl"));
    function createSPWeb() {
    $.ajax(
    url: appweburl +
    "/_api/SP.AppContextSite(@target)/web/webinfos/add?@target='" +
    hostweburl + "'",
    type: "POST",
    data: JSON.stringify(
    'parameters':
    '__metadata': { 'type': 'SP.WebInfoCreationInformation' },
    'Url': 'RestSubWeb',
    'Title': 'RestSubWeb',
    'Description': 'REST created web',
    'Language': 1033,
    'WebTemplate': 'sts#0',
    'UseUniquePermissions': false
    headers: {
    "accept": "application/json;odata=verbose",
    "content-type": "application/json;odata=verbose",
    "X-RequestDigest": $("#__REQUESTDIGEST").val()
    success: successHandler,
    error: errorHandler
    NOTE:This is on sharepoint online.
    Please help
    Regards,
    sudeep

    So in the app you are testing, are you using the FQDN or the NetBIOS name? Bad practice but could you test with both (hard code the absolute URL for testing purposes) then retest your app?
    If you are making a web part based on the new app model this will be an "app part" and probably have the same issues you are experiencing. If this is for something internal rather than a product you are developing to resell then the script editor /
    content editor web part approach could work for you.
    Paul
    Paul Mather | Twitter |
    http://pwmather.wordpress.com | CPS

  • Help!!!!!these is error when i use tcode mr21!!

    dear all:
    i have a problem when i use tcode mr21.
    i want to change the material's price by tcode mr21,when i pree save
    then the system  stop and tell me 'material cc001d000780 have actual or intending standard price'.
      what should i chech for this error?
    i need help !
    thank you a lot !
    best regards!

    Hello Zhao,
    If want to trying to change the material price through MR21 TCode the system will give the error or warning message which has been set in the Customizing.This you can Change and control throgh customizing through T code OKZZ.In this activity you have to give that whether the message as a Error or Information or a warning messgae.
    I thope your problem has been clear with this.Plz assign points.
    Thanx,
    Edu

  • Error : when i use transform

    The problem is still coming after doing an update to Oracle9i 9.2.0.2.0
    When i use transform method, It logs me out. if i do same transform using xmlspy it works.
    html := srcXml.transform(xslFile);
    return html.getclobval();
    where
    srcXml : select extract(value(x), xPath) into srcXml from tbl_main_xml x;
    xslFile : select xsldoc into xslFile from tbl_xsl
    where filename = xslFileName;
    How to open a tar to submit my xml and xsl files.
    Regards
    Error which is coming :
    SQL> select gethtml from dual;
    ERROR:
    ORA-03113: end-of-file on communication channel
    no rows selected

    Hi Mark
    I have opened a tar and submitted my xml and xsl files.
    TAR 2903047.995
    Can you pls have a look.
    Regards

  • CL_RSRD_PRODUCER_PRECALC Error when Printing using Info Broadcasting

    Hi,
    I get the following error when trying to print from the Portal using Information Broadcasting - CL_RSRD_PRODUCER_PRECALC, type PROD.  I am trying to print using PS or PCL not PDF.
    We are running SPS12.  The printer is setup in BW and tested.  All other connections between Portal and BW appear to be working.
    Any ideas?
    Thanks,

    Thanks,  but that note applies to Patch 8 and as mentioned we are running SPS12.
    Basically what happens is we get a blank browser window for some time then the error returns as mentioned in my original post.

  • Getting errors when iam using bapi ' BAPI_PO_CREATE1'

    Hi Sap Gurus,
    I need small info over bapi BAPI_PO_CREATE1.
    While creating Purchase orders using BAPI_PO_CREATE1 it is not allowing me to enter partner function details .I am getting below errors.
    i.e
    1)  it is not allowing to update partner function details.and iam not getting what excact bapi structure for partner function details.here i found 'BAPIEKKOP' in tables option.but these fields are not matching with ME21N screen partner function fields . I want to update PARTNER FUNTCION, PARTNER NAME, DEFALT PARTNER.in bapi structure BAPIEKKOP there is no DEFAULT PARTNER instead of this there is DELETION INDICATOR.
    Pls let me know the exact bapi structure and fields in BAPI.
    2). I am getting the below error when iam posting the Pur.Order
    i.e Item 10 Acct Assgt 1
    Account 460600 does not exist in chart of accounts CANO.
    what does it means? Evenif that Account is existed in chart of account CANO and Even i posted that PO, it showing like above.and iam getting all field in PO like CO area,COST center and G/L account for Account Assingment group 'K' .
    I could not understand why it is giving such type of errors.
    Pls let me know the anwsers for above errors .
    thanks in advance.

    Hi Sap Gurus,
    I need small info over bapi BAPI_PO_CREATE1.
    While creating Purchase orders using BAPI_PO_CREATE1 it is not allowing me to enter partner function details .I am getting below errors.
    i.e
    1)  it is not allowing to update partner function details.and iam not getting what excact bapi structure for partner function details.here i found 'BAPIEKKOP' in tables option.but these fields are not matching with ME21N screen partner function fields . I want to update PARTNER FUNTCION, PARTNER NAME, DEFALT PARTNER.in bapi structure BAPIEKKOP there is no DEFAULT PARTNER instead of this there is DELETION INDICATOR.
    Pls let me know the exact bapi structure and fields in BAPI.
    2). I am getting the below error when iam posting the Pur.Order
    i.e Item 10 Acct Assgt 1
    Account 460600 does not exist in chart of accounts CANO.
    what does it means? Evenif that Account is existed in chart of account CANO and Even i posted that PO, it showing like above.and iam getting all field in PO like CO area,COST center and G/L account for Account Assingment group 'K' .
    I could not understand why it is giving such type of errors.
    Pls let me know the anwsers for above errors .
    thanks in advance.

  • Error when transporting using CMS

    Hi,
    Please ssist.
    We are on PI 7.0 SP17. We want to transport using CMS from Dev box to Prod system. We get to export steps. Select Mode, able to go pass, Then Select Objects We select them and Click on Finish(at bottom of pop-up screen). "correct mark"Then We get Transport Using CMS. Trnsport request generated and released for transport using CMS, Shoose Tools-> System Messages to display result. Then after a few minutes the screen pops a long message.
    "Sent on 11/18/09 at 10:39 AM: CMS (server: http://server:port) cannot export the following transport lists: 
    Export list (send time = 11/18/09 10:39 AM, component = Default Software Component, ID = e10bf190d41d11dead8f00096bdd826a) 
    Details: com.sap.aii.util.misc.api.BaseRuntimeException: Reading GDI ... FAILED. Source is not well formed. SAXParseException at line -1, column -1. Details:
    Message: Generic Exception:
    Stacktrace: com.sap.engine.lib.xml.parser.NestedSAXParserException: Generic Exception: -> com.sap.aii.util.misc.api.BaseRuntimeException: Parsing generic data instance: begin of unexpected element "html"!"
    Regards
    Scharlotte

    Check if it is a password-related issu as mentioned here: Error when defining Xi-track in CMS
    Regards,
    Abhishek.

  • ORA 2005 error when you using ODBC driver of 10.2.0.3

    I am getting following error when connecting Oracle 10.2.0.3 to Oracle 11.1 database from a thrid part application:
    Issue Description. An application using Oracle ODBC driver version 10.2.0.3 to communicate with the Oracle database 11g tries to update the field “SOURCE_CODE” of LONG data type in table “SUBROUTINE” returns the following error.
    ORA-02005: Implict -1 length not valid for the bind or dfeine datatype.
    I updated my client to 10.2.0.4,, error is still present. Does any one know what patch to install to get rid of this error. I cannot modify the third party code.

    What are the system requirements (supported config) of 3rd party app?
    According to the 9.2 Error Messages document,
    >
    ORA-02005 implicit (-1) length not valid for this bind or define datatype
    Cause: A negative length for the define variable was passed to a define function.
    Action: An explicit, non-negative, length parameter must be passed.
    >
    Perhaps you should report this back to vendor as a bug.
    You could also turn on odbc tracing (driver/dsn config) to catch the cuplrit statement.

  • TS3297 Error when I use search function in itunes store and select an artist

    When I use search function in itunes store and select an artist I get this message. Microsoft visual C++ run time library. Prog C:\progfiles\itunes\itunes.exe  R6025 - Pure virtual function call .  It then shuts down itunes and cannot provide a solution.
    Have tried reinstalling itunes but it did not help.  Any other ideas?

    I have yet to find a solution, but as a work around, do not click or select any of the suggested results while you are typing in your search. Type in your search, and press enter.

  • Why native code outside the VM when I use JNI in web application?

    I have a web application by using JBOSS as the server in windows XP environment. I need to call native functions in my servletAction class to check some information. After I start JBOSS and WebServer(tomcat), it works well when I launch the web page to call that native funtions in the first a few times, but after a while when I reopen that page in IE to call native funtions it throws me an unexpected error and shut down the jboss automatically. Could know how to solve it? Thank you guys in advance!
    Error message:
    An unexpected exception has been detected in native code outside the VM.
    Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x63BA7AD
    Function=[Unknown.]
    Library=C:\WINDOWS\system32\HaspKeyDAO.dll
    NOTE: We are unable to locate the function name symbol for the error
    just occurred. Please refer to release documentation for possible
    reason and solutions.
    Current Java thread:
         at Key.readBlock(Native Method)     
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
         at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
         at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
         at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:113)
         at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:51)
         at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
         at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
         at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:283)
         at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:149)
         at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:128)
         at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
         at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
         at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
         at org.jboss.ejb.Container.invoke(Container.java:854)
         at sun.reflect.GeneratedMethodAccessor91.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
         at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:775)
         at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:382)
         at sun.reflect.GeneratedMethodAccessor90.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
         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:460)
         at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
         at java.lang.Thread.run(Thread.java:534)
    Dynamic libraries:
    0x00400000 - 0x0040B000      C:\j2sdk1.4.2_06\bin\java.exe
    0x7C900000 - 0x7C9B0000      C:\WINDOWS\system32\ntdll.dll
    0x7C800000 - 0x7C8F4000      C:\WINDOWS\system32\kernel32.dll
    0x77DD0000 - 0x77E6B000      C:\WINDOWS\system32\ADVAPI32.dll
    0x77E70000 - 0x77F01000      C:\WINDOWS\system32\RPCRT4.dll
    0x77C10000 - 0x77C68000      C:\WINDOWS\system32\MSVCRT.dll
    0x08000000 - 0x08139000      C:\j2sdk1.4.2_06\jre\bin\client\jvm.dll
    0x77D40000 - 0x77DD0000      C:\WINDOWS\system32\USER32.dll
    0x77F10000 - 0x77F56000      C:\WINDOWS\system32\GDI32.dll
    0x76B40000 - 0x76B6D000      C:\WINDOWS\system32\WINMM.dll
    0x10000000 - 0x10007000      C:\j2sdk1.4.2_06\jre\bin\hpi.dll
    0x00390000 - 0x0039E000      C:\j2sdk1.4.2_06\jre\bin\verify.dll
    0x003B0000 - 0x003C9000      C:\j2sdk1.4.2_06\jre\bin\java.dll
    0x003D0000 - 0x003DD000      C:\j2sdk1.4.2_06\jre\bin\zip.dll
    0x003E0000 - 0x003EF000      C:\j2sdk1.4.2_06\jre\bin\net.dll
    0x71AB0000 - 0x71AC7000      C:\WINDOWS\system32\WS2_32.dll
    0x71AA0000 - 0x71AA8000      C:\WINDOWS\system32\WS2HELP.dll
    0x71A50000 - 0x71A8F000      C:\WINDOWS\System32\mswsock.dll
    0x76F20000 - 0x76F47000      C:\WINDOWS\system32\DNSAPI.dll
    0x76FB0000 - 0x76FB8000      C:\WINDOWS\System32\winrnr.dll
    0x76F60000 - 0x76F8C000      C:\WINDOWS\system32\WLDAP32.dll
    0x03070000 - 0x030AC000      C:\Program Files\NewDotNet\newdotnet6_38.dll
    0x774E0000 - 0x7761D000      C:\WINDOWS\system32\ole32.dll
    0x77120000 - 0x771AC000      C:\WINDOWS\system32\OLEAUT32.dll
    0x77260000 - 0x772FE000      C:\WINDOWS\system32\urlmon.dll
    0x77F60000 - 0x77FD6000      C:\WINDOWS\system32\SHLWAPI.dll
    0x77C00000 - 0x77C08000      C:\WINDOWS\system32\VERSION.dll
    0x771B0000 - 0x77256000      C:\WINDOWS\system32\WININET.dll
    0x77A80000 - 0x77B14000      C:\WINDOWS\system32\CRYPT32.dll
    0x77B20000 - 0x77B32000      C:\WINDOWS\system32\MSASN1.dll
    0x77920000 - 0x77A13000      C:\WINDOWS\system32\SETUPAPI.dll
    0x71B20000 - 0x71B32000      C:\WINDOWS\system32\MPR.dll
    0x76C30000 - 0x76C5E000      C:\WINDOWS\system32\WINTRUST.dll
    0x76C90000 - 0x76CB8000      C:\WINDOWS\system32\IMAGEHLP.dll
    0x7C9C0000 - 0x7D1D4000      C:\WINDOWS\system32\SHELL32.dll
    0x773D0000 - 0x774D2000      C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll
    0x5D090000 - 0x5D127000      C:\WINDOWS\system32\comctl32.dll
    0x76FC0000 - 0x76FC6000      C:\WINDOWS\system32\rasadhlp.dll
    0x662B0000 - 0x66308000      C:\WINDOWS\system32\hnetcfg.dll
    0x71A90000 - 0x71A98000      C:\WINDOWS\System32\wshtcpip.dll
    0x042C0000 - 0x042C6000      C:\j2sdk1.4.2_06\jre\bin\ioser12.dll
    0x04410000 - 0x04418000      C:\j2sdk1.4.2_06\jre\bin\nio.dll
    0x046A0000 - 0x046A5000      C:\j2sdk1.4.2_06\jre\bin\rmi.dll
    0x047F0000 - 0x0490E000      C:\jboss-4.0.0-winsort\server\default\tmp\native\SharedLib\HaspKeyDAO.dll
    0x04A20000 - 0x04A73000      C:\jboss-4.0.0-winsort\server\default\tmp\native\msc\dll\haspms32.dll
    0x06390000 - 0x064AE000      C:\WINDOWS\system32\HaspKeyDAO.dll
    0x76F50000 - 0x76F58000      C:\WINDOWS\system32\wtsapi32.dll
    0x76360000 - 0x76370000      C:\WINDOWS\system32\WINSTA.dll
    0x5B860000 - 0x5B8B4000      C:\WINDOWS\system32\NETAPI32.dll
    0x59A60000 - 0x59B01000      C:\WINDOWS\system32\DBGHELP.dll
    0x76BF0000 - 0x76BFB000      C:\WINDOWS\system32\PSAPI.DLL
    Heap at VM Abort:
    Heap
    def new generation total 9216K, used 2204K [0x10010000, 0x10a00000, 0x12770000)
    eden space 8256K, 26% used [0x10010000, 0x102370e8, 0x10820000)
    from space 960K, 0% used [0x10820000, 0x10820000, 0x10910000)
    to space 960K, 0% used [0x10910000, 0x10910000, 0x10a00000)
    tenured generation total 121024K, used 39043K [0x12770000, 0x19da0000, 0x30010000)
    the space 121024K, 32% used [0x12770000, 0x14d90ec8, 0x14d91000, 0x19da0000)
    compacting perm gen total 23808K, used 23618K [0x30010000, 0x31750000, 0x34010000)
    the space 23808K, 99% used [0x30010000, 0x31720888, 0x31720a00, 0x31750000)
    Local Time = Thu May 26 11:34:39 2005
    Elapsed Time = 3209
    # The exception above was detected in native code outside the VM
    # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode)
    Following is what I am doing:
    I have a key.java file with several native functions.
    In key.cpp I defined the implementation of above functions then created dynamic link library file key.dll. I put the key.dll to WEB-INF/lib/key.dll.
    Then in a servlet Action class, I called new key().keyPresent and new key().readBlock(0, 8, block, p1,p1).
    Public class Key{
    public native int keyPresent(int password1, int password2);
    public native void readBlock(int startMemoryLocation, int size,
    byte[] block, int password1, int password2);
    static {
    System.loadLibrary("Key");
    //A Singleton Class
    private static Key key;
    private Key()
    public static Key getSingletonObject()
    if ( key== null)
    key = new Key();          
    return key;
    public Object clone()
         throws CloneNotSupportedException
    throw new CloneNotSupportedException();
    Key.cpp:
    #include <jni.h>
    #include "Key.h"
    #include <stdio.h>
    #include "hasp.h"
    #include <memory.h>
    JNIEXPORT jint JNICALL Java_Key_keyPresent
    (JNIEnv *env, jobject obj, jint pass1, jint pass2)
         try{
              int keyPresent = 0;
              int p1, p2, p3, p4;
              int seed = 100;
              int port = 0;
              p1 = p2 = p3 = p4 = 0;
              hasp(LOCALHASP_ISHASP, seed, port, 0, 0, &p1, &p2, &p3, &p4);
              if (p1 == 0) {
                   printf("\nNo Hasp exists. Program aborted.\n");
                   return -1;
              if (p3 == HASPERR_VERSION_MISMATCH) {
              printf("Old driver found - please update driver to actual version.\n");
              return 2;
              hasp(LOCALHASP_HASPSTATUS, seed, port, pass1, pass2, &p1, &p2, &p3, &p4);
              if (p3 == 0) {
                   return 4;
              hasp(LOCALHASP_HASPGENERATION, seed, port, pass1, pass2, &p1, &p2, &p3, &p4);
              if (p3) {
                   printf("Failed: haspKey password is not correct!");
                   return 4;
              } else {
                   switch (p1) {
                   case 0:
                   keyPresent = 3;
                                  break;
                   case 1:
                        keyPresent =1;
                        break;
              return keyPresent;
         }catch(...){
              return -999;
    * READBLOCK
    * reads a block of data from the HASP memory
    JNIEXPORT void JNICALL Java_Key_readBlock
    (JNIEnv *env, jobject obj, jint startMemoryLocation, jint nSize, jbyteArray pBlock, jint pass1, jint pass2)
         try{
              int     p1, p2, p3, p4;
              p1 = (startMemoryLocation+1)/2;
              p2 = nSize >> 1;
              jbyte *javablob = env->GetByteArrayElements(pBlock, 0);
              memset(javablob, 0, nSize);
              p4 = (int)javablob;
              int seed = 100;
              int port = 102;
              hasp(MEMOHASP_READBLOCK, seed, port, pass1, pass2, &p1, &p2, &p3, &p4);
              env->ReleaseByteArrayElements(pBlock, javablob, 0);
              if (p3) {
                   printf("Failed. Error number: %d.\n", p3);
              } else {
         }catch(...){
              printf("readBlock function failed");
    }

    the error happens in your native-code which runs outside the VM of course, since its native.
    You access some memory where you don't have rights to do so, in a normal win32-app you would get the "application crashed at 0xdeadbeef"-window, and since java cannon guarantee that your code did not destroy something it shuts down.
    I would try to debug my code withought java in a C++ IDE/Debugger.
    good luck, lg Clemens

Maybe you are looking for

  • How do you delete stuff and get your money back too?

    Does anybody know how to get your money back on your appleID account if you delete any music or apps or movies that i bought with a iTunes gift card that i bought with money on the card??  like how can i get it back on my account once i delete stuff

  • Number of transactions in the current batch input session ...

    Hi, How to control a Number of transactions in the current batch input session ... for LSMW. Pls help. I'm new to LSMW Thanks Ram

  • Message No.: GLT2201

    Hi I am getting an error while entering Amended Quantities in ARE-1 and ARE-3 documents. *Balancing field "profit centre" in the line item not filled", Message No.: GLT2201 Deipatch qty: 25 Amended Qty: 23 Differencial Qty: 2 Excise duty for differen

  • SAP Sd interview qns with answers

    Hi Guru's I have to appear for interview within 2-3 days. can somebody send me SAP SD interview questions with answers at my email address [email protected] to revise and prepare. Points will be rewarded. Thanks in advance Sheenam Gupta

  • ADS FP_test_00 test error

    Hi Guys I am getting this error when i run the FP_TEST_00 script ADS: SOAP Runtime Exception: CSoapExceptionTransport :(100101) I have followed all the processes in the guide and the RFC is running okay. The system is on AS/400 and the ADS services a