5

Closed

odatagen exception: Range or index out of bounds

description

Please help me to fix the following odatagen issue:
 
Command line: ./odatagen /uri=http://odata.netflix.com/v1/Catalog/ /out=/Users/sontmai/Desktop/ODatagenApp
 
Exception:
 
2011-05-20 14:14:14.056 odatagen[3356:903] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSPathStore2 substringToIndex:]: Range or index out of bounds'
*** Call stack at first throw:
(
0   CoreFoundation                      0x900da6ba __raiseError + 410
1   libobjc.A.dylib                     0x99836509 objc_exception_throw + 56
2   CoreFoundation                      0x900da3e8 +[NSException raise:format:arguments:] + 136
3   CoreFoundation                      0x900da35a +[NSException raise:format:] + 58
4   Foundation                          0x99411120 -[NSString substringToIndex:] + 133
5   odatagen                            0x00002f39 getFileName + 176
6   odatagen                            0x00003742 main + 347
7   odatagen                            0x00001d75 start + 53
8   ???                                 0x00000003 0x0 + 3
)
Trace/BPT trap
Closed Sep 8, 2011 at 2:28 AM by abub
Fixed as part of V1.3

comments

jeffniblack wrote May 26, 2011 at 8:01 PM

Same issue here for building the proxy class for a custom odata feed (the feed has already been validated using other tools)

exp...

2011-05-26 14:52:32.220 odatagen[614:903] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSPathStore2 substringToIndex:]: Range or index out of bounds'
*** Call stack at first throw:
(
    0   CoreFoundation                      0x927ca6ba __raiseError + 410
    1   libobjc.A.dylib                     0x9438b509 objc_exception_throw + 56
    2   CoreFoundation                      0x927ca3e8 +[NSException raise:format:arguments:] + 136
    3   CoreFoundation                      0x927ca35a +[NSException raise:format:] + 58
    4   Foundation                          0x9451c120 -[NSString substringToIndex:] + 133
    5   odatagen                            0x00002f39 getFileName + 176
    6   odatagen                            0x00003742 main + 347
    7   odatagen                            0x00001d75 start + 53
)
Trace/BPT trap

matrix4123 wrote May 28, 2011 at 1:52 AM

I get the same error. I stepped through the code and it seems like there is a line searching for the word "build" in the path. I changed this to look for "Build" and it seemed to get past the above error. However, it then tried to look up some xsl files in the wrong location and failed on that, I manually copied the files to where it was looking and got past that error. After that it failed farther down, haven't looked at it more yet.

simmons0105 wrote Jun 4, 2011 at 1:42 PM

odatagen relies on files that exist in

.../ProjectFiles/Framework/src/odatagen/

directory. Thus if open .../ProjectFiles/Framework/src/odatagen/odatagen.xcodeproj in XCode and compile, navigate to the new odatagen executable it should work.

However, if you are like me and do not compile to the default location then it still will not work. The odatagen requires the its path include

.../ProjectFiles/Framework/src/odatagen/build/...

You can either revert to build to the default location or set a custom build directory or move the odatagen executable to the necessary location.

bepaepef wrote Jun 15, 2011 at 9:57 PM

Same issue: the code relies on the fact that there is somewhere the word "build" in the path. So if you build the project with XCode 3.2 it will be OK.
But... if you compile with XCode 4, it will not work out of the box...

For me it is strange that you need to compile the code yourself with the correct version of XCode in order to use the binary.
=> Can somebody review this code so the binary "odatagen" just works?

hugodahl wrote Jul 10, 2011 at 4:22 AM

I have just uploaded a patch proposal which corrects this issue (will require recompiling the "odatagen" project). It will now work as it presently does, or search for the XSL files in the binary's folder.

Feel free to grab it if it can help you out!

hugodahl wrote Jul 10, 2011 at 1:36 PM

I've uploaded a patch that fixes this issue as well as the file not found issue (objc_filename.xsl was being deleted after execution).

abub wrote Jul 12, 2011 at 10:02 PM

Thanks for reporting this. I don't see an uploaded patch but we have fixed it and shall release it soon.

furrybaer wrote Jul 14, 2011 at 6:03 PM

I opened the Odatagen project, completed a build, then used Terminal to navigate to the generated executable to run it. I still get the error. I found the executable at:

/myuser/Library/Developer/Xcode/DerivedData/odatagen-bunchofweirdletters/Build/Products/Debug

Ran it from there against my WCF Odata Services...

Any other ideas? Thanks.

abub wrote Jul 14, 2011 at 6:16 PM

We haven't released the fix yet, we are batching few bug fixes together

abub wrote Sep 8, 2011 at 2:29 AM

Fixed as part of V1.3