[ome-devel] [ome-files] Getting Exceptions When Opening Files for setId(...)

Roger Leigh rleigh at dundee.ac.uk
Thu Feb 1 16:33:12 GMT 2018


On 29/01/18 17:09, Dennis Ai wrote:
> Hi Roger,
>
> 1.I tried to set my environment variable OME_FILES_HOME to the root
> directory where I extracted the binary distribution.
> (“C:\Users\...\Documents\Visual Studio
> 2015\Projects\OMEFilesSharp\External\ome-files”).  This gives me the
> same exception as before.

> 2.I was able to inspect the what() of the std::runtime_error and the
> message says, “Could not determine runtime path for
> “ome-xml-schema”directory”.

Thanks, this looks fairly conclusive for why things are failing.

> 3.Seeing this, I tried to set the environment variable OME_XML_SCHEMADIR
> to “C:\Users\...\Documents\Visual Studio
> 2015\Projects\OMEFilesSharp\External\ome-files\share\xml\ome” and that
> resulted in the same exception as before.

Could you try with the debugger and check this line:

https://github.com/ome/ome-common-cpp/blob/v5.5.0/lib/ome/common/module.cpp#L404

Is the environment variable being used?  What are the home and
module.relpath variables inside this block set to.  Does this path
exist, or is it invalid?

> 4.I confirmed that I have the same files in the directories you
> described below.

It certainly looks like something is wrong with the path lookups and/or
validation.

If you can run your code in the debugger, would it be possible to look
at these:

a) the path being passed to the validate_path() function.


https://github.com/ome/ome-common-cpp/blob/v5.5.0/lib/ome/common/module.cpp#L71

    Can you set a breakpoint or watchpoint here and list the paths which
are being passed in for checking?  This would indicate if the paths are
correct or have been messed up somehow.

b) the steps to resolve the path


https://github.com/ome/ome-common-cpp/blob/v5.5.0/lib/ome/common/module.cpp#L373

    Can you set a watch on module.realpath or set a breakpoint after
each check block and print out the value each time?

c) The DLL Library path


https://github.com/ome/ome-common-cpp/blob/v5.5.0/lib/ome/common/module.cpp#L451

    Can you print out module_lib_path, moduledir and libdir in this section?

    (I'd expect these to be wrong, but it would be useful to know if
it's reporting the paths relative to your OMEFiles.dll)

> Any idea why I might still be running into issues?  I’m happy to send
> you the source code if it might help figure out what’s going on.

I can certainly take a look if you like.

I'm suspicious that when you link the static libraries into your
OMEFiles.dll that you're breaking the assumptions made by the code since
the data file paths are relative to the static libs and not the DLL.
But... the environment variable should have overridden all this, and I
don't understand why it's ignoring the environment variable.  If you
could possibly try to get the debug information requested above, that
might help explain what's happening.



Regards,
Roger

--
Dr Roger Leigh -- Open Microscopy Environment
Wellcome Trust Centre for Gene Regulation and Expression,
College of Life Sciences, University of Dundee, Dow Street,
Dundee DD1 5EH Scotland UK   Tel: (01382) 386364

The University of Dundee is a registered Scottish Charity, No: SC015096


More information about the ome-devel mailing list