Menu

standard message text missing

Help
2011-11-11
2013-03-18
  • nenad cikic

    nenad cikic - 2011-11-11

    When i enter the update form for change, and when i choose to cancel the change the ConfirmCancel message pops. The problem is that the message box has the correct title set, but the message text is missing. I have put the log in
    CWin.java
    public static int message(ClarionString message,ClarionString header,String icon,int button,int defButton,int style)
    and the message object is empty text.

    I suppose the problem is in Errorclass.storeErrorEntry but i could not put log here. I have tried to compile the project without code generation, as described in yours document, but i got several errors of type unchecked cast on
    criticalSection=(Refvariable<ICriticalSection>)this.cricticalSection.getLockedObject(thread)
    stdErrorLog=(Refvariable<ICriticalSection>)this.stdErrorLog.getLockedObject(thread)
    etc.

    Can you suggest how can I compile the java code without generation, so that i can put the log inside?

    Thanks
    Nenad

     
  • Andrew Barnham

    Andrew Barnham - 2011-11-11

    To run maven but not regenerate source code. Add option -Dclarion.gen.skip=true .  i.e. :
    mvn -Dclarion.gen.skip=true package

    For debugging , I usually use eclipse IDE and step debug the code.

    In your c2j app, run  mvn eclipse:eclipse.  This generates an eclipse .project file.  Import the project into eclipse and run the app using Debug.  A bit to learn if you've never used eclipsed before. But I find it alot easier than inserting System.print statements into the code trying to narrow in on a bug.

     
  • nenad cikic

    nenad cikic - 2011-11-12

    I have not managed to create eclipse project. Or more precisely I have created it but when I load it in eclipse it says no_m2elipse support and nothng happens when I click on run.
    I have downloaded the m2eclipse plugin (at least I think so).
    Nevertheless I have put many logs in generated code and I have found that the serialization of Errorstatusgroup does not work.

    In errorclass I have added in storeErrorEntry:
    lStatus.v.messageText.setValue(eg.message.get()); !just to trak easier

    and the getAllStatusVariables is
    public void getAllStatusVariables(Errorstatusgroup pErrorStatusGroup)
    {
    Errorstatusclass lStatus=null;
    lStatus=(Errorstatusclass)CMemory.resolveAddress(CMemory.instance(this.status.get(),CRun.getThreadID()));
       log.log(java.util.logging.Level.WARNING,"lStatus.v.messageText.toString() " +lStatus.v.messageText.toString(),this);  //debug
    pErrorStatusGroup.setValue(lStatus.v.getString());
                   
       log.log(java.util.logging.Level.WARNING,"pErrorStatusGroup.messageText.toString() " +pErrorStatusGroup.messageText.toString(),this);  //debug             

    }

    looking at logs the first log is correct while the second is empty.
    Tracking more down the ClarionString.serializeString shows len=0, and so nothing is serialized.
    The serialization happens due to lStatus.v.getString().

    If it might help:
    -i have downloaded the last jdk
    -i have noticed the defaulterrors strings are pstring while errorstatusgroup are cstring.

    Can you look please at this when you will have time?
    Thanks
    Nenad

     
  • Andrew Barnham

    Andrew Barnham - 2011-11-12

    Your libsrc/ must be completely different from what I am using.  None of the symbol names you list above appear when I generate MusicDB6 example.  You'll need to bundle your source, your libsrc\ especially and send it to me for debugging.

    If the code does indeed overlap a pstring and a cstring then this will definitely be a problem; as pstring and cstring use completely different encoding methods for encoding string meta data (it's length) and this functionally affects how c2j memory model works because c2j expects and assumes a pstring is used as a pstring and a cstring is used as a cstring, and they two, in terms of their memory model, are incompatible.  I would imagine that in normal clarion you could get away with this, it is just that if you set the pstring, the cstring that overlaps it would not be a valid string, it would not validly encode a string the way we would expect. But if you never used the cstring as a string, but purely as a raw memory dump, you could get away with it.  The solution it sounds is to keep types the same.  I personally prefer using STRING in c2j in context of overlaying variables and using them as raw memory dumps, because a string does not encode string meta data, therefore memory mapping always works irrespective of the content.

     
  • nenad cikic

    nenad cikic - 2011-11-13

    Did you received the test.zip? I have sent the zip yesterday to your gmail account.
    It is a complete project with src folder also.
    I am using c6.1 by the way.
    I have not changed anything in the libsrc, apart the trn file with errors messages.

    Nenad

     
  • nenad cikic

    nenad cikic - 2011-11-14

    I have now noticed that my email from saturday returned with error delivering messages (it went to spam so i did not noticed till now by chance).  I have tried to submit bug and support request in sourceforge c2j page but it did not work. My email is nenad.cikic@qiqo.hr
    Can you please send me one email, so i will replay to that hoping it will pass through?
    Thanks
    Nenad

     
  • nenad cikic

    nenad cikic - 2011-12-04

    Hello.
    I hope you are OK now.
    I have managed to solve the missing standard error message problem.

    I have changed the following:
    ErrorClass.GetAllStatusVariables           PROCEDURE(*ErrorStatusGroup pErrorStatusGroup)
    lStatus &ErrorStatusClass
      CODE
    ?   ASSERT(~(SELF.Status &= NULL),'ErrorClass not correctly initialized with Status')
      lStatus &= INSTANCE(SELF.Status,THREAD())
      pErrorStatusGroup = lStatus.V
      pErrorStatusGroup.errorbuffer=lStatus.V.errorbuffer !WORKAROUND

    These are the groups involved:
    ErrorEntryGroup               GROUP,TYPE         ! List of all translated error messages
    Id                              UNSIGNED         ! Error message identifier
    Message                         &STRING          ! Message text
    Title                           &STRING          ! Error window caption bar text
    Fatality                        BYTE             ! Severity of error
    Category                        ASTRING          ! Optional category for this error, if blank uses CurrentCategory
                                  END

    ErrorStatusGroup              GROUP,TYPE
    FieldName                       CSTRING(MessageMaxlen)   ! name of field that produced the error
    FileName                        CSTRING(MessageMaxlen)   ! name of file that produced the error
    KeyName                         CSTRING(MessageMaxlen)   ! name of key that produced the error
    MessageText                     CSTRING(MessageMaxlen)   ! message text
    SaveError                       CSTRING(255)               ! Clarion error message
    SaveErrorCode                   LONG                       ! Clarion error code
    SaveFileError                   CSTRING(255)               ! File system's error message
    SaveFileErrorCode               CSTRING(255)               ! File system's error code
    ErrorBuffer                     LIKE(ErrorEntryGroup)
    PrevErrorID                     UNSIGNED
                                  END

    It seems as the the serialization of GROUP inside the GROUP does not work (the ErrorBuffer is the inner GROUP)? Do you confirm this?
    Thanks
    Nenad

     

Log in to post a comment.

Auth0 Logo