Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem loading libraries with long paths #243

Closed
Boereck opened this issue Jun 13, 2013 · 4 comments
Closed

Problem loading libraries with long paths #243

Boereck opened this issue Jun 13, 2013 · 4 comments

Comments

@Boereck
Copy link

Boereck commented Jun 13, 2013

Hi,

I am working on a Windows 7 (64 bit) but on a 32 bit JVM and I am using JNA 3.5.2.
I have to load DLLs by their absolute path, but if I try to load them and the path has a long path (my assumption is 256 characters) loading the library fails with an UnsatisfiedLinkError.
If I understand the JNA code correctly, the absolute path to the DLL will always be computed when loading the the library, so long paths are always a problem.
Is this an inherent restriction of the operating system or is there any way around this?

Thanks,
Max

@twall
Copy link
Contributor

twall commented Jun 14, 2013

Do you have unicode characters in the path? That could cause the load to fail; only the ANSI version of LoadLibrary has a small path length limit, and JNA uses the unicode version (LoadLibraryExW, actually).

On Jun 13, 2013, at 5:06 PM, Max Bureck wrote:

Hi,

I am working on a Windows 7 (64 bit) but on a 32 bit JVM and I am using JNA 3.5.2.
I have to load DLLs by their absolute path, but if I try to load them and the path has a long path (my assumption is 256 characters) loading the library fails with an UnsatisfiedLinkError.
If I understand the JNA code correctly, the absolute path to the DLL will always be computed when loading the the library, so long paths are always a problem.
Is this an inherent restriction of the operating system or is there any way around this?

Thanks,
Max


Reply to this email directly or view it on GitHub.

@Boereck
Copy link
Author

Boereck commented Jun 14, 2013

Hi, the path does not contain unicode characters. And all the characters used in the long path work in shorter paths. As soon as I have a proper internet connection I will download the JNA sources, build the jnidispatch.dll on my machine, and replace the delivered DLL with mine for testing purposes. But somehow I have the feeling that this won't make a difference.

@twall twall closed this as completed in 1737d6a Jun 16, 2013
@avakhrenev
Copy link

Hi,

I suppose, this change causes issues, that I'm currently experiencing.

I'm trying to use libvlc 2.1.3 in java project within 64 bit JVM on windows 7. With jna-3.5.2 everyting works fine, but with jna-4.0.0 libvlc can not find its plugin modules. Here's a snippet from the log:

[000000000018bae0] main libvlc debug: VLC media player - 2.1.3 Rincewind
[000000000018bae0] main libvlc debug: Copyright � 1996-2014 the VideoLAN team
[000000000018bae0] main libvlc debug: revision 2.1.3-0-ge6a71cc
[000000000018bae0] main libvlc debug: configured with ../extras/package/win32/../../../configure  '--enable-update-check' '--enable-lua' '--enable-faad' '--enable-flac' '--enable-theora' '--enable-twolame' '--enable-quicktime' '--enable-avcodec' '--enable-merge-ffmpeg' '--enable-dca' '--enable-mpc' '--enable-libass' '--enable-x264' '--enable-schroedinger' '--enable-realrtsp' '--enable-live555' '--enable-dvdread' '--enable-shout' '--enable-goom' '--enable-caca' '--disable-sdl' '--enable-qt' '--enable-skins2' '--enable-sse' '--enable-mmx' '--enable-libcddb' '--enable-zvbi' '--disable-telx' '--enable-nls' '--disable-dirac' '--host=x86_64-w64-mingw32' 'host_alias=x86_64-w64-mingw32'
[000000000018bae0] main libvlc debug: using multimedia timers as clock source
[000000000018bae0] main libvlc debug:  min period: 1 ms, max period: 1000000 ms
[000000000018bae0] main libvlc debug: searching plug-in modules
[000000000018bae0] main libvlc debug: loading plugins cache file \\?\D:\vlc\win64\vlc-213\plugins\plugins.dat
[000000000018bae0] main libvlc debug: recursively browsing `\\?\D:\vlc\win64\vlc-213\plugins'
[000000000018bae0] main libvlc debug: saving plugins cache \\?\D:\vlc\win64\vlc-213\plugins\plugins.dat
[000000000018bae0] main libvlc debug: plug-ins loaded: 1 modules
[000000000018bae0] main libvlc debug: translation test: code is "C"
[000000000018bae0] main libvlc error: No plugins found! Check your VLC installation.

Here is the log with jna-3.5.2 for comparison:

[000000000034bae0] main libvlc debug: VLC media player - 2.1.3 Rincewind
[000000000034bae0] main libvlc debug: Copyright � 1996-2014 the VideoLAN team
[000000000034bae0] main libvlc debug: revision 2.1.3-0-ge6a71cc
[000000000034bae0] main libvlc debug: configured with ../extras/package/win32/../../../configure  '--enable-update-check' '--enable-lua' '--enable-faad' '--enable-flac' '--enable-theora' '--enable-twolame' '--enable-quicktime' '--enable-avcodec' '--enable-merge-ffmpeg' '--enable-dca' '--enable-mpc' '--enable-libass' '--enable-x264' '--enable-schroedinger' '--enable-realrtsp' '--enable-live555' '--enable-dvdread' '--enable-shout' '--enable-goom' '--enable-caca' '--disable-sdl' '--enable-qt' '--enable-skins2' '--enable-sse' '--enable-mmx' '--enable-libcddb' '--enable-zvbi' '--disable-telx' '--enable-nls' '--disable-dirac' '--host=x86_64-w64-mingw32' 'host_alias=x86_64-w64-mingw32'
[000000000034bae0] main libvlc debug: using multimedia timers as clock source
[000000000034bae0] main libvlc debug:  min period: 1 ms, max period: 1000000 ms
[000000000034bae0] main libvlc debug: searching plug-in modules
[000000000034bae0] main libvlc debug: loading plugins cache file D:\vlc\win64\vlc-213\plugins\plugins.dat
[000000000034bae0] main libvlc debug: recursively browsing `D:\vlc\win64\vlc-213\plugins'
[000000000034bae0] main libvlc debug: saving plugins cache D:\vlc\win64\vlc-213\plugins\plugins.dat
[000000000034bae0] main libvlc debug: plug-ins loaded: 389 modules

Not sure if this a right place to post this, but please take a look. Currently it blocks me from using newest version of jna.

Thank you!

@twall
Copy link
Contributor

twall commented Feb 12, 2014

Maybe it’s libvlc that can’t handle the long path format?

On Feb 11, 2014, at 11:02 AM, Alexey Vakhrenev notifications@github.com wrote:

Hi,

I suppose, this change causes issues, that I'm currently experiencing.

I'm trying to use libvlc 2.1.3 in java project within 64 bit JVM on windows 7. With jna-3.5.2 everyting works fine, but with jna-4.0.0 libvlc can not find its plugin modules. Here's a snippet from the log:

[000000000018bae0] main libvlc debug: VLC media player - 2.1.3 Rincewind
[000000000018bae0] main libvlc debug: Copyright � 1996-2014 the VideoLAN team
[000000000018bae0] main libvlc debug: revision 2.1.3-0-ge6a71cc
[000000000018bae0] main libvlc debug: configured with ../extras/package/win32/../../../configure '--enable-update-check' '--enable-lua' '--enable-faad' '--enable-flac' '--enable-theora' '--enable-twolame' '--enable-quicktime' '--enable-avcodec' '--enable-merge-ffmpeg' '--enable-dca' '--enable-mpc' '--enable-libass' '--enable-x264' '--enable-schroedinger' '--enable-realrtsp' '--enable-live555' '--enable-dvdread' '--enable-shout' '--enable-goom' '--enable-caca' '--disable-sdl' '--enable-qt' '--enable-skins2' '--enable-sse' '--enable-mmx' '--enable-libcddb' '--enable-zvbi' '--disable-telx' '--enable-nls' '--disable-dirac' '--host=x86_64-w64-mingw32' 'host_alias=x86_64-w64-mingw32'
[000000000018bae0] main libvlc debug: using multimedia timers as clock source
[000000000018bae0] main libvlc debug: min period: 1 ms, max period: 1000000 ms
[000000000018bae0] main libvlc debug: searching plug-in modules
[000000000018bae0] main libvlc debug: loading plugins cache file ?\D:\vlc\win64\vlc-213\plugins\plugins.dat
[000000000018bae0] main libvlc debug: recursively browsing `?\D:\vlc\win64\vlc-213\plugins'
[000000000018bae0] main libvlc debug: saving plugins cache ?\D:\vlc\win64\vlc-213\plugins\plugins.dat
[000000000018bae0] main libvlc debug: plug-ins loaded: 1 modules
[000000000018bae0] main libvlc debug: translation test: code is "C"
[000000000018bae0] main libvlc error: No plugins found! Check your VLC installation.

Here is the log with jna-3.5.2 for comparison:

[000000000034bae0] main libvlc debug: VLC media player - 2.1.3 Rincewind
[000000000034bae0] main libvlc debug: Copyright � 1996-2014 the VideoLAN team
[000000000034bae0] main libvlc debug: revision 2.1.3-0-ge6a71cc
[000000000034bae0] main libvlc debug: configured with ../extras/package/win32/../../../configure '--enable-update-check' '--enable-lua' '--enable-faad' '--enable-flac' '--enable-theora' '--enable-twolame' '--enable-quicktime' '--enable-avcodec' '--enable-merge-ffmpeg' '--enable-dca' '--enable-mpc' '--enable-libass' '--enable-x264' '--enable-schroedinger' '--enable-realrtsp' '--enable-live555' '--enable-dvdread' '--enable-shout' '--enable-goom' '--enable-caca' '--disable-sdl' '--enable-qt' '--enable-skins2' '--enable-sse' '--enable-mmx' '--enable-libcddb' '--enable-zvbi' '--disable-telx' '--enable-nls' '--disable-dirac' '--host=x86_64-w64-mingw32' 'host_alias=x86_64-w64-mingw32'
[000000000034bae0] main libvlc debug: using multimedia timers as clock source
[000000000034bae0] main libvlc debug: min period: 1 ms, max period: 1000000 ms
[000000000034bae0] main libvlc debug: searching plug-in modules
[000000000034bae0] main libvlc debug: loading plugins cache file D:\vlc\win64\vlc-213\plugins\plugins.dat
[000000000034bae0] main libvlc debug: recursively browsing `D:\vlc\win64\vlc-213\plugins'
[000000000034bae0] main libvlc debug: saving plugins cache D:\vlc\win64\vlc-213\plugins\plugins.dat
[000000000034bae0] main libvlc debug: plug-ins loaded: 389 modules

Not sure if this a right place to post this, but please take a look. Currently it blocks me from using newest version of jna.

Thank you!


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants