GOOGLE Photos API: Getting io.grpc.StatusRuntimeException: UNAVAILABLE: io exception on listAlbums - google-photos-api

Straight-up java code, running jdk 10. On Linux Mint 18.
Have connected to GoogleApis for google drive no problems.
Did all the google setup for GooglePhotos that I did for GoogleDrives
Now trying to do a simple photosClient.listAlbums() and getting exception:
io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
io.grpc.netty.shaded.io.netty.channel.AbstractChannel$AnnotatedNoRouteToHostException: null: photoslibrary.googleapis.com/2404....
in my gradle file:
compile 'com.google.api-client:google-api-client:1.24.1'
compile 'com.google.oauth-client:google-oauth-client:1.24.1'
compile 'com.google.oauth-client:google-oauth-client-jetty:1.24.1'
compile 'com.google.http-client:google-http-client:1.24.1'
compile 'com.google.apis:google-api-services-drive:v3-rev110-1.23.0'

It looks like the problem is with JDK compatibility issues. When we use Java 7 jdk, things work fine. When we switch to Java 10, that's when the code breaks. We have to be on Java 10 for containerization.

Related

JAVA: How to make java EXE run on different PCs

I created mini project on Java. Using Eclipse I converted my project to .JAR and later .JAR to .EXE using launch4j 3.12 . On my PC exe work correct. But if I share my file to my friends which, File give a error:
"A JNI Error has occurred, please check your installation and try again".
And in launch4j's console print:
"Exception in thread "main" java.lang.UnsupportedClassVersionError: Game has been compiled by a more recent version of the Java Runtime (class file version 59.0), this version of the Java Runtime only recognizes class file versions up to 52.0".
But I specified the path to jre. How can I fix this problem and launch my Java Project on my friends PCs? My launch4j config:
<?xml version="1.0" encoding="UTF-8"?>
<launch4jConfig>
<dontWrapJar>false</dontWrapJar>
<headerType>gui</headerType>
<jar>C:\Users\Admin\Desktop\JavaProject\JARFile.jar</jar>
<outfile>C:\Users\Admin\Desktop\JavaProject\game.exe</outfile>
<errTitle></errTitle>
<cmdLine></cmdLine>
<chdir>.</chdir>
<priority>normal</priority>
<downloadUrl>http://java.com/download</downloadUrl>
<supportUrl></supportUrl>
<stayAlive>false</stayAlive>
<restartOnCrash>false</restartOnCrash>
<manifest></manifest>
<icon></icon>
<jre>
<path>javafiles/jre</path>
<bundledJre64Bit>true</bundledJre64Bit>
<bundledJreAsFallback>true</bundledJreAsFallback>
<minVersion>1</minVersion>
<maxVersion></maxVersion>
<jdkPreference>preferJre</jdkPreference>
<runtimeBits>64/32</runtimeBits>
</jre>
</launch4jConfig>
the problem is that your program requires at least java version 59 (java 15) while on your friends computers only java version 52 (java 8) is installed.
so there are two solutions:
compile with older java version if you do not need newer language features
upgrade to java 15 jre/jdk on your friends computers that want to run your program

How can I solve logstash error during installation time?

I am using JDK 15 and trying to install logstash. But when I use the command with configuration file I am getting this error -
"Error: Could not create the Java Virtual Machine. Error: A fatal
exception has occurred. Program will exit."
I have added an image of the error below. Please help me to solve the error.
Logstash does not support Java 15 yet, there is an open issue about it, but you won't be able to use Java 15 to run logstash until support is available.
You will need to use another Java version, currently logstash supports Java 8, Java 11 or Java 14.
You can also unset the JAVA_HOME environment variable and logstash will use its bundled java, which is AdoptOpenJDK 11.

xbuild throws an error dont know how to handle globalsection

My app in (perfectly working on windows 10 64bit on .NET 4.6) does not compile on linux. I followed a guide that states to run xbuild /p:VbcToolExe=vbnc.exe NAME.sln
That gave this error:
home/icbosk/Desktop/WindowsApp1/watch.sln: warning : Don't know how to handle GlobalSection ExtensibilityGlobals, Ignoring.
Then it fails.
I don't know how to do make this work on linux.
Here is the full output with diagnostics:
https://pastebin.com/WB5p9Zsi

Getting 'java.lang.RuntimeException: No toolkit found' error on running javafx application with java11

We recently migrated from java 8 to openJdk11. Now I am trying to test my application on windows and ubuntu with using openJdk installed on both OS. I'm able to run it on ubuntu. But same is not executing in windows10 with java11.Error_Message:
java.lang.RuntimeException: No toolkit found
at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:272)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
at java.base/java.lang.Thread.run(Unknown Source)
It is possible that JDK, which you have installed on your Windows system, doesn't include JavaFX and you should install it externally.
Read more here:
Where can I get pre-built JavaFX libraries for OpenJDK (Windows)
or
https://stackoverflow.com/a/19529820
or
Javafx: No toolkit found exception
.
I am not sure how the differnences between Linux and Windows come into place, but in general com.sun.javafx.tk.Toolkitis not accesible anymore since Java 9. So the behaviour on Windows throwing an exception is correct, and you need to find another solution for whatever you are using theToolkit-class for.

JasperReports failing on a linux machine

I have a dev PC with Win7 and Java HotSpot(TM) 64-Bit Server VM (build 23.1-b03, mixed mode) installed and a test server with Ubuntu and OpenJDK Runtime Environment (IcedTea6 1.12.3) (6b27-1.12.3-0ubuntu1 ~12.04.1). I also have a Grails application with a jasper plugin to print some pdf files. While it works on the dev PC, on the test server it fails with this exception:
ERROR errors.GrailsExceptionResolver - NoSuchMethodError occurred when processing request: [GET] /test/printer/print
com.lowagie.text.pdf.PdfWriter.setRgbTransparencyBlending(Z)V. Stacktrace follows:
org.codehaus.groovy.grails.web.servlet.mvc.exceptions.ControllerExecutionException: Executing action [print] of controller [com.***.PrinterController] caused exception: Runtime error executing action
I have read so far that this may be caused by an inapropriate version of iText library, but the same itext.jar is included into the plugin on both machines. I'll appreciate any ideas that may help make this plugin work
Finally discovered that the project had a pdf 0.6 plugin that contained an itext 2.0.8 library which was used instead of the expected itext 2.1.7

Resources