Page 1 of 2

OSR and the calling of onAfterCreated

PostPosted: Mon Oct 12, 2020 9:09 am
by julianave1987
When I run my code locally with OSR set to FALSE the code doesn't seem to return from the onAfterCreated function of the addLifeSpanHandler. On the other hand when I set it to TRUE, 'onAfterCreated' gets called quickly and we have no problems. The kicker is my colleague has the exact opposite experience when running the exact same code.

I was wondering if anyone had any insight on this. We have clients with this same experience. On some of their computers it works and some it doesn't seem to. Are there any other settings I should be aware of, or any other checks I should do to determine if I should/could use OSR true or false?

Re: OSR and the calling of onAfterCreated

PostPosted: Mon Oct 12, 2020 9:27 am
by magreenblatt
What OS and CEF/JCEF version? How does it behave with the detailed sample app?

Re: OSR and the calling of onAfterCreated

PostPosted: Mon Oct 12, 2020 9:32 am
by julianave1987
OS is Windows 10 Pro with the latest updates

CEF/JCEF Version is the most current - today I have done a GIT pull and re-built it:
Using:
JCEF Version = 84.3.8.267
CEF Version = 84.3.8
Chromium Version = 84.0.4147.105


This is the output of the detailed sample:

PS C:\git\java-cef\tools> .\run.bat win64 Release detailed
Offscreen rendering disabled
Using:
JCEF Version = 84.3.8.267
CEF Version = 84.3.8
Chromium Version = 84.0.4147.105
AppHandler.stateHasChanged: INITIALIZING
initialize on Thread[AWT-EventQueue-0,6,main] with library path .\jcef_build\native\Release
Added scheme search://
Added scheme client://
AppHandler.stateHasChanged: INITIALIZED
BrowserFrame.onAfterCreated id=1

Re: OSR and the calling of onAfterCreated

PostPosted: Mon Oct 12, 2020 10:12 am
by Czarek
Anything interesting in logs when the issue occurs?

Re: OSR and the calling of onAfterCreated

PostPosted: Mon Oct 12, 2020 10:18 am
by julianave1987
Unfortunately not. No exceptions get thrown, or at least no negative log output. I'm really helpless on this :(

I once let my application sit for ~50 minutes and then FINALLY onAfterCreated had been called, but when I used that part of my application it wasn't rendered properly.

Re: OSR and the calling of onAfterCreated

PostPosted: Mon Oct 12, 2020 10:35 am
by Czarek
How are you running CEF message loop?

Re: OSR and the calling of onAfterCreated

PostPosted: Mon Oct 12, 2020 11:05 am
by magreenblatt
@julianave1987 the output that you show above looks correct for the detailed app. How does the app behave?

Re: OSR and the calling of onAfterCreated

PostPosted: Mon Oct 12, 2020 11:17 am
by julianave1987
Czarek wrote:How are you running CEF message loop?


We wrote a public class which extends the CefMessageRouterHandlerAdapter:

public class MessageRouterHandler extends CefMessageRouterHandlerAdapter

magreenblatt wrote:@julianave1987 the output that you show above looks correct for the detailed app. How does the app behave?


I guess, it behaves normally. How I would expect it to. A browser I can use to go to google or amazon. Buttons work and everything.



Some more info regarding the program. We have a jar file which gets called in a bat file. In our java code the same jar is called again with different parameters. In this second running of the jar file is where we initialize a seperate part of our program which is used for screen recording. Here is where we initialize and use the JCEF code to create a browser frame (for later) - and where it hangs

Re: OSR and the calling of onAfterCreated

PostPosted: Mon Oct 12, 2020 11:30 am
by magreenblatt
In this second running of the jar file is where we initialize a seperate part of our program which is used for screen recording. Here is where we initialize and use the JCEF code to create a browser frame (for later) - and where it hangs

How are you running the jar file this second time?

Re: OSR and the calling of onAfterCreated

PostPosted: Mon Oct 12, 2020 11:43 am
by julianave1987
magreenblatt wrote:How are you running the jar file this second time?

Through a ProcessBuilder with a big list of arguments starting with java.exe including the -jar creator.jar argument.