View Issue Details

IDProjectCategoryView StatusLast Update
0005488JEDI VCL00 JVCL Componentspublic2012-02-27 17:07
ReporterKorney_SanAssigned Toobones 
PrioritynormalSeverityblockReproducibilityalways
Status resolvedResolutionwon't fix 
Product VersionDaily / GIT 
Target VersionFixed in Version 
Summary0005488: TJvgXMLSerializer.DeSerialize does not work (get EJvgXMLOpenTagNotFoundException)
DescriptionI'm using Delphi 7. When migrating my project from JEDI 3.36 to 3.40 I got EJvgXMLOpenTagNotFoundException in code that worked for years. So I started to dig the problem.
I found that function StrPosExt of unit JvgUtils was changed from "asm" code to Pascal (I have no reason why) and now it uses StrLCopy function.
This function has one specialty - when one of its parameters (Str1 or Str2) is substring of other, the function returns 0 (meaning strings are equal) only if MaxLen set to length of this parameter (e.g. if Str1 is substring of Str2, StrLComp(Str1, Str2, MaxLen)=0 only if MaxLen = Length(Str1), not Length(Str2)).
So, I make a test program and start to debug unit JvgXMLSerializer.
First I found where EJvgXMLOpenTagNotFoundException is raised. Procedure TJvgXMLSerializer.DeSerializeInternal, the code:
    BlockStart := StrPosExt(TokenPtr, PChar('<' + ComponentTagName + '>'),
      BufferEnd - TokenPtr { = BufferLength});
I've changed it to
    BlockStart := StrPosExt(TokenPtr, PChar('<' + ComponentTagName + '>'),
      2 + Length(ComponentTagName));
and passed this place, but got another error:
Access violation at address xxxxxxxx. Read of address 000000.
Tracing leads me to code:
        TagEnd := StrPosExt(TagEnd, PChar('</' + TagName + '>'),
          BufferEnd - TagEnd + 3 + Length(TagName) { = BufferLength});
The problem was that TagEnd become "nil" and after in property assignment fires that error.
I've changed it to
        TagEnd := StrPosExt(TagEnd, PChar('</' + TagName + '>'),
          3 + Length(TagName);
and got a working code... I think. Next problem appears when I start to use collections. They weren't filled despite file was correct. This leads me to another piece of code:
    BlockEnd := StrPosExt(BlockStart, PChar('</' + ComponentTagName + '>'),
      BufferEnd - BlockStart + 3 + Length(ComponentTagName) {BufferLength});
and I modified it as with TagEnd:
    BlockEnd := StrPosExt(BlockStart, PChar('</' + ComponentTagName + '>'),
      3 + Length(ComponentTagName);
I've recompiled and reinstalled JEDI, and my projects now work fine.

Please check this code yourself and make proper changes at SVN.
Additional InformationSVN units mentioned above are the same as in 3.40 release.
TagsNo tags attached.

Activities

jfudickar

2011-02-20 19:35

developer   ~0018395

Could you create a sample app and add it app to this entry please.

Regards
Jens

2011-02-21 08:05

 

TestXMLSerializer.zip (4,910 bytes)

Korney_San

2011-02-21 08:06

reporter   ~0018397

It was created while testing serializing abilities and then fixing this bug.
Here is it.

Korney_San

2011-02-21 08:07

reporter   ~0018398

Button1 to serialize internal object, Button2 to deserialize.

Korney_San

2011-03-09 14:31

reporter   ~0018440

Did the app help you any way?

mosest

2011-05-25 21:14

reporter   ~0018559

Any plans on when this will be fixed?

obones

2011-06-08 15:24

administrator   ~0018674

This is inside a Globus component and they are deprecated. So unless someone provides a patch in "TortoiseSVN" format for us to include, no effort will be made to make any change.
Especially considering that there are better and more flexible options in the JVCL with the use of the TJvAppStorage family of components

Korney_San

2011-06-16 15:02

reporter   ~0018768

Okay, I have TortoiseSVN and can generate this patch.

I need to store data in XML files and don't know about abilities of TJvAppStorage to produce XML. And JEDI help file is about 3.33 version and most contents is "undocumented".

obones

2012-02-27 17:07

administrator   ~0019603

Look at the JvAppStorage examples, you'll get the required information

Issue History

Date Modified Username Field Change
2011-02-18 11:05 Korney_San New Issue
2011-02-20 19:35 jfudickar Note Added: 0018395
2011-02-20 19:35 jfudickar Status new => feedback
2011-02-21 08:05 Korney_San File Added: TestXMLSerializer.zip
2011-02-21 08:06 Korney_San Note Added: 0018397
2011-02-21 08:07 Korney_San Note Added: 0018398
2011-03-09 14:31 Korney_San Note Added: 0018440
2011-05-25 21:14 mosest Note Added: 0018559
2011-06-07 17:43 obones Status feedback => acknowledged
2011-06-08 15:24 obones Note Added: 0018674
2011-06-16 15:02 Korney_San Note Added: 0018768
2012-02-27 17:07 obones Note Added: 0019603
2012-02-27 17:07 obones Status acknowledged => resolved
2012-02-27 17:07 obones Resolution open => won't fix
2012-02-27 17:07 obones Assigned To => obones