SOLVED: Access denied when loading chrome_elf.dll

Having problems with building or using the JCEF Java binding? Ask your questions here.

Re: Access denied when loading chrome_elf.dll

Postby Czarek » Tue Jun 09, 2020 1:18 am

Did you check file permissions?
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: Access denied when loading chrome_elf.dll

Postby joachimdurchholzsix » Tue Jun 09, 2020 1:41 am

Yes. I did a "copy" command to check that it is readable. An "attr" command verified that the file has no attributes except the usual "A(rchive)" one.
joachimdurchholzsix
Techie
 
Posts: 29
Joined: Mon Jun 08, 2020 3:52 am

Re: Access denied when loading chrome_elf.dll

Postby joachimdurchholzsix » Tue Jun 09, 2020 2:47 am

Definitely related to either the file or the directory it is in.

Running the detailed test but redirecting java.library.path to the place where I had copied the dll files to fails:

Code: Select all
C:\Users\tkd6u\Downloads\tmp\java-cef\win64>C:\Daten\software\java-1.8.0-openjdk-1.8.0.242-1.b08.ojdkbuild.windows.x86_64\bin\java -cp "./bin;./bin/*" -Djava.library.path=C:\Daten\develop\id-gui\src\main\resources\lib tests.detailed.MainFrame
Offscreen rendering disabled
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Daten\develop\id-gui\src\main\resources\lib\chrome_elf.dll: Access is denied
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1946)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1861)
        at java.lang.Runtime.loadLibrary0(Runtime.java:871)
        at java.lang.System.loadLibrary(System.java:1124)
        at org.cef.SystemBootstrap$1.loadLibrary(SystemBootstrap.java:24)
        at org.cef.SystemBootstrap.loadLibrary(SystemBootstrap.java:36)
        at org.cef.CefApp.<init>(CefApp.java:145)
        at org.cef.CefApp.getInstance(CefApp.java:221)
        at tests.detailed.MainFrame.<init>(MainFrame.java:100)
        at tests.detailed.MainFrame.main(MainFrame.java:76)


For reference, here's the call when it works. It is using the same binaries but in the original location (C:\Users\tkd6u\Downloads\tmp\java-cef\win64\bin\lib\win64, mind the current working directory shown on the command prompt).

Code: Select all
C:\Users\tkd6u\Downloads\tmp\java-cef\win64>C:\Daten\software\java-1.8.0-openjdk-1.8.0.242-1.b08.ojdkbuild.windows.x86_64\bin\java -cp "./bin;./bin/*" -Djava.library.path=bin/lib/win64 tests.detailed.MainFrame
Offscreen rendering disabled
Using:
JCEF Version = 81.2.24.0
CEF Version = 81.2.24
Chromium Version = 81.0.4044.113
AppHandler.stateHasChanged: INITIALIZING
initialize on Thread[AWT-EventQueue-0,6,main] with library path bin/lib/win64
Added scheme search://
Added scheme client://
AppHandler.stateHasChanged: INITIALIZED
BrowserFrame.onAfterCreated id=1
BrowserFrame.windowClosing CefBrowser.close(false)
BrowserFrame.doClose id=1 CefBrowser.doClose=true
BrowserFrame.windowClosing CefBrowser.close(true)
BrowserFrame.windowClosing Frame.dispose
BrowserFrame.onBeforeClose id=1
BrowserFrame.onBeforeClose CefApp.dispose
AppHandler.stateHasChanged: SHUTTING_DOWN
shutdown on Thread[AWT-EventQueue-0,6,main]
AppHandler.stateHasChanged: TERMINATED
joachimdurchholzsix
Techie
 
Posts: 29
Joined: Mon Jun 08, 2020 3:52 am

Re: Access denied when loading chrome_elf.dll

Postby joachimdurchholzsix » Tue Jun 09, 2020 9:33 am

SOLVED.

I found that copying the files from the .zip archive into the target directory directly would actually work.
When checking the same files out from git, there would be Access Denied.
When I fired up Cygwin, I indeed found that the execute bit wasn't set. Which was a mistake on our part.

So... next time somebody sees an Access Denied LinkageError, the first thing to check is execute permissions.
This can hit both Windows and Linux (and likely Mac as well), but it's more likely for Windows users who use git, because git on Windows tends to play funny games with execute permissions (you really have to get your setup straight).
joachimdurchholzsix
Techie
 
Posts: 29
Joined: Mon Jun 08, 2020 3:52 am

Thanks for all the help!

Postby joachimdurchholzsix » Tue Jun 09, 2020 9:37 am

Ruling out invalid suggestions still helped me narrow down the set of potential causes, so it would have taken me a lot longer to come to this conclusion.
Thanks for whatever effort you guys have been investing!
joachimdurchholzsix
Techie
 
Posts: 29
Joined: Mon Jun 08, 2020 3:52 am

Re: SOLVED: Access denied when loading chrome_elf.dll

Postby magreenblatt » Tue Jun 09, 2020 11:33 am

Good find about git messing up executable permissions on Windows. It's not something that we usually consider on that platform. Note that checking binaries into source control is generally discouraged, from a "correct usage" standpoint (source control systems are not efficient at working with such files, it bloats history that every user needs to download, etc).
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: SOLVED: Access denied when loading chrome_elf.dll

Postby joachimdurchholzsix » Tue Jun 09, 2020 12:35 pm

It's just temporary, until we decide to either commit to java-cef (likely) or decide to stick with JxBrowser (much less likely).
RIght now we're in the proof-of-concept phase, so we're taking shortcuts. This is going to be cleaned up in due time, the application is important enough for us to get the budget for Doing It Right(tm), possibly even donate (if you are interested - no promises as I don't control the purse strings, but I can suggest and put forth whatever arguments come out of this PoC).
joachimdurchholzsix
Techie
 
Posts: 29
Joined: Mon Jun 08, 2020 3:52 am

Re: SOLVED: Access denied when loading chrome_elf.dll

Postby magreenblatt » Tue Jun 09, 2020 1:05 pm

Contributions are, of course, welcome :)
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Previous

Return to JCEF Forum

Who is online

Users browsing this forum: No registered users and 15 guests