Problem in reading a string back which was stored using custom binding.

Hi All,
i use below codes to do custom binding
public class CSVRecord {    
private String key;
/** To keep how many values we have for a key.
* This is used to retrive values' element during constructing CSVRecord object back from stream.
private int valuesSize;
* to keep values for a key
private String[] values;
public CSVRecord()
public CSVRecord(String key, String[] values)
this.key = key;
this.values = values;
this.valuesSize = this.values.length;
public String getKey() {
return key;
public void setKey(String key) {
this.key = key;
public String[] getValues() {
return values;
public void setValues(String[] values) {
this.values = values;
public int getValuesSize() {
return valuesSize;
TupleBiniding code:
public class CSVRecordTupleBinding extends TupleBinding {
public void objectToEntry(Object object , TupleOutput tupleOutput)
CSVRecord record = (CSVRecord)object;
tupleOutput.writeString(record.getKey());
tupleOutput.writeInt(record.getValuesSize());
for(int i=0;i<record.getValuesSize();i++)
tupleOutput.writeString(record.getValues());
public Object entryToObject(TupleInput tupleInput) {
<font color="red"> String key = tupleInput.readString(); </font> <br>
int valuesSize = tupleInput.readInt();
String[] values = new String[valuesSize];
for(int i=0;i<valuesSize;i++)
values[i] = tupleInput.readString();
return new CSVRecord(key,values);
But when i reconstruct an object using cusom binding i face below exceptions
Caused by: java.lang.ArrayIndexOutOfBoundsException: 8
     at com.sleepycat.util.UtfOps.getZeroTerminatedByteLength(UtfOps.java:38)
     at com.sleepycat.bind.tuple.TupleInput.readString(TupleInput.java:150)
     at com.ml.odr.regression.comparison.CSVRecordTupleBinding.entryToObject(CSVRecordTupleBinding.java:30)
     at com.sleepycat.bind.tuple.TupleBinding.entryToObject(TupleBinding.java:73)
This is especially happens at the line where i read the key back.
could you please advise ?.
Thanks,
Srini

Hi Srini,
I don't see anything obviously wrong with the code you posted, except perhaps that the setter, setValues, does not update valuesSize -- you really don't need the valuesSize field, you can use the array length instead.
There must be something wrong elsewhere in your program. Please post a complete test program, that has a main() and can be run with only the JE jar file, that demonstrates the problem.
--mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • I lost my Iphone 3GS. My brother has given me his Iphone 4 now. We both use the same notebook to update and sync our phones. I would like to know how can i reconnect back to my account using the Iphone which was previous used by my brother.

    I lost my Iphone 3GS. My brother has given me his Iphone 4 now. We both use the same notebook to update and sync our phones. I would like to know how can i reconnect back to my account using the Iphone which was previous used by my brother.

    If you are saying that you both have iCloud accounts and use the same icloud ID, then yes, the contacts will be deleted.  The idea is that all devices using the same icloud ID are kept in sync.  You need to use different IDs.  You can keep the same iTunes ID so you can share the songs and apps.  But use different icloud IDs.

  • Does anybody know how I can get my Mac Book Pro back, which was stolen during a presentation I was attending. I have the store receipt, however I had not installed i Cloud in my mac Book?

    Does anybody know how I can get my Mac Book Pro back, which was stolen after a class I taught?
    I have the store receipt, its serial number, however I had not installed i Cloud on my Mac Book and I'm not able to find my Mac back.
    Thanks for helping me!

    Sorry to say but you are out of luck.
    What To Do If Your Mac Is Lost Or Stolen
    If you activated Find My Mac before it was lost or stolen, you can track it only if it is connected to the Internet by Wi-Fi. What you cannot do is track your computer using a serial number or other identifying number. You cannot expect Apple or anyone else to find your computer for you. You cannot recover your loss unless you insure your device for such loss. It is not covered by your warranty. Be sure to report the loss or theft to the local police. Have the serial number handy. If your Mac is found it cannot be returned to you if you don’t have the serial number and proof of purchase.
    Find My Mac can be used from Find My Phone at iCloud.com and via Find My Phone on your iDevice.
          The following is third-party anti-theft software:
               1.  STEM 2.1
               2.  MacPhoneHome 3.5
               3.  MacTrack 7.5.0
               4.  VUWER 1.7
               5.  Sneaky Bastar* 0.2.0
               6.  Undercover 5.1.1
               7.  LoJack for Laptops
               8. Hidden 2.0
               9. Prey 0.6.2

  • A module reported an error 0x80004005 from call back which was running as part of rule

    Hi 
    a module reported an error 0x80004005 from call back which was running as part of rule. with event id 4503this error shown since delta monitor is enable!thanks

    Hi,
    What is your SCOM version, would you please try to install the newest update, and check the result.
    And here is a similar thread, please refer to it:
    http://social.technet.microsoft.com/Forums/en-US/28516ca3-ae97-49a2-bb72-d6814750813f/scom-warnings-and-errors-event-id-4503-10703-1103-and-10102?forum=exchangesvradminlegacy
    Regards,
    Yan Li
    Regards, Yan Li

  • I have recently updated m iPhone 4 which was not used since months. It has to be updated from5.1.4 to iOS 7.0.4 and it has taken more than 15 hours to get started. Plz help me. It took about 5 to 6 hrs to prepare for updating.

    I have recently updated m iPhone 4 which was not used since months. It has to be updated from5.1.4 to iOS 7.0.4 and it has taken more than 15 hours to get started. Plz help me. It took about 5 to 6 hrs to prepare for updating.

    I am having this problem.  At first with the new iPhone 5, and then with the iPad 2.  I am not sure why this is happening. 
    My gut feeling is this is an iO6 issue and here's why -
    The problem mainly occurs with apps.  I have about 150 apps, and when I plugged in the phone, iTunes went to sync all of them.  The process would hang up after about 20 - 30 apps were loaded onto the phone. I could tell where about the process hung up because the apps on the phone showed up as "waiting".
    Then on the iPad 2 I plugged in to sync and saw there was a huge "Other" component in my storage.  It required me to restore the iPad 2 from backup.  With this restore the same issues occurred - putting the apps back on the iPad would hang up.  The videos on the iPad also got stuck - maybe after about 10 hours of videos transfered iTunes crashed.
    My solution has been to soft reset the device, restart Windows, and continue the process until it's complete.  This is remarkably inefficient and time-intensive but everything works with patience.
    I have been wondering if others have had these same problems. 

  • Accessing a File within a zip, which was archived using Applet Tag

    Hi,
    Could Any one please tell me, How to Access a File from within an Applet. The File resides inside a zip which was Archived using <Applet> Tag.
    Actually, I want to write an application which runs both online and offline. So I have chosen Applet and All the files Which I need are zipped and is Archived through <Applet ARCHIVE="example.zip">.
    Now I want to access those XML files which are inside example.zip from my Applet.
    How can I do that?
    I think I will get security Exception.
    How to get rid of this security Exception.
    Kindly Answer soon.......
    It's very urgent.
    Thanking you,
    KumudaRaj

    Did you already try signing a jarfile? If no ->>
    You can call a class inside a jar-file within the applet.
    if this class should be able to acces files the jarfile
    first has to be signed. to do this, you must generate a key.
    the complete work:
    1. write your applet
    2. write a html-page with following code:
    <APPLET code="guestbook.class" archive="guestbook.jar" width=600 height=400></APPLET>
    3. make a zip-file with the guestbook.class, guestbook.form, guestbook$1.class, guestbook$... and rename it to guestbook.jar
    4. in the console type:
    keytool -genkey -alias YOURNAME
    5. sign the key to your jarfile with:
    jarsigner guestbook.jar YOURNAME
    6. try the applet. a warning should appear which you have to answer
    with YES then it should work
    my trouble is that i cant acces files anyway because right now i don�t
    alreadv have the clue to get the right (absolute?) path for the file. means i get an ioexception because the applet cant find the file :-((
    does anyone know how to solve this problem then? my code is:
    FileReader Stream = new FileReader("/members/Ui97u8g4f6b89mj90kh5gbr4ecf6KXC4/guestbook.txt");
    ...

  • "Command-i" which was so useful in being able to selectively delete messages from the servers no longer works. Is their a replacement? Will it be fixed? Or should I change my mail application?

    "Command-i" which was so useful for selectively deleting messages from servers has disappeared in  Maverick. I wonder if it has been replaced by something else or should I look into other mail applications.

    Hmmm.  Which Mail program are you referring to?
    in Mac Mail command -i used to bring up the Account info pane on the server  (10.8.5)
    Now it seems you have to use the gear at the bottom in "Mail Activity" to get the drop down (10.9) :

  • I opened my iPhoto library today which was stored on an external hard drive and several of my videos now will not play. The weird thing is that each file shows a duration of 1 second and when I open them it just shows one frame. What the

    I opened my iPhoto library today which was stored on an external hard drive and several of my videos now will not play at all. The weird thing is that each file shows a duration of 1 second and when I open them it just shows one frame. What the !&%$#@ Where did my original video files go?

    Sounds like a good plan, you can never be to safe and having a second External HD is safer than one.
    The only thing that I would do different, is setup the 3T as my TimeMachine Backup and then erase and move my Photos, Videos and perhaps even iTunes Media to the 1T. That way you will have room to backup both the Internal Hard Drive and the 1T External Hard Drive to the 3T using TimeMachine.
    Take your time, study and use the > Time Machine - Frequently Asked Questions if you get stuck or aren't sure how to make the move.
    Also see > iPhoto: How to move the Library folder to a new location
    iMovie ’08: Storing or moving your video library to an external hard disk
    and >  iTunes for Mac: Moving your iTunes Media folder

  • How can I get INSTID_B for the documents which are stored using Store Business Document functionality

    Dear experts,
    I had activated the functionality of Store Business document and successfully stored documents in external server.
    My client have a custom function module which is used to send emails.In that FM they used SO_DOCUMENT_READ_API1, SO_DOCUMENT_SEND_API1 function modules.They passed Instance Ident(SRGBTBREL->INSTID_B)(eg: FOL33000000000004EXT39000000000026) as export parameter to the FM 'SO_DOCUMENT_READ_API1' and get the attachment details and content.
    Here my problem is I do not have entries in the table SRGBTBREL for the documents which are stored using the Store Business Document functionality and without INSTID_B I am unable to use the FM 'SO_DOCUMENT_READ_API1' to get the document details and content. Please help me to find INSTID_B for documents which are stored using Store Business Document functionality or please let me know if there is any other way to use FM 'SO_DOCUMENT_READ_API1' for documents which are stored using Store Business Document.
    Thanks in advance.
    Regards,
    Kiran

    Hi Kiran,
    You can use the following method to get the information. For example if you want to get BO documents for a customer
    CALL METHOD cl_binary_relation=>read_links
       EXPORTING
         is_object           = ls_lpor
         it_relation_options = lt_relat
       IMPORTING
         et_links            = lt_links.
    then fill  ls_por-instid with a customer number (KUNNR), ls_por-typeid = 'KNA1' and ls_por-catid = 'BO'.
    Table  lt_relat should contain a line option  for each document type (for example 'I' 'EQ' 'NOTE', 'I' EQ 'ATTA', 'I' EQ 'URL', ...
    In table lt_links you will get your information.
    Maybe some other methods of class CL_BINARY_RELATION may also solve your issue.
    Regards,
    Klaus

  • Adding new column in an existing report which was build using Union

    While working in OBIEE 11g I encounter an issue.
    My existing report was build using UNION at Criteria Tab in Analysis. Now I have a requirement to add a new column into the same report. For each criteria I have added the new column but when I go back to the "Result Columns". I see a new field added but it is not allowing me to open or edit column properties for that new column & at the same time it is not allowing me to navigate to other tabs like Results, Promts, and Advanced.
    I don’t want to build this report from scratch. Is there any workaround to get it resolved?

    Hi,
    Just check it once the new added column data types are mismatched or not?
    and the new added column should be navigated into excluded section, so u should edit the report and dragged into the table column section.
    Thanks..

  • Detecting when exception was thrown using custom class loader

    Hello all,
    I would like to implement the solution described here - http://stackoverflow.com/questions/75218/how-can-i-detect-when-an-exceptions-been-thrown-globally-in-java - that uses custom class loader in order to detect when an Exeption thrown somewhere in the JVM hosting my app, please note that exceptions might be thrown from 3rd party jars the app is using. So, thanks to help I got from another post, I've managed to code the custom class loader. My question is how can the class loader wrap the original exception, as the methods in ClassLoader deals with classes, not instances. So where should I set the original exception?
    Thanks!
    Edited by: user9355666 on Sep 28, 2010 10:48 PM

    user9355666 wrote:
    I think I'm missing something fundumental, forgive me for being slow...
    This is what I did so far. For the exception wrapper I made a simple class extens Exception that recieve Exception in its ctor and store it. I also subclassed ClassLoader and override its loadClass(). I've registered it as the system classloader. My thinking was to check in that point that if the requested class is instance of Exception and if yes, returning my wrapper class wrapping this exception. But, since loadClass() return class, how can I set in the wrapper the original exception?
    In addition, let's say 2 different places in the code throws NPE, to my understanding the classloader will load NPE only once, so how throwing the NPE in the second time can be detected?you are missing a key point. you should creating a custom implementation of the NPE class which hooks into your detection code in its constructor. from that point forward, anytime any NPE (which is your custom class) is constructed, you can detect it.

  • Which one to use - Customer Interface or TCA APIs? And why?

    Hi,
    Please let me know the answer for the following questions. I have a legacy system in 11.0.3 (which does not have the TCA architecture) and the customers have to be moved to R12. I could get the details in different flat files for the import from source system. Which is the approach I should use?
    1) What does customer interface does NOT do which the TCA APIs can do?
    2) Doesn’t the customer interface use the TCA API within it?
    3) Is it better to use APIs than customer interface? If so, why and what are the criterions I should look for for deciding on what to use?
    Highly appreciate the help.
    Thanks,
    Dinesh

    Hello Dinesh,
    To answer your questions below:
    user3331828 wrote:
    1) What does customer interface does NOT do which the TCA APIs can do?The Customer Interface tables do the same things that TCA API does.
    user3331828 wrote:
    2) Doesn’t the customer interface use the TCA API within it?I have never been able to open a Spawned program to see which packages are used. Not sure if it uses the same API packages.
    user3331828 wrote:
    3) Is it better to use APIs than customer interface? If so, why and what are the criterions I should look for for deciding on what to use?Customer interface might be easier than the to implement than the use of API..
    For customer interface, just right a program to validate the source data and insert into open interface table, submit the import program and view output for errors. Much easy to maintain than API.
    API need a certain level of programming and you will need to investigate for all the flow of creating a customer and their corresponding create procedure to call..
    Hope this help,
    Vik

  • HT1296 Help! I failed to back up the data on my iphone 4 16gb using iTunes Version 11.01. The error message read that the back up was corrupt. I am suppose to delete the back up. Can someone help me? I urgently need to back up the data!:\

    Hi guys!
    I really need help. I tried to back up the data on my iphone 4 on the iTunes version 11.01 but failed.
    The error message read : the backup was corrupt or not compatible with iPhone. can anyone advise me on this,
    as I urgently need to back up my phone in anticipation for my iPhone 5.
    Greatly appreciated!

    this usally happens when the backup you tool was from an old ios version. Two options that you can try is
    1.  Delete the back up by going to edit> preferences> devices & delete back up on itunes & try backing up again
    2.  Update the ios software of the iphone4 & then take a back up. then try restoring
    Taz

  • Is it possible to get the photo back which was deleted from iPhone directly, no backup in iTune?

    I deleted some photos from my iPhone 4 directly, and didn't sync with iTune. I really want to get it back, is it possible? Is there anybody can help me? Thanks in advance!!
    Really wish there is a section like trash can on iPhone, then we can get something back we deleted in bad emotion or by mistake!!!

    Yea, unfortunately it does happen a lot.  You can offer suggestions to Apple here:
    http://www.apple.com/feedback/iphone.html.

  • Reading data which was wrote using fm BAL_LOG_MSG_ADD

    I have two queries:
    1) My z program is writing logs Using fn modules
    BAL_LOG_CREATE
    and
    BAL_LOG_MSG_ADD
    <b>Where can I view the log. Which tcode?</b>
    I have seen <b>SM21</b> but there is no entry for my transaction.
    2) What is the suitable way of writing log to SAP. My program is Posting goods movements with the help of fn module BAPI_GOODSMVT_CREATE.
    Code realted to point 1.
      PERFORM activate_message_header.
      PERFORM msg_add USING lw_bapireturn-type
                           lw_bapireturn-id
                           lw_bapireturn-number
                           lw_bapireturn-message_v1 lw_bapireturn-MESSAGE+0(15)
                           lw_bapireturn-message_v2 lw_bapireturn-MESSAGE+14(15)
                           lw_bapireturn-message_v3 lw_bapireturn-MESSAGE+29(15)
                           lw_bapireturn-message_v4 lw_bapireturn-MESSAGE+44(15).
    FORM activate_message_header .
      DATA: l_s_log    TYPE bal_s_log.
    * define some header data of this log
      l_s_log-aluser    = sy-uname.
      l_s_log-altcode   = sy-tcode.
    * create a log
      CALL FUNCTION 'BAL_LOG_CREATE'
        EXPORTING
          i_s_log                 = l_s_log
        IMPORTING
          e_log_handle            = w_handle_1
        EXCEPTIONS
          log_header_inconsistent = 1
          OTHERS                  = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.
    FORM msg_add  USING   p_msgty TYPE syst-msgty
                                p_msgid TYPE syst-msgid
                                p_msgno TYPE syst-msgno
                                p_msgv1 TYPE syst-msgv1 p_msgv1_SRC TYPE BALMSGVSRC
                                p_msgv2 TYPE syst-msgv2 p_msgv2_SRC TYPE BALMSGVSRC
                                p_msgv3 TYPE syst-msgv3 p_msgv3_SRC TYPE BALMSGVSRC
                                p_msgv4 TYPE syst-msgv4 p_msgv4_SRC TYPE BALMSGVSRC
      DATA: l_s_msg TYPE bal_s_msg.
    * define data of message for Application Log
      l_s_msg-msgty     = p_msgty.
      l_s_msg-msgid     = p_msgid.
      l_s_msg-msgno     = p_msgno.
      l_s_msg-msgv1     = p_msgv1. l_s_msg-MSGV1_SRC = p_msgv1_src.
      l_s_msg-msgv2     = p_msgv2. l_s_msg-MSGV2_SRC = p_msgv2_src.
      l_s_msg-msgv3     = p_msgv3. l_s_msg-MSGV3_SRC = p_msgv3_src.
      l_s_msg-msgv4     = p_msgv4. l_s_msg-MSGV4_SRC = p_msgv4_src.
    * add this message to log file
    * we do not specify I_LOG_HANDLE since we want to add this message
    * to the default log. If it does not exist we do not care
    * (EXCEPTIONS log_not_found = 0).
      CALL FUNCTION 'BAL_LOG_MSG_ADD'
        EXPORTING
          i_s_msg      = l_s_msg
          i_log_handle = w_handle_1
        EXCEPTIONS
            log_not_found = 0
            OTHERS        = 1.
    ENDFORM.

    Q 1. Where can I view the log. Which tcode?
    SLG1
    Q 2. (To best of my knowledge, which is very limited First we need to create a Z log object and subobject (transaction SLG0).  Save it using fn BAL_DB_SAVE

Maybe you are looking for

  • Certain fields should be defaulted at Goods Receipt of equipments

    Dear ALL When new Materials are arrived at Warehouse MIGO in the back ground Equipment is generated (Equipment with material and serial number) Now we want certain Data to be filled automatically in the background like company code, planning plant wh

  • Graph api - applications assigned to user

    Hello, I am working with azure active directory. What I am trying to do, is to check what applications are assigned to user. I am iterating through users but I can't see any properties to get this info. I have also tried to iterate through applicatio

  • How to turn off rollback in DML?

    Hi, I do lot DML statements and I don't require roll back; how can I trun off this to speed up DML statements? Thanx Alfred

  • I can't turn off iPad 2 Screen

    I have that problem when i update from iOS 6 to 7 then cant fix it, i tried to eraser , format, restore everything then still cant fix it My Power button is totally work (restart, screenshot, ...) but cant lock ipad screen, i alway need to wait 2 min

  • OS X Mavericks: clean install or upgrade?

    There is some sort of a difference?