B4J Question How do I run Email GoogleOAuth2 on Pi

Noble

Member
Licensed User
Longtime User
I am using B4J v6.30 (Was using v6.10 same), I load the GoogleContacts Demo program on my Windows 10 B4J desktop, and it works as it should. (I did get my Client ID and Client Secret from Google). When I connect to the Raspberry Pi Model 3B the program loads to the Pi, starts and displays the Screen (all normal) then when I click the Get Data button, the program fails with following error in the log.

Waiting for debugger to connect...
Program started.
java.lang.Exception: No web browser found
at javafx.graphics/com.sun.javafx.application.HostServicesDelegate$StandaloneHostService.showDocument(HostServicesDelegate.java:183)
at javafx.graphics/javafx.application.HostServices.showDocument(HostServices.java:122)
at anywheresoftware.b4j.objects.JFX.ShowExternalDocument(JFX.java:121)
at b4j.example.googleoauth2._authenticate(googleoauth2.java:201)
at b4j.example.googleoauth2._getaccesstoken(googleoauth2.java:126)
at b4j.example.main$ResumableSub_btnGetData_Action.resume(main.java:135)
at b4j.example.main._btngetdata_action(main.java:110)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:625)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:234)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:168)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:90)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:94)
at anywheresoftware.b4a.BA$1.run(BA.java:215)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$9(PlatformImpl.java:418)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:417)
at javafx.graphics/com.sun.glass.ui.monocle.RunnableProcessor.runLoop(RunnableProcessor.java:92)
at javafx.graphics/com.sun.glass.ui.monocle.RunnableProcessor.run(RunnableProcessor.java:51)
at java.base/java.lang.Thread.run(Thread.java:844)

Makes me think I'm missing something I should have loaded on the Pi.
Thank you for your help
 

Noble

Member
Licensed User
Longtime User
Erel, Thank you for your response - I still need a push in the right direction.

I found the token file ("oauth2token.dat") in the DataFolder on the PC and moved to the DataFolder on the RPi
Very first time after I move the token file to the RPi I get a different error:
javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
....
Token reset!!!
Online data not available.

Each time I run the GoogleContacts program again I get the:
java.lang.Exception: No web browser found
....

Looks like the token gets me by the "No web browser found" yet is not valid for ssl and then it's reset, thus I can't use it again.

root@Krispi:~# java -version
openjdk version "10.0.1-BellSoft" 2018-04-17
OpenJDK Runtime Environment (build 10.0.1-BellSoft+0)
OpenJDK Server VM (build 10.0.1-BellSoft+0, mixed mode)
root@Krispi:~#
 
Upvote 0

Noble

Member
Licensed User
Longtime User
I would like to know the preferred version of OS and Java that I should be installing on my RPi 3 B for for running the Google Contacts code.
After Erel's last post, I have tried several to no avail.
Is there a link (that's current ) that gives this information.
 
Upvote 0

Noble

Member
Licensed User
Longtime User
Erel, I have been using the:
2018-04-18-raspbian-strech.img
and I believe the link you suggest is the same place I have been getting Java, I'm using:
jdk-8u172-linux-arm32-vfp-hflt.gz
and tried the 171 version.
I have also tried adding the openjfx-8u40-sdk-overlay-linux-armv6hf.zip

any suggestions or loading procedures would help.
 
Upvote 0

Noble

Member
Licensed User
Longtime User
I'm still struggling with this, I'm trying to run the GoogleContacts example on a RPi.
I have tried the suggestions Erel has provided, the last one was over my head.
I figured if others were getting this working, then it must be the OS or Java options I was loading.
Currently I'm using:
2018-04-18-raspbian-strech.img
jdk-8u171-linux-arm32-vfp-hflt.gz (same version running on my PC)
openjfx-8u60-sdk-overlay-linux-armv6hf.zip (also have tried the 8u40-sdk)

I'm hoping someone can see an error in what I'm doing?

I get log errors of:

java.lang.ClassNotFoundException: com.sun.deploy.uitoolkit.impl.fx.HostServicesFactory
....
Error occurred on line: 103 (GoogleOAuth2) <-- This line is fx.ShowExternalDocument(link)
java.lang.NullPointerException
at javafx.application.HostServices.showDocument(HostServices.java:127)
at anywheresoftware.b4j.objects.JFX.ShowExternalDocument(JFX.java:121)
....

Any help would be appreciated. Thank you.
 
Upvote 0
Top