cancel
Showing results for 
Search instead for 
Did you mean: 

EXCEPTION_ACCESS_VIOLATION... what is this?

Former Member
0 Kudos

Hello, I have a problem, which i have no idea what happened. It seems like a JCo problem, but i'm not really sure. Trying a simple code, getting a connection and the following code excerpt before disconnecting.

[code]

Function create_emp = <ClassFunction>.createFunction("BAPI_INTCONTROL_CREATE", <Repository>);

if(create_emp!=null){

ParameterList pl = create_emp.getImportParameterList();

System.out.println("pl is: "+pl);

pl.setValue("10000001","EMPLOYEENUMBER");

pl.setValue(Date.valueOf("2000-01-01"),"VALIDITYBEGIN");

pl.setValue(Date.valueOf("2040-12-31"),"VALIDITYEND");

pl.setValue("licenceno20charaters","LICENSEPLATENO");

pl.setValue("123456","BUILDINGNUMBER");

pl.setValue("123456","ROOMNUMBER");

pl.setValue("12345","INHOUSETELNO1");

pl.setValue("12345","INHOUSETELNO2");

pl.setValue("T","NOCOMMIT");

create_emp.setTableParameterList(pl);

<Client>.execute(create_emp);

<Client>.execute(<ClassFunction>.createFunction("BAPI_TRANSACTION_COMMIT", <Repository>));

} else{

System.out.println("Function failed.");

}

[/code]

The following was obtained when run:

[code]

An unexpected exception has been detected in native code outside the VM.

Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x18279CC9

Function=Java_com_sap_mw_jco_rfc_MiddlewareRFC_00024Server_nativeListen+0x57BB

Library=C:\jco\sapjcorfc.dll

Current Java thread:

at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeExecute(Native Method)

at com.sap.mw.jco.rfc.MiddlewareRFC$Client.execute(MiddlewareRFC.java:1112)

at com.sap.mw.jco.JCO$Client.execute(JCO.java:3510)

at com.sap.mw.jco.JCO$Client.execute(JCO.java:3065)

at CreateEmpTest.main(CreateEmpTest.java:31)

...

[/code]

there is also a list of dll files, which i will ommit, unless it is necessary that i post it.

Message was edited by: Eugene Phang

Accepted Solutions (0)

Answers (1)

Answers (1)

Benny
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

this is either a bug in your dll files (please check versions) or something wrong in your request (which I doubt, as there should be at least an acceptable error returned.)

Regards,

Benny

Former Member
0 Kudos

thank you benny.

the problem is, i have limited experience with SAP, and i have sent requests that do nothing (it seems) but do not return errors.

i have tried updating tables using BAPIs, which the java code runs and disconnects in the end with no problem, but calling the table up sees no added entry.

i'll check the dlls and see..

Benny
Product and Topic Expert
Product and Topic Expert
0 Kudos

To do this you also better check for the Commit Bapi, as this may be the reason for not seeing entries: Bapis (at least most of them)need to be committed...

Regards,

Benny

Former Member
0 Kudos

yes. i'm calling a BAPI function, setting the needed import parameters, and then executing it.

after that i call BAPI_TRANSACTION_COMMIT. i figure that B_T_COMMIT will commit executed stuff. not sure if that's right. but it still doesn't work.

i'm currently testing it out by trying to change an employee's maritial status. called ENQUE to lock the account, BAPI_PERSDATA_CHANGE, set some values, execute B_P_CHANGE. then i call B_T_COMMIT.

code runs fine.. no errors. but checking the married value from SAP GUI shows not changed. i checked the values and made sure they're right. only thins to wonder is, if there is a need to set the value every single import param, or just the important ones..

Former Member
0 Kudos

Hi,

1. Are you checking the RETURN-values of the bapi calls? You'll get an exception on really severe errors only (communication, system error e.g. short dump in R/3 and some more). The message(s) in the return will tell you, if something and what is missing/wrong with the call.

2. Ensure to set the WAIT parameter in B_T_COMMIT to 'X' or it will always return silently and OK.

3. Another possibility to check the call is testing it in SE37 using the same parameters.

Hope that helps.

Regards

Stefan

Former Member
0 Kudos

1. as in the export params? or tables? (from se37)

2. i've read about this somewhere, but it does nothing whether i set it or not. something is wrong somewhere?

3. how does one test a function from se37? i'll be looking into sap help, but thought i'd place the question forward to save time, so ignore this if it can be found in help. now, i'm only using it as a reference for import and export params..

Former Member
0 Kudos

> 1. as in the export params? or tables? (from se37)

It should be in the TABLES, since you can get more than one return value (Structure is BAPI_RETURN).

> 2. i've read about this somewhere, but it does

> nothing whether i set it or not. something is wrong

> somewhere?

There's definitely a difference, if you set it, since it does a "COMMIT WORK AND WAIT" when set.

> 3. how does one test a function from se37? i'll be

> looking into sap help, but thought i'd place the

> question forward to save time, so ignore this if it

> can be found in help. now, i'm only using it as a

> reference for import and export params..

Specify the name of the BAPI in SE37 and press F8.

Regards

Stefan

Former Member
0 Kudos

thx stefan,

i got the error message out. turns out that RETURN is actually in Export param structure BAPIRETURN. and must explicit call the MESSAGE value.

the problem is related to validity date. i've been "forced" to hardcode the validity date (begin and end) to get values from BAPI__GET... now, the same values to not fork for BAPI_*_CHANGE. anyway i can get this validity date? what exactly is it?

thx again

Former Member
0 Kudos

Hi,

please refer to the BAPI-documentation, there should be explained if there's a possibility to get these dates from somewhere else.

Hope that helps

Regards

Stefan

Former Member
0 Kudos

i am looking at the documentation from the documentation tab in the BAPI Explorer in the SAP GUI. the documentation seems poor to me. or maybe i'm not looking at the right place?

Former Member
0 Kudos

Hi, i see this error but in another place, and the solution was change the value of the buffer memory, look at this value in the Java VM.

good luck!