I run debian stable on several boxes.
This morning I installed some security updates affecting Java on different boxes.
The problem is that now I have some issues in using RJSDMX on one of them, despite they all having similar configurations.
https://github.com/amattioc/SDMX
which is a tool (available in many languages) to download statistical data from different providers.
Part of the discussion is available here
https://github.com/amattioc/SDMX/issues/222
(including the suggestion to resort to the development version of RJSDMX).
The situation is the following: if I install the development version of RJSDMX with
require(devtools)
install_github(repo = "amattioc/SDMX", subdir = "RJSDMX")
and then I try running the following short script
library(tidyverse)
library(RJSDMX)
estat_retrieval <- function(dataset_query){
res <- getTimeSeriesTable('EUROSTAT', dataset_query
) |> as_tibble()
return(res)
}
query <- "ert_bil_eur_a/A.AVG.NAC.RON"
all_rates_ini <- estat_retrieval(query)
all_rates_ini
sessionInfo()
I get this output
── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ──
✔ ggplot2 3.4.0 ✔ purrr 1.0.1
✔ tibble 3.1.8 ✔ dplyr 1.1.0
✔ tidyr 1.3.0 ✔ stringr 1.5.0
✔ readr 2.1.3 ✔ forcats 0.5.2
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
Loading required package: rJava
Loading required package: zoo
Attaching package: ‘zoo’
The following objects are masked from ‘package:base’:
as.Date, as.Date.numeric
2023-01-30T15:40:23.983 INFO [it.bancaditalia.oss.sdmx.client.RestSdmxClient runQuery] Contacting web service with query: https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/dataflow/ESTAT/ert_bil_eur_a/latest
2023-01-30T15:40:24.448 SEVERE [it.bancaditalia.oss.sdmx.client.RestSdmxClient runQuery] Exception. Class: javax.net.ssl.SSLHandshakeException - Message: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, :
it.bancaditalia.oss.sdmx.exceptions.SdmxIOException: Connection problems while talking to endpoint: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> sessionInfo()
R version 4.2.2 (2022-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 11 (bullseye)
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.13.so
locale:
[1] LC_CTYPE=en_GB.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_GB.UTF-8 LC_COLLATE=en_GB.UTF-8
[5] LC_MONETARY=en_GB.UTF-8 LC_MESSAGES=en_GB.UTF-8
[7] LC_PAPER=en_GB.UTF-8 LC_NAME=en_GB.UTF-8
[9] LC_ADDRESS=en_GB.UTF-8 LC_TELEPHONE=en_GB.UTF-8
[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=en_GB.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RJSDMX_3.0-4 zoo_1.8-11 rJava_1.0-6 forcats_0.5.2
[5] stringr_1.5.0 dplyr_1.1.0 purrr_1.0.1 readr_2.1.3
[9] tidyr_1.3.0 tibble_3.1.8 ggplot2_3.4.0 tidyverse_1.3.2
loaded via a namespace (and not attached):
[1] pillar_1.8.1 compiler_4.2.2 cellranger_1.1.0
[4] dbplyr_2.2.1 tools_4.2.2 lattice_0.20-45
[7] timechange_0.1.1 googledrive_2.0.0 jsonlite_1.8.4
[10] lubridate_1.9.0 lifecycle_1.0.3 gargle_1.2.1
[13] gtable_0.3.1 pkgconfig_2.0.3 rlang_1.0.6
[16] reprex_2.0.2 DBI_1.1.3 cli_3.6.0
[19] haven_2.5.1 xml2_1.3.3 withr_2.5.0
[22] httr_1.4.4 generics_0.1.3 vctrs_0.5.2
[25] fs_1.5.2 hms_1.1.2 googlesheets4_1.0.1
[28] grid_4.2.2 tidyselect_1.2.0 glue_1.6.2
[31] R6_2.5.1 fansi_1.0.4 readxl_1.4.1
[34] tzdb_0.3.0 modelr_0.1.9 magrittr_2.0.3
[37] backports_1.4.1 scales_1.2.1 ellipsis_0.3.2
[40] rvest_1.0.3 assertthat_0.2.1 colorspace_2.0-3
[43] utf8_1.2.2 stringi_1.7.8 munsell_0.5.0
[46] broom_1.0.1 crayon_1.5.2
Apparently it is an issue with updating some Java certificates, but I have no idea about how to do that.
Running
$ sudo R CMD javareconf
Java interpreter : /usr/lib/jvm/default-java/bin/java
Java version : 11.0.18
Java home path : /usr/lib/jvm/default-java
Java compiler : /usr/lib/jvm/default-java/bin/javac
Java headers gen.: /usr/bin/javah
Java archive tool: /usr/lib/jvm/default-java/bin/jar
trying to compile and link a JNI program
detected JNI cpp flags : -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
detected JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm
gcc -I"/usr/share/R/include" -DNDEBUG -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux -fpic -g -O2 -ffile-prefix-map=/home/jranke/git/r-backports/bullseye/r-base-4.2.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c conftest.c -o conftest.o
gcc -shared -L/usr/lib/R/lib -Wl,-z,relro -o conftest.so conftest.o -L/usr/lib/jvm/default-java/lib/server -ljvm -L/usr/lib/R/lib -lR
JAVA_HOME : /usr/lib/jvm/default-java
Java library path: $(JAVA_HOME)/lib/server
JNI cpp flags : -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm
Updating Java configuration in /usr/lib/R
Done.
did not help. Any suggestion is really appreciated!
I discovered the solution was a one-liner
sudo update-ca-certificates -f
as in
https://stackoverflow.com/a/43873005
Related
As part of my ansible setup I'm currently checking in the VM what is the Java version and if that's not the one expected then download and install that version. I have given the standard regex to find the Java version but that step is getting skipped
- name: "[install] Check for Java install"
shell: "java -version 2>&1 | grep version | awk '{print $3}'"
changed_when: False
register: java_installed
ignore_errors: True
- when: java_installed.stdout != "17.0.2"
block:
- debug:
msg: "Java is not installed"
- name: "[install] Installing Java 17"
become: true
yum:
name: /var/tmp/jdk-17_linux-x64_bin.rpm
state: present
But these steps are getting skipped while executing
TASK [java : [install] Check for Java install] *****************************************************************************************************************************
skipping: [VM name hidden by me ]
TASK [java : debug] ********************************************************************************************************************************************************
skipping: [VM name hidden by me]
TASK [java : [install] Installing Java 17] *********************************************************************************************************************************
skipping: [VM name hidden by me]
when I execute
java -version 2>&1 | grep version | awk '{print $3}'
This is what I get
"1.8.0_312"
Does anyone know why it's getting skipped. Thanks
Note: below is an answer to your direct problem. Meanwhile if java was installed as a system package, I strongly suggest you have a look at the answer by #Jaay to get the version directly from package facts rather than using shell/command
This is what I get
"1.8.0_312"
As you can see, the quotes are part of the output. Hence if you debug java_installed.stdout you get (ran on my local machine with java 11):
TASK [debug] ********************************************************************************************************************
ok: [localhost] => {
"java_installed.stdout": "\"11.0.15\""
}
A simple workaround is to read the incoming value as json. The following does the job (once again customized for my local machine to test and using the version test as good practice)
---
- hosts: localhost
gather_facts: false
tasks:
- name: "[install] Check for Java install"
shell: "java -version 2>&1 | grep version | awk '{print $3}'"
changed_when: false
failed_when: false
register: java_installed
- name: show the raw and refactored captured var
vars:
my_msg:
- "Raw value for version is: {{ java_installed.stdout }}"
- "Refactored value for version is: {{ java_installed.stdout | from_json }}"
debug:
msg: "{{ my_msg }}"
- when: java_installed.stdout | from_json is version("11.0.15", "==")
debug:
msg: "Java 11 is installed"
- when: java_installed.stdout | from_json is not version("17.0.2", "==")
debug:
msg: "Java 17 is not installed"
and gives
PLAY [localhost] ****************************************************************************************************************
TASK [[install] Check for Java install] *****************************************************************************************
ok: [localhost]
TASK [show the raw and refactored captured var] *********************************************************************************
ok: [localhost] => {
"msg": [
"Raw value for version is: \"11.0.15\"",
"Refactored value for version is: 11.0.15"
]
}
TASK [debug] ********************************************************************************************************************
ok: [localhost] => {
"msg": "Java 11 is installed"
}
TASK [debug] ********************************************************************************************************************
ok: [localhost] => {
"msg": "Java 17 is not installed"
}
PLAY RECAP **********************************************************************************************************************
localhost : ok=4 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
Not really a big fan of shell command in Ansible, you can use the package facts core plugin to retrieve the installed Java version. This way you should get rid of the outputs problem using shell command
- name: get the rpm or apt package facts
package_facts:
manager: "auto"
- name: show Java version
debug: var=ansible_facts.packages.jdk[0].version
PS: This will work only if java is installed with a package manager (not just copied in your system)
Can't compile Apk Folder with Apktool 2.6.0
Executing command: java.exe -jar "C:\Users\Acer\Desktop\ApkEastTool\Apktool\apktool_2.6.0.jar" b -c -o "C:\Users\Acer\Desktop\ApkEastTool\2-Recompiled APKs\BlackMart1.apk" "C:\Users\Acer\Desktop\ApkEastTool\1-Decompiled APKs\BlackMart1"
-c/--copy-original has been deprecated. Removal planned for v3.0.0 (#2129)
I: Using Apktool 2.6.0
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether resources has changed...
I: Building resources...
W: C:\Users\Acer\Desktop\ApkEastTool\1-Decompiled APKs\BlackMart1\res\layout-v26\abc_screen_toolbar.xml:5: error: No resource identifier found for attribute 'keyboardNavigationCluster' in package 'android'
W:
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\Acer\AppData\Local\Temp\brut_util_Jar_20857175931725347302526534608423442043.tmp, p, --forced-package-id, 127, --min-sdk-version, 18, --target-sdk-version, 21, --version-code, 1, --version-name, 1.0, --no-version-vectors, -F, C:\Users\Acer\AppData\Local\Temp\APKTOOL4528009833084164014.tmp, -e, C:\Users\Acer\AppData\Local\Temp\APKTOOL7021044171571349607.tmp, -0, arsc, -I, C:\Users\Acer\AppData\Local\apktool\framework\1.apk, -S, C:\Users\Acer\Desktop\ApkEastTool\1-Decompiled APKs\BlackMart1\res, -M, C:\Users\Acer\Desktop\ApkEastTool\1-Decompiled APKs\BlackMart1\AndroidManifest.xml]
Compile failed. Please read the log
I have Java8 321 and JavaSE development kit 8 202
I'm using mailR for sending emails from within R. This used to work just fine on other machines. That was before my Mac Mini. I can run install.packages(c("rJava", "mailR")) without any problems. However when sending, I run into errors that (based on what has been asked before) seem to be related to Java.
Here is my code:
library(rJava)
library(mailR)
smtp_list = list(host.name = "smtp.sendgrid.net",
port = 587,
user.name = "XXX",
passwd = "XXX",
ssl = T)
body_html_test <- "<html><meta charset='UTF-8'><p>Hello<p></html>"
send.mail(from = "some#adress.com",
to = "my#adress.com",
subject = "This is a test",
body = body_html_test,
encoding="utf-8",
html = TRUE,
smtp = smtp_list,
authenticate = TRUE,
send = TRUE)
NULL
org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtp.sendgrid.net:465
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1410)
at org.apache.commons.mail.Email.send(Email.java:1437)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at RJavaTools.invokeMethod(RJavaTools.java:386)
Caused by: javax.mail.MessagingException: Could not connect to SMTP host: smtp.sendgrid.net, port: 465;
nested exception is:
javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2055)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:697)
at javax.mail.Service.connect(Service.java:386)
at javax.mail.Service.connect(Service.java:245)
at javax.mail.Service.connect(Service.java:194)
at javax.mail.Transport.send0(Transport.java:253)
at javax.mail.Transport.send(Transport.java:124)
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1400)
... 6 more
Caused by: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
at sun.security.ssl.HandshakeContext.<init>(HandshakeContext.java:171)
at sun.security.ssl.ClientHandshakeContext.<init>(ClientHandshakeContext.java:101)
at sun.security.ssl.TransportContext.kickstart(TransportContext.java:238)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:394)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:373)
at com.sun.mail.util.SocketFetcher.configureSSLSocket(SocketFetcher.java:543)
at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:348)
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:215)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2019)
... 13 more
Error: EmailException (Java): Sending the email to the following server failed : smtp.sendgrid.net:465
At first I was inclined to believe that this has to do with my mailclient but based on what others have asked, this seems to be related to java. The fact that this script runs smoothly on other machines points into that direction as well.
OS version:
$ sw_vers
ProductName: macOS
ProductVersion: 11.2
BuildVersion: 20D64
Java version:
$ java -version
java version "1.8.0_291"
Java(TM) SE Runtime Environment (build 1.8.0_291-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.291-b10, mixed mode)
R version:
$ R
R version 4.0.5 (2021-03-31) -- "Shake and Throw"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin17.0 (64-bit)
R Java configuration:
$ R CMD javareconf
Java interpreter : /usr/bin/java
Java version : 1.8.0_291
Java home path : /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
Java compiler : /usr/bin/javac
Java headers gen.: /usr/bin/javah
Java archive tool: /usr/bin/jar
trying to compile and link a JNI program
detected JNI cpp flags :
detected JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" - DNDEBUG -I/usr/local/include -fPIC -Wall -g -O2 -c conftest.c -o conftest.o
conftest.c:1:10: fatal error: 'jni.h' file not found
#include <jni.h>
^~~~~~~
1 error generated.
make: *** [conftest.o] Error 1
Unable to compile a JNI program
JAVA_HOME : /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
Java library path:
JNI cpp flags :
JNI linker flags :
Updating Java configuration in /Library/Frameworks/R.framework/Resources
Done.
Thanks in advance for help.
I have setup my java package where I have written few java methods.
I want to call those methods from Ruby on Rails website but it's not working. I'm trying to do one POC for it but it's not working.
I installed jruby for it but build is failing. It's not able to find gems.
ruby gems environment:
gem env
RubyGems Environment:
RUBYGEMS VERSION: 3.0.6
RUBY VERSION: 2.5.3 (2019-09-09 patchlevel 0) [java]
INSTALLATION DIRECTORY: /local/home/skkundra/.rvm/gems/jruby-9.2.6.0
USER INSTALLATION DIRECTORY: /home/skkundra/.gem/jruby/2.5.0
RUBY EXECUTABLE: /local/home/skkundra/.rvm/rubies/jruby-9.2.6.0/bin/jruby
GIT EXECUTABLE: /usr/bin/git
EXECUTABLE DIRECTORY: /local/home/skkundra/.rvm/gems/jruby-9.2.6.0/bin
SPEC CACHE DIRECTORY: /home/skkundra/.gem/specs
SYSTEM CONFIGURATION DIRECTORY:
/local/home/skkundra/.rvm/rubies/jruby-9.2.6.0/etc
- RUBYGEMS PLATFORMS:
- ruby
- universal-java-1.8
GEM PATHS:
/local/home/skkundra/.rvm/gems/jruby-9.2.6.0
/local/home/skkundra/.rvm/rubies/jruby-
9.2.6.0/lib/ruby/gems/shared
GEM CONFIGURATION:
:update_sources => true
:verbose => true
:backtrace => false
:bulk_threshold => 1000
"install" => "--no-rdoc --no-ri"
"update" => "--no-rdoc --no-ri"
REMOTE SOURCES:
https://rubygems.org/
SHELL PATH:
/home/skkundra/.rvm/gems/jruby-9.2.6.0/bin
/home/skkundra/.rvm/gems/jruby-9.2.6.0#global/bin
/home/skkundra/.rvm/rubies/jruby-9.2.6.0/bin
/home/skkundra/.rvm/bin
/home/skkundra/.toolbox/bin
/usr/NX/bin
/usr/local/bin
/bin
/usr/bin
/home/skkundra/bin
/usr/local/sbin
/usr/sbin
/sbin
I'm getting
/home/skkundra/VPSInvoiceCentralWebsite/env/VPSInvoiceCentralWebsite-1.0/runtime/ruby2.3.x/lib/ruby/2.3.0/rubygems/dependency.rb:319:in `to_specs': Could not find 'thread_safe' (~> 0.1) - did find: [thread_safe-0.3.6-java] (Gem::LoadError)
I want to use jTSS on my Ubuntu 14.04 64bits, I have an hardware TPM in version 1.2.
I installed the .deb like said in the section 4.3 http://trustedjava.sourceforge.net/index.php?item=jtss/readme
I started the daemon : jtss (TCS running)
But if I want to run the tests in your packages (run_tests_simple.sh or run_test.sh) I have the error :
"Error! No TSP-TCS binding could be initialized. Both jTSS Wrapper and jTSS were tried. Check the TSP configuration file."
And with this command 'jtt tpm_version', I have the same error :
---------------------
IAIK Java TPM Tools
---------------------
16:34:56:631 [ERROR] TcTcsBindingSoap::connect (116): There seems no TCS running
16:34:56:647 [ERROR] TcTcsBindingSoap::connect (116): There seems no TCS running
iaik.tc.tss.api.exceptions.tsp.TcTspException:
TSS Error:
error layer: 0x3000 (TSP)
error code (without layer): 0x0103
error code (full): 0x3103a
error message: Core Service connection failed.
at iaik.tc.tss.impl.java.tsp.tcsbinding.soapservice.TcTcsBindingSoap.connect(TcTcsBindingSoap.java:117)
at iaik.tc.tss.impl.java.tsp.internal.TcTspInternal.TspContextConnect_Internal(TcTspInternal.java:368)
at iaik.tc.tss.impl.java.tsp.TcContext.connect(TcContext.java:174)
at iaik.tc.apps.jtt.tpm.TpmVersion.execute(TpmVersion.java:68)
at iaik.tc.utils.cmdline.SubCommand.run(SubCommand.java:69)
at iaik.tc.utils.cmdline.SubCommandParser.parse(SubCommandParser.java:41)
at iaik.tc.apps.JTpmTools.main(JTpmTools.java:224)
I removed trousers, but keep in /etc/group : tss:x:126:root,jtss
Maybe your core service daemon was not started properly and isn't running. Have you seen this message on Trustedjava-support mailinglist?
Since you are using Ubuntu 14.04, you will have a jsvc version >= 1.0.11
Try to add the line
-cwd "${ROOT}/soap" \
to the jsvc call in the start() function in /etc/init.d/jtss.
The call should look something like this after editing:
${JSVC_EXECUTABLE} -pidfile "${PIDFILE}" \
-cwd "${ROOT}/soap" \
-outfile "${LOGFILE}" \
-errfile '&1' \
-Djtss.tsp.ini.file="${LIBS}/ini/jtss_tsp.ini" \
-Djtss.tcs.ini.file="${LIBS}/ini/jtss_tcs.ini" \
${USER:+-user "${USER}"} \
-wait ${TIMEOUT} \
-cp ${CLASSPATH_SOAP} ${EXECUTABLE}