Exception: Could not load native libraries.

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Exception: Could not load native libraries.

Kaspatoo
Hello,

great work and well done!!

But may I need some help on my first time.

At first a notice.
On
http://52north.org/communities/geoprocessing/osm2nds/installation.html
you suggest a batch file content for the console application.

here:
C:\tmp\Muenster\Parameters.xml Muenster C:\tmp\Muenster\ Muenster

I ask myself why Muenster stands there twice.
As the description above tells me I would say the first Muenster must be deleted.



So now to me. Im not able to get it run. I use as recommended a batch file.
To make it easier the gui version (its shorter):

I made my batch file all in one line (exept of PAUSE) because the spaces and new lines will be miss-interpreted.

"C:\Program Files\Java\jre6\bin\java" -cp "C:\Program Files (x86)\ArcGIS\Desktop10.0\java\lib\arcobjects.jar";"C:\Program Files (x86)\ArcGIS\OSM2NDS\osm2nds_arcgis_10.0_gui_1.1.jar" org.n52.osm2nds.core.userinterface.gui.Main
PAUSE

Running this will throw an exception:
Can not use native code: Initialisation failed Exception: Therefore the process is canceled.



Now using this batch for console (also all is in one line, except pause):

"C:\Program Files\Java\jre6\bin\java" -cp "C:\Program Files (x86)\ArcGIS\Desktop10.0\java\lib\arcobjects.jar";"C:\Program Files (x86)\ArcGIS\OSM2NDS\osm2nds_arcgis_10.0_console_1.1.jar" org.n52.osm2nds.core.userinterface.console.Main "C:\Users\osd044n0\ArcGIS\GeoData\Daten\OSM\germany.osm" "C:\Program Files (x86)\ArcGIS\OSM2NDS\Parameters_Motorcar_v1.1.xml" "C:\Users\osd044n0\ArcGIS\GeoData\Daten\OSM\germany Germany" "C:\Users\osd044n0\ArcGIS\GeoData\Daten\OSM\germany\germany.log"
PAUSE


This will throw:

Could not load native libraries.
java.lang.UnsatisfiedLinkError: no ntvinv in java.library.path
java.lang.UnsatisfiedLinkError: no ntvinv in java.library.path
        at java.lang.ClassLoader.loadLibrary(Unknown Source)
        at java.lang.Runtime.loadLibrary0(Unknown Source)
        at java.lang.System.loadLibrary(Unknown Source)
        at com.esri.arcgis.interop.NativeLoader.loadLibrary(Unknown Source)
        at com.esri.arcgis.system.EngineInitializer.initializeEngine(Unknown Sou
rce)
[and some exception code more]



What did I do?
- Download the jar, put it into individual folder
- create *.bat file (content above)
   - I changed the pathes of course
   - I deleted the first Muenster because it appears twice
   - I set my paths into "" becaus of (three) spaces in "C:/Program Files (x86)/"
   - I wrote the code in one line, because a new line is interpreted as a new command
       - keeping it as you suggested on your homepage under installation will end also in a exception with a try to open the osm file (because this param is interpreted as own command)
- run the batch

What I have:
- all paths I typed in exists (I copied the path from the browser-line)
- java 6 for x64
- ArcInfo (education edition), but no runtime engine
- the motorcar.xml you offer on the homepage
- an osm file about germany and on about berlin

I hope you can help me and give me some advice.
Please ask if you need further information.


Thanks,
Sebastian
Reply | Threaded
Open this post in threaded view
|

Re: [Osm2nds] Exception: Could not load native libraries.

peterseva
Hello Sebastian,

thank you for writing this post.

Your questions:

1) Typing mistake
Your are right. The example on http://52north.org/communities/geoprocessing/osm2nds/installation.html is wrong. The first Muenster must be deleted. I will change that. The right example is:

"C:\Program Files\Java\jre6\bin\java" -cp "C:\Program Files\ArcGIS\java\lib\arcobjects.jar"
"C:\Program Files\osm2nds\osm2nds_ArcGIS_10.0_console_1.1.jar" org.n52.osm2nds.core.userinterface.console.Main
C:\tmp\Muenster\Muenster.osm C:\tmp\Muenster\Parameters.xml C:\tmp\Muenster\ Muenster
C:\tmp\Muenster\Muenster.log
PAUSE

2) GUI Version
I replaced your paths with the paths on my machine and it worked.

3) Console Version
Here, the quotation marks are wrong. It must be

"C:\Users\osd044n0\ArcGIS\GeoData\Daten\OSM\germany" Germany
instead of
"C:\Users\osd044n0\ArcGIS\GeoData\Daten\OSM\germany Germany"

I think, your problem refers to this: http://forums.arcgis.com/threads/20839-Error-in-Running-ArcObjects-10-Application.

Please tell me if this helped you,
Eva

_______________________________________________
Osm2nds mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/osm2nds
Reply | Threaded
Open this post in threaded view
|

Re: Exception: Could not load native libraries.

Kaspatoo
In reply to this post by Kaspatoo
Hello,

thanks for your quick answer. It seems to work. (its a big osm file, have to wait if memory will be out of. I just had to change my java path from "C:\program files\..." to c:\program files (x86)\..." (java x86 was still installed, just the path was wrong)

maybe another helpful thing is that you also can use parameters for the gui version. they will pre-typed into the textboxes. E.g. for the Property.XML it will much helpful when u always want to use the same.


Much Thanks.
Sebastian
Reply | Threaded
Open this post in threaded view
|

Re: Exception: Could not load native libraries.

Kaspatoo
In reply to this post by Kaspatoo
Hi,

as expected I got problems with the Heap.
I added the -Xmx1024m parameter.

after 5% it will throw OutOfMemory Exception in Heap.
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

But it occurs in the same time as not using -Xmx1024m
I have x64 system with 6gb of ram

but i think my osm file is just too big 14,9gb (i expected an overflow)
but why it occurs after a minute?
can you suggest some relations between the size of the osm file and the heap size?
what osm filesize do you recommend to be maximum? what is the maximum you have tested?

with a lower file (255mb) it runs until 55%, writing OSM Wys to featureClass and then nothing any more
it runs now since 5 hours
but many or most of the (restricted) turns are declared as invalid
would you say this is normal, where is the problem? can I do something to get them valid?

Here my batch:
"C:\Program Files (x86)\Java\jre6\bin\java" -Xmx1024m -cp "C:\Program Files (x86)\ArcGIS\Desktop10.0\java\lib\arcobjects.jar";"C:\Program Files (x86)\ArcGIS\OSM2NDS\osm2nds_arcgis_10.0_console_1.1.jar" org.n52.osm2nds.core.userinterface.console.Main "C:\Users\osd044n0\ArcGIS\GeoData\Daten\OSM\germany.osm" "C:\Program Files (x86)\ArcGIS\OSM2NDS\Parameters_Motorcar_v1.1.xml" "C:\Users\osd044n0\ArcGIS\GeoData\Daten\OSM\germany" Germany "C:\Users\osd044n0\ArcGIS\GeoData\Daten\OSM\germany\germany.log"
PAUSE

With regards,
Sebastian
Reply | Threaded
Open this post in threaded view
|

Re: Exception: Could not load native libraries.

peterseva
Hey Sebastian!

Yes, you are right. Your OSM file (Germany) is definitely too big for the current version of osm2nds. The biggest area I have ever converted was the Canton of Zurich. That time I used -Xmx1024m. However, I don't know the limit of the biggest possible area. This depends on your system.

We have already recognized this problem with huge OSM files. This problem will be fixed in the next version 1.2 (see roadmap).

The conversion of big OSM files takes sometimes days. However, we are working on the performance to speed that up.

Yes, it's normal that the some turn restrictions are declared as invalid. The current version accepts only the following type of turn restrictions:

A relation is a VALID turn restriction if it follows the following rules:
    1) The relation has the OSM tag type=restriction and the OSM tag restriction=* whereas * can only be no_left_turn, no_right_turn, no_straight_on, no_u_turn, only_left_turn, only_right_turn or only_straight_on.
    2) The member <member type="way" ref="..." role="via"/> must not exist.
    3) The member <member type="way" ref="..." role="from"/> must exist one and only one time.
    4) The member <member type="node" ref="..." role="via"/> must exist one and only one time. 5) The member <member type="way" ref="..." role="to"/> must exist one and only one time.

Best regards,
Eva