Sabeer, Please always copy the [EMAIL PROTECTED] Sayan ________________________________
From: Sabeer Mohammad [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 19, 2007 2:17 AM To: Saha Sayandeb-G19428 Subject: java source code. sayandeb, While running my java application(ex.java) i got few error messages.please find the source code and logfile here. Note:- Java application communicating to ex.c through JNI. libex.so consits of ex.o as well as libSaCkpt.so and libncs_core.so Exectution Steps: 1.javac ex.java 2.javah -jni ex 3.gcc -c -fPIC -I/usr/local/jdk/include/-I/usr/local/linux ex.c 4.gcc -shared -o libex.so ex.o 5.java ex. Thanks sabeer -----Original Message----- From: Mathivanan Np-G19859 [mailto:[EMAIL PROTECTED] Sent: Tue 12/18/2007 4:40 PM To: Sabeer Mohammad; [email protected] Subject: RE: [Users] cpsv initialization problem Sabeer, Could you see the Checkpoint Agent logs i.e. CPA**.log. Ideally this error should not come. But, in some cases when the agent library is not initialized properly this error might come in which case an error is printed in the stdout itself. Do you see any significant error message in the CPA log file? Rgds, Mathivanan. ________________________________ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sabeer Mohammad Sent: Monday, December 17, 2007 4:59 PM To: [email protected] Subject: [Users] cpsv initialization problem Hi, The problem I have come across with is whenever I am trying to use the cpsv service in my application the rc=SaCkptinitialize() function is returning a value 2, but it is supposed to return 1 in order to initialize the cpsv service. Any idea to resolve this issue??? Regards, Sabeer Suvra SASKEN BUSINESS DISCLAIMER ------------------------- This message may contain confidential, proprietary or legally privileged information. In case you are not the original intended Recipient of the message, you must not, directly or indirectly, use, Disclose, distribute, print, or copy any part of this message and you are requested to delete it and inform the sender. Any views expressed in this message are those of the individual sender unless otherwise stated. Nothing contained in this message shall be construed as an offer or acceptance of any offer by Sasken Communication Technologies Limited ("Sasken") unless sent with that express intent and with due authority of Sasken. Sasken has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email SASKEN BUSINESS DISCLAIMER ------------------------- This message may contain confidential, proprietary or legally privileged information. In case you are not the original intended Recipient of the message, you must not, directly or indirectly, use, Disclose, distribute, print, or copy any part of this message and you are requested to delete it and inform the sender. Any views expressed in this message are those of the individual sender unless otherwise stated. Nothing contained in this message shall be construed as an offer or acceptance of any offer by Sasken Communication Technologies Limited ("Sasken") unless sent with that express intent and with due authority of Sasken. Sasken has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email
ex.c
Description: ex.c
class ex
{
public native void open();
static
{
System.loadLibrary("ex");
// System.loadLibrary("cpsv_common");
// System.loadLibrary("saf_common");
// System.loadLibrary("ncs_core");
// System.loadLibrary("SaCkpt");
}
public static void main(String args[])
{
ex e1=new ex();
e1.open();
}
}
*********************** F I L E H E A D E R ************************** ** Logging Type = Service per Node File ** Creation Time = 19 December 2007 11:03:16 ** Node ID = 0x0002020f ** Service Name = cpa ************************************************************************ NOTICE : 0x0002020f 929398711 43 1 CPA: 19Dec2007_11.03.16.893 : Processing Success: Lib Init : ./cpa_init.c:198 NOTICE : 0x0002020f 929398707 43 1 CPA: 19Dec2007_11.03.17.008 : Processing Success: Lib Init : ./cpa_init.c:198 NOTICE : 0x0002020f 929398707 43 1 CPA: 19Dec2007_11.03.17.074 : API Processing Success : CkptInit : ./cpa_api.c:278 : 1 : 1.000000 NOTICE : 0x0002020f 929398707 43 1 CPA: 19Dec2007_11.03.17.103 : API Processing Success : CkptOpen : ./cpa_api.c:848 : 1.000000 : 134637652.000000 : 1.000000 ERROR : 0x0002020f 929398707 43 1 CPA: 19Dec2007_11.03.17.113 : API Processing Failed : CkptRead : ./cpa_api.c:3850 : 12 : 134637652.000000
#include <stdio.h>
#include "/home/apacha/IBM/opensaf/include/saCkpt.h"
#include "/home/apacha/IBM/opensaf/include/saAis.h"
#include "/home/apacha/IBM/opensaf/include/ncsgl_defs.h"
#include "/home/apacha/IBM/opensaf/include/os_defs.h"
#include "/home/apacha/IBM/opensaf/include/ncs_osprm.h"
#include "/home/apacha/IBM/opensaf/include/ncssysf_def.h"
#include "/home/apacha/IBM/opensaf/include/ncssysf_tsk.h"
void AppCkptOpenCallback(SaInvocationT invocation, SaCkptCheckpointHandleT checkpointHandle, SaAisErrorT error)
{
if (error != SA_AIS_OK)
{
m_NCS_CONS_PRINTF("Checkpoint Open Async callback unsuccessful\n");
return;
}
else
{
m_NCS_CONS_PRINTF("Checkpoint Open Async callback success and ckpt_hdl %llu \n",checkpointHandle);
return;
}
}
void AppCkptSyncCallback(SaInvocationT invocation, SaAisErrorT error)
{
if (error != SA_AIS_OK)
{
printf("Checkpoint Sync Callback unsuccessful\n");
return;
}
else
{
printf("Checkpoint Sync Callback success\n");
return;
}
}
int main() {
SaCkptHandleT ckptHandle;
SaCkptCheckpointHandleT checkpointHandle;
SaCkptCallbacksT callbk;
SaVersionT version;
SaNameT ckptName;
SaCkptCheckpointCreationAttributesT ckptCreateAttr;
SaCkptCheckpointOpenFlagsT ckptOpenFlags;
SaCkptSectionCreationAttributesT sectionCreationAttributes;
SaCkptIOVectorElementT writeVector, readVector;
SaUint32T erroneousVectorIndex;
void *intialData = "Default data";
uns8 read_buff[100]={0};
SaTimeT timeout = 100000000;
m_NCS_MEMSET(&ckptName, 0, sizeof(ckptName));
ckptName.length= 7;
m_NCS_MEMCPY(ckptName.value, "Test-c", 7);
version.releaseCode = 'B';
version.majorVersion = 1;
version.minorVersion = 1;
void *initialData = "a";
callbk.saCkptCheckpointOpenCallback = AppCkptOpenCallback;
callbk.saCkptCheckpointSynchronizeCallback = AppCkptSyncCallback;
SaAisErrorT rc;
m_NCS_TASK_SLEEP(1000);
printf("\n");
printf(" ########################################\n");
printf(" # #\n");
printf(" # Test-Application -Check Point - read #\n");
printf(" # #\n");
printf(" ########################################\n");
printf("\n");
// FOR INTIALIZATION OF PROCESS
printf("--> Initializing the check point process = ");
rc = saCkptInitialize(&ckptHandle,&callbk,&version);
if (rc == SA_AIS_OK)
printf("PASSED\n");
else
printf("FAILED\n");
//FOR CHECK POINT OPEN
ckptCreateAttr.creationFlags = SA_CKPT_CHECKPOINT_COLLOCATED|SA_CKPT_WR_ACTIVE_REPLICA;
ckptCreateAttr.checkpointSize = 1024;
ckptCreateAttr.retentionDuration= 100000;
ckptCreateAttr.maxSections= 2;
ckptCreateAttr.maxSectionSize = 700;
ckptCreateAttr.maxSectionIdSize = 4;
ckptOpenFlags = SA_CKPT_CHECKPOINT_CREATE|SA_CKPT_CHECKPOINT_READ|SA_CKPT_CHECKPOINT_WRITE;
printf("--> Initializing the check point Open = ");
// m_NCS_TASK_SLEEP(1000);
rc = saCkptCheckpointOpen(ckptHandle, &ckptName, &ckptCreateAttr, ckptOpenFlags, timeout, &checkpointHandle);
if (rc == SA_AIS_OK)
printf("PASSED\n");
else
printf("FAILED\n");
//FOR CHECK POINT READ
m_NCS_TASK_SLEEP(4000);
readVector.sectionId.id = "11";
readVector.sectionId.idLen = 2;
readVector.dataBuffer = read_buff;
readVector.dataSize = 90;
readVector.dataOffset=0;
printf("--> Initializing the check point Read = ");
rc = saCkptCheckpointRead(checkpointHandle,&readVector,1,&erroneousVectorIndex);
if(rc == SA_AIS_OK)
printf("PASSED \n");
else
printf("FAILED \n");
printf("\n\t --> Data in buffer: %s\n\n ",(char *)readVector.dataBuffer);
// m_NCS_TASK_SLEEP(1000);
printf("--> Initializing Check point Synchronize = ");
rc = saCkptCheckpointSynchronize(checkpointHandle,timeout);
if(rc == SA_AIS_OK)
printf("PASSED \n");
else
printf("FAILED \n");
printf("--> Initializing check point Close = ");
rc = saCkptCheckpointClose(checkpointHandle);
if(rc == SA_AIS_OK)
printf("PASSED \n");
else
printf("FAILED \n");
printf("--> Initializing Finalize = ");
rc = saCkptFinalize(ckptHandle);
if(rc == SA_AIS_OK)
printf("PASSED \n");
else
printf("FAILED \n");
m_NCS_TASK_SLEEP(1000);
#ifdef DEBUG
printf("\n");
printf("--> Application Stopped Gracefully\n\n");
#endif
return 0;
}
ex.h
Description: ex.h
libex.so
Description: libex.so
_______________________________________________ Users mailing list [email protected] http://list.opensaf.org/maillist/listinfo/users
