Jsoup in Grails4 with OpenJDK - ssl

I am using org.jsoup:jsoup:1.12.1:
Document doc = Jsoup.connect("https://example.com").get()
When I had tried JAVA: 8.0.232-open, 9.0.4-open, 11.0.5-open I received
javax.net.ssl.SSLHandshakeException: No subject alternative DNS name matching <domain> found.
exception.
Project is using Grails4 and it's not building with JAVA > 12, cause in case JAVA13+ it throws:
1 error (NOTE: Stack trace has been filtered. Use --verbose to see
entire trace.)
org.codehaus.groovy.control.MultipleCompilationErrorsException:
startup failed: General error during semantic analysis: Unsupported
class file major version 57
java.lang.IllegalArgumentException: Unsupported class file major
version 57
From what I have found it's issue with JAVA itself, not with jsoup: JSoup javax.net.ssl.SSLHandshakeException: No subject alternative DNS name matching <url> found
I have tried Gradle: 3.5.1 and 6.1-rc-2 but without success.
How to resolve it?

Related

common:linkPodReleaseFrameworkIos e: Compilation failed: Assertion failed

I have a problem with archiving(realising my app).
I'm using the following dependency versions:
kotlin=1.6.10
ktor=2.0.0-beta-1
kotlinx.datetime=0.2.1
kotlinx.serialization=1.3.2
Tried to change versions of Kotlin serialisation plugin, or date time plugin but it hasn't fixed the issue. Any ideas where is the problem?
I'm receiving error:
Task :common:linkPodReleaseFrameworkIos
e: Compilation failed: Assertion failed
* Source files:
* Compiler version info: Konan: 1.6.0 / Kotlin: 1.6.0
* Output kind: FRAMEWORK
e: java.lang.AssertionError: Assertion failed
at org.jetbrains.kotlin.backend.konan.objcexport.MethodBridgeKt.parametersAssociated(MethodBridge.kt:120)
at org.jetbrains.kotlin.backend.konan.llvm.objcexport.ObjCExportCodeGeneratorKt.generateKotlinToObjCBridge(ObjCExportCodeGenerator.kt:1029)
at org.jetbrains.kotlin.backend.konan.llvm.objcexport.ObjCExportCodeGeneratorKt.createReverseAdapter(ObjCExportCodeGenerator.kt:1180)
at org.jetbrains.kotlin.backend.konan.llvm.objcexport.ObjCExportCodeGeneratorKt.createReverseAdapters(ObjCExportCodeGenerator.kt:1463)
at org.jetbrains.kotlin.backend.konan.llvm.objcexport.ObjCExportCodeGeneratorKt.createReverseAdapters$getOrCreateFor(ObjCExportCodeGenerator.kt:1404)
at org.jetbrains.kotlin.backend.konan.llvm.objcexport.ObjCExportCodeGeneratorKt.createReverseAdapters(ObjCExportCodeGenerator.kt:1407)
at org.jetbrains.kotlin.backend.konan.llvm.objcexport.ObjCExportCodeGeneratorKt.access$createReverseAdapters(ObjCExportCodeGenerator.kt:1)
at org.jetbrains.kotlin.backend.konan.llvm.objcexport.ObjCExportCodeGenerator.generateTypeAdaptersForKotlinTypes(ObjCExportCodeGenerator.kt:262)
at org.jetbrains.kotlin.backend.konan.llvm.objcexport.ObjCExportCodeGenerator.generateTypeAdapters(ObjCExportCodeGenerator.kt:289)
at org.jetbrains.kotlin.backend.konan.llvm.objcexport.ObjCExportCodeGenerator.generate$backend_native_compiler(ObjCExportCodeGenerator.kt:300)
at org.jetbrains.kotlin.backend.konan.objcexport.ObjCExport.generate$backend_native_compiler(ObjCExport.kt:103)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor$visitModuleFragment$2.invoke(IrToBitcode.kt:433)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor$visitModuleFragment$2.invoke(IrToBitcode.kt:431)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.runAndProcessInitializers(IrToBitcode.kt:370)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.visitModuleFragment(IrToBitcode.kt:431)
at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitModuleFragment(IrElementVisitorVoid.kt:28)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.visitModuleFragment(IrToBitcode.kt:204)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.visitModuleFragment(IrToBitcode.kt:204)
This is a bug, already described at https://youtrack.jetbrains.com/issue/KT-49395.
From what I see in this ticket, the problem should be already fixed in Kotlin 1.6.20-M1.If you can use preview versions in your project, consider trying it as described here: https://blog.jetbrains.com/kotlin/2022/02/kotlin-1-6-20-m1-released/.

sbt.compiler.EvalException: Type Error in Expression

I'm quite new with IntelliJ (and on this site too tbh) and have been using it for only a couple of days. When I tried to build my project this exception came up. I tried to solve the problem but to no avail. I tried to see if the same problem occured on a newly created project and yes it does. So the code I've written should have no influence on the build. IƤve also checked if there might be a problem with the sbt version but I am up to date.
This is what the error looks like. I have absolutely no clue how to solve this so any help would be very much appreciated.
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[warn] Executing in batch mode.
[warn] For better performance, hit [ENTER] to switch to interactive mode, or
[warn] consider launching sbt without any commands, or explicitly passing 'shell'
[info] Loading global plugins from C:\Users\Johner-Institut\.sbt\0.13\plugins
Waiting for lock on C:\Users\Johner-Institut\.ivy2\.sbt.ivy.lock to be available...
[info] Loading project definition from C:\Users\Johner-Institut\Desktop\Project\project
C:\Users\Johner-Institut\Desktop\Project\build.sbt:5: error: recursive value project needs type
lazy val `project` = (project in file(".")).enablePlugins(PlayScala)
^
sbt.compiler.EvalException: Type error in expression
[error] sbt.compiler.EvalException: Type error in expression
[error] Use 'last' for the full log.
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?
Don't use project as a name for sbt project, that's why the recursion error. Try something like:
lazy val root = (project in file(".")).enablePlugins(PlayScala)

OpenJDK 9 SSL error with gradlew

I recently upgraded to OpenJDK 9 but am now encountering errors with CI build.
Exception in thread "main" javax.net.ssl.SSLException:
java.lang.RuntimeException: Unexpected error:
java.security.InvalidAlgorithmParameterException: the trustAnchors
parameter must be non-empty
I tried to symlinking
/usr/lib/jvm/java-9-openjdk-amd64/lib/security/cacerts
/etc/ssl/certs/java/cacerts
But did not work, can confirm Slim version works but i'd rather not use this. Is there any quick hack or work around to use until the issue is resolved down the line?

Build using gradle in cmd fail

Error message
Error listing versions of com.android.tools.build:gradle:0.4+ using class org.gradle.api.internal.artifacts.repositories.resolver.MavenVersionLister$1. Will attempt an alternate way to list versions. This behaviour has been deprecated and is scheduled to be removed in Gradle 2.0
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'TestMain'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:0.4+.
Required by:
:TestMain:unspecified
> Failed to list versions for com.android.tools.build:gradle:0.4+.
> Could not list versions using M2 pattern 'http://repo1.maven.org/maven2/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]
'.
> Could not GET 'http://repo1.maven.org/maven2/com/android/tools/bui
ld/gradle/'.
> Connection to http://repo1.maven.org refused
Am i using incorrect sdk?
You can follow the this tutorial.
http://www.vogella.com/articles/AndroidBuild/article.html
Then turn off your firewall and antivirus software.

NullPointerException org.gradle.wrapper.BootstrapMainStarter.findLauncherJar(BootstrapMainStarter.java:37)

Got the following stacktrace when launching gradle 1.1, anyone know how to resolve them:
Exception in thread "main" java.lang.NullPointerException
at org.gradle.wrapper.BootstrapMainStarter.findLauncherJar(BootstrapMainStarter.java:37)
at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:28)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:130)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:47)
I think the automatic unzip of the dists/gradle-1.1-bin/13d7lnhcrghv2i5e54el41jpgr/gradle-1.1-bin.zip might be failing. I checked permissions and that I have access to that directory.
If I unzip manually, then I get the following error:
Exception in thread "main" java.lang.RuntimeException: Gradle distribution 'http://services.gradle.org/distributions/gradle-1.1-bin.zip' contains too many directories. Expected to find exactly 1 directory.
at org.gradle.wrapper.Install.createDist(Install.java:73)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:47)
I did a google search for gradle nullpointerexception and it mentioned the JAVA_HOME needs to be set for compiling, but I've already checked it is set correctly and been able to compile stuff with ant in that environment.
I was getting exactly same error and I changed the version of gradle that I was using. Inside my gradle-wrapper.properties, changed version 2.4 to 2.2.1 and error is gone.