Spring Native with buildpacks error com.oracle.graal.pointsto.constraints.UnresolvedElementException - graalvm

I am trying to build a Spring Native application using buildpacks by following the instructions from: https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/#getting-started
I changed Java version to 11 or 17 to avoid an error. Locally I have installed GraalVM v17 (22.2.0 and 22.3.0-dev).
When running mvn spring-boot:build-image I receive the following error related to BeanUtils:
[INFO] [creator] Fatal error: com.oracle.graal.pointsto.util.AnalysisError$ParsingError:
Error encountered while parsing
org.springframework.boot.SpringApplication.createSpringFactoriesInstances(java.lang.Class, java.lang.Class[], java.lang.ClassLoader, java.lang.Object[], java.util.Set)
[INFO] [creator] Parsing context:
[INFO] [creator] at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:439)
[INFO] [creator] at org.springframework.nativex.substitutions.boot.Target_SpringApplication.getSpringFactoriesInstances(Target_SpringApplication.java:173)
[INFO] [creator] at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:424) [INFO] [creator]
[INFO] [creator] at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.AnalysisError.parsingError(AnalysisError.java:152)
[INFO] [creator] at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.createFlowsGraph(MethodTypeFlow.java:104)
[...]
[INFO] [creator] Caused by: org.graalvm.compiler.java.BytecodeParser$BytecodeParserError:
com.oracle.graal.pointsto.constraints.UnresolvedElementException:
Discovered unresolved method during parsing:
org.springframework.beans.BeanUtils$KotlinDelegate.instantiateClass(java.lang.reflect.Constructor, java.lang.Object[]).
This error is reported at image build time because class
org.springframework.beans.BeanUtils is registered for linking at image build time by system default
[INFO] [creator] at parsing org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:196) [...]
[INFO] [creator] ... 13 more
[INFO] [creator] Caused by: com.oracle.graal.pointsto.constraints.UnresolvedElementException:
Discovered unresolved method during parsing:
org.springframework.beans.BeanUtils$KotlinDelegate.instantiateClass(java.lang.reflect.Constructor, java.lang.Object[]).
This error is reported at image build time because class
org.springframework.beans.BeanUtils is registered for
linking at image build time by system default
... 38 more
[INFO] [creator] --------------------------------------------------------------------------------
The build is working fine when using Native Build Tools. The .exe files executes correctly ( I am using Windows).

Seems like there is an issue with paketobuildpacks/builder:0.1.242-tiny which I also experienced in paketobuildpacks/builder:base.
Downgrading to 0.1.241-tiny seems to resolve the issue.
See paketo-buildpacks/native-image#176 for workarounds to this problem, and follow that issue for the resolution.

This error has suddenly started appearing recently on all projects (without making any changes) which were building fine with
spring-boot:build-image.

Related

Electron builder not working for ubuntu deb package

I'm using electron builder to auto-update my app for mac, windows & ubuntu OS. mac & windows are working fine. But, the Ubuntu deb package app is throwing errors while it's updating as I attach error logs below. I've tried some solutions available on web but didn't get the solution.
[2022-03-15 17:07:02.914] [info] Hello, log
[2022-03-15 17:07:02.918] [warn] Some problem appears
[2022-03-15 17:07:02.919] [info] Checking for update
[2022-03-15 17:07:04.342] [info] Found version 0.4.7 (url: Centroall-Tracker-0.4.7.AppImage)
[2022-03-15 17:07:04.343] [warn] Update-available"...!
[2022-03-15 17:07:04.345] [info] Downloading update from Centroall-Tracker-0.4.7.AppImage
[2022-03-15 17:07:04.349] [error] Error: Error: ENOENT: no such file or directory, open '/opt/Centroall Tracker/resources/app-update.yml'
[2022-03-15 17:07:04.350] [warn] Error event
[2022-03-15 17:07:04.351] [info] Error: ENOENT: no such file or directory, open '/opt/Centroall Tracker/resources/app-update.yml'

build (mvn install) of new application takes forever

I was trying to use an existing application as starting point for a new one.
So, I copied over the src-folder, the pom and a couple of IDE-specific files config files.
I then refactored all giving it a new path and application name and then I wanted to do a first build and entered mvn install.
This process is now hanging since 1 1/2 hours in vaadin-maven-plugin:18.0.2:build-frontend (see full console output below).
Is this expected or why is this taking so long? Can I somehow figure out, why and where this is hanging?
What am I missing? Are there any files other then those mentioned that absolutely MUST exist before a new Vaadin application can (even be tried to) be built?
[INFO] Scanning for projects...
[INFO]
[INFO] --------------< ch.zh.ksta.monitoring:my_app >---------------
[INFO] Building KStA-ZH-Monitoring 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) # my_app ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 7 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # my_app ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- vaadin-maven-plugin:18.0.2:prepare-frontend (default) # my_app ---
[INFO] writing file D:\Projects\my_app\target\flow-frontend\package.json.
[INFO] writing file D:\Projects\my_app\target\flow-frontend\form\package.json.
[INFO] writing file 'D:\Projects\my_app\target\index.html'
[INFO] writing file 'D:\Projects\my_app\target\index.ts'
[INFO] Copying frontend resources from jar files ...
[INFO] Visited 173 resources. Took 2229 ms.
[INFO]
[INFO] --- vaadin-maven-plugin:18.0.2:build-frontend (default) # my_app ---
[INFO] Scanning classes to find frontend configurations and dependencies...
[INFO] Visited 720 classes. Took 2553 ms.
[INFO] Visited 126 classes. Took 138 ms.
[INFO] writing file D:\Projects\my_app\target\flow-frontend\package.json.
[INFO] writing file D:\Projects\my_app\target\flow-frontend\form\package.json.
[INFO] writing file 'D:\Projects\my_app\target\index.html'
[INFO] writing file 'D:\Projects\my_app\target\index.ts'
[INFO] Parsing java files from [D:\Projects\my_app\src\main\java]
[INFO] There are no connect endpoints to generate.
[INFO] Running `pnpm install` to resolve and optionally download frontend dependencies. This may take a moment, please stand by...
[INFO] Generated pnpmfile hook file: 'D:\Projects\my_app\pnpmfile.js'
[INFO] installing pnpm version 4.4.0 locally
[INFO] using 'C:\Users\mmo\.vaadin\node\node.exe C:\Users\mmo\.vaadin\node_modules\pnpm\bin\pnpm.js' for frontend package installation
Later addition:
If I terminate this using ^C I get:
...
2021-05-31 18:24:40,199 ERROR [task-1] com.vaadin.flow.server.frontend.TaskRunNpmInstall: Command `C:\Program Files\nodejs\node.exe C:\Users\mmo\.vaadin\node_modules\pnpm\bin\pnpm.js --shamefully-hoist=true install` failed:
Using hooks from: D:\Projects\my_app\pnpmfile.jsreadPackage hook is declared. Manifests of dependencies might get overridden
2021-05-31 18:24:40,201 ERROR [task-1] com.vaadin.flow.server.frontend.TaskRunNpmInstall: >>> Dependency ERROR. Check that all required dependencies are deployed in pnpm repositories.
2021-05-31 18:24:40,205 DEBUG [task-1] com.vaadin.flow.server.startup.DevModeInitializer: Could not initialize dev mode handler. One of the node tasks failed
com.vaadin.flow.server.ExecutionFailedException: Pnpm install has exited with non zero status. Some dependencies are not installed. Check pnpm command output
at com.vaadin.flow.server.frontend.TaskRunNpmInstall.runNpmInstall(TaskRunNpmInstall.java:405)
at com.vaadin.flow.server.frontend.TaskRunNpmInstall.execute(TaskRunNpmInstall.java:120)
at com.vaadin.flow.server.frontend.NodeTasks.execute(NodeTasks.java:634)
at com.vaadin.flow.server.startup.DevModeInitializer.runNodeTasks(DevModeInitializer.java:471)
at com.vaadin.flow.server.startup.DevModeInitializer.lambda$initDevModeHandler$0(DevModeInitializer.java:381)
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1736)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
If I restart the build again it will hang again.
Gee - is this brittle... :-(
Got this same error. I deleted from my home directory:
.vaadin
.pnpm-store
... and the generated stuff from my project:
webpack.config.js
tsconfig.json
types.d.ts
webpack.config.js
webpack.generated.js
pnpm-lock.yaml
pnpmfile.js
package.json
.npmrc
target
.pnpm-debug.log
... probably overkill, but then it worked again.

Build src knox 1.4.0 with hadoop 2.7.4 failed

I tried to build the project Apache Knox 1.4.0 with hadoop 2.7.4
I did the build on a Ubuntu server :
- Ubtuntu 18.04
- Openjdk version "11.0.7"
- Apache Maven 3.6.0
- Apache Ant(TM) version 1.10.5
I have downloaded the src archive on http://www.apache.org/dyn/closer.cgi/knox/1.4.0/knox-1.4.0-src.zip
I get the following issue, and I'm looking for a solution :
/var/compil/knox/knox-1.4.0# mvn -Panalyze -Prelease clean install -DskipTests
[WARNING]
Dependency convergence error for org.apache.directory.server:apacheds-kerberos-codec:2.0.0-M15 paths to dependency are:
+-org.apache.knox:gateway-server:1.4.0
+-org.apache.hadoop:hadoop-auth:2.7.4
+-org.apache.directory.server:apacheds-kerberos-codec:2.0.0-M15
[WARNING]
Dependency convergence error for org.apache.directory.api:api-asn1-api:1.0.0-M20 paths to dependency are:
+-org.apache.knox:gateway-server:1.4.0
+-org.apache.hadoop:hadoop-auth:2.7.4
+-org.apache.directory.server:apacheds-kerberos-codec:2.0.0-M15
+-org.apache.directory.api:api-asn1-api:1.0.0-M20
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 04:30 min
[INFO] Finished at: 2020-05-14T11:20:57+02:00
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "analyze" could not be activated because it does not exist.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M3:enforce (enforce-dependencies) on project gateway-server: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [Help 1]

Dart beginning - unable to run AngularDart Web App template

Im trying to following the instructions on https://webdev.dartlang.org/guides/get-started
I have installed 2.0.0-dev.55.0 in /usr/lib/dart.
And have Dartium installed in /home/bob/Documents/software/dartium-linux-x64-stable-1.24.2.0/chrome.
When I try 5. Run the app. I get the following:
pubspec.yaml
name: angular_app
description: A web app that uses AngularDart
version: 0.0.1
environment:
sdk: '>=2.0.0-dev.51.0 <2.0.0'
dependencies:
angular: ^5.0.0-alpha+12
dev_dependencies:
angular_test: ^2.0.0-alpha
build_runner: ^0.8.8
build_test: ^0.10.2
build_web_compilers: ^0.4.0
test: ^0.12.30
I have tried right-click pubspec.yaml and choose Pub: Get Dependencies but this didnt make any difference.
I have also tried using the sample dart project from https://github.com/angular-examples/quickstart which uses Dart 2, and NOT using Dartium. But I still get the same error.
When I run pub run build_runner serve I get
Could not find bin/build_runner.dart in package build_runner.
Building in WebStorm
When I build using Webstorm, everything looks rosie:
Working dir: /home/anton/WebstormProjects/quickstart
/usr/lib/dart/bin/pub global run webdev build --output=web:build
[INFO] Initializing inputs
[INFO] Reading cached asset graph...
[INFO] Reading cached asset graph completed, took 675ms
[INFO] Checking for updates since last build...
[INFO] Checking for updates since last build completed, took 808ms
[INFO] Running build...
[INFO] build_web_compilers|entrypoint on web/main.dart:Running dart2js with --minify --packages=.package-643dc5d58d0e8c6a495fcb24c0476818 -oweb/main.dart.js web/main.dart
[INFO] 1.5s elapsed, 3/4 actions completed.
[INFO] 2.6s elapsed, 3/4 actions completed.
[INFO] 3.7s elapsed, 3/4 actions completed.
[INFO] 4.8s elapsed, 3/4 actions completed.
[INFO] 5.9s elapsed, 3/4 actions completed.
[INFO] 7.0s elapsed, 3/4 actions completed.
[INFO] 8.1s elapsed, 3/4 actions completed.
[INFO] build_web_compilers|entrypoint on web/main.dart:Dart2Js finished with:
Compiled 9,664,399 characters Dart to 162,915 characters JavaScript in 7.72 seconds
Dart file (web/main.dart) compiled to JavaScript: web/main.dart.js
[INFO] Running build completed, took 9.2s
[INFO] Caching finalized dependency graph...
[INFO] Caching finalized dependency graph completed, took 271ms
[INFO] Creating merged output dir `build`...
[INFO] Creating merged output dir `build` completed, took 2.9s
[INFO] Writing asset manifest...
[INFO] Writing asset manifest completed, took 3ms
[INFO] Succeeded after 12.3s with 3 outputs (1859 actions)
Process finished with exit code 0
I have also tried using https://github.com/dart-lang/angular/tree/master/examples but still get the same error.

Why does a Maven 3 multi-module project fail on "clean package", and succeed on "clean compile" followed by "package"?

This is similar to the asked and answered question Maven test dependency on multi module project. However, this has nothing to do with the test phase, instead I'm having problems with package.
I have a multi-module project something like:
root
|
|-parent-client
| |
| |-client-1
| |
| \-client-2
|
\-parent-server
|
|-server-1
|
|-server-2
|
|-server-3
|
\-server-4
My dependencies are client-1 -> client-2 -> server-1 -> server-2 -> server-3 -> server-4, which is to say that client-2 depends on server-1, server-1 depends on server-2, and so on. Each is scoped to compile.
So the problem is that when I run mvn clean package in the root, I get a compilation failure in server-2 that package server-3 does not exist.
When I run mvn clean compile followed by mvn package in the root, it runs through without issue.
It always fails at the same module when it fails.
My understanding of the Build Lifecycle is that compile package is redundant since package includes the compile lifecycle.
The project is more complex, with a total of 41 modules, two parents and one root. Creating a simple example inevitably works as expected.
I'm stumped as to how I should proceed.
Update 2015-10-25
Turns out I was wrong about the order of commands for success. I've updated my question and the description, and included debug output per Michael-O's request:
<snip/>
[INFO] --- maven-ejb-plugin:2.3:ejb (default-ejb) # terradatum-systemconfig ---
[INFO] Building EJB terradatum-systemconfig-4.8.1-SNAPSHOT with EJB version 3.0
[INFO] Building jar: /home/rbellamy/Development/Terradatum/metrics-project/metrics-server/systemconfig/ejb/target/terradatum-systemconfig-4.8.1-SNAPSHOT.jar
[INFO] Building EJB client terradatum-systemconfig-4.8.1-SNAPSHOT-client
[INFO] Building jar: /home/rbellamy/Development/Terradatum/metrics-project/metrics-server/systemconfig/ejb/target/terradatum-systemconfig-4.8.1-SNAPSHOT-client.jar
<snip/>
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building terradatum-payment 4.8.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # terradatum-payment ---
[INFO] Deleting /home/rbellamy/Development/Terradatum/metrics-project/metrics-server/payment/ejb/target
[INFO]
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) # terradatum-payment ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) # terradatum-payment ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 7 source files to /home/rbellamy/Development/Terradatum/metrics-project/metrics-server/payment/ejb/target/classes
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING] bootstrap class path not set in conjunction with -source 1.6
[INFO] 1 warning
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/rbellamy/Development/Terradatum/metrics-project/metrics-server/payment/ejb/src/main/java/com/terradatum/common/payment/PaymentRemoteDelegate.java:[13,42] package com.terradatum.common.systemconfig does not exist
<snip/>
Update 2015-11-16
After much refactoring the build no longer fails in the same place. I've seen it fail in a similar way, consistently, but the location of the failure moves around. I am not running multiple threads, but it seems very clear to me there's a race somewhere in which an obviously available package (absolutely located and reachable in my ~/.m2/repository local cache, and added to the classpath) is not visible to the Maven compiler.
And knowing what I know about race conditions, I have no idea how I would file a bug report of any substance given I can't offer anything more than supposition and finger pointing.

Resources