Quarkus native image build with infinispan-client and grpc - quarkus

I am trying to build a native image for an application using quarkus-infinispan-client and quarkus-grpc w/o GraalVM installed with :
mvnw package -Pnative -Dquarkus.native.container-build=true -DskipTests
The build fails with : com.oracle.svm.core.util.UserError$UserException: Classes that should be initialized at run time got initialized during image building with some netty classes.
I have tried with Quarkus 1.6, 1.7 and 1.8 with a minimal application having only the two dependencies added with the same result.
Can it be a bug or I am doing something wrong ? Is there any workaround ?
Also I get a lot of warnings with Dependencies with duplicate files detected
mainly in wildfly classes.
To reproduce the problem only the dependencies need to be defined in the pom
there is no need to use any of them.

Related

JavaFX16: Unsupported JavaFX configuration: classes were loaded from 'unnamed module #...'

I have a Maven multi-module project on IntelliJ that produces 3 jars, 2 of which are executables and the other one is for commmon resources.
One of the executable modules has a main class that asks if the user wants to start the program with CLI or GUI.
Running this main from IntelliJ works without problem, instead when I use Maven to make the jar (using maven shade):
mvn package -pl myModule -am
and then launch the jar with GUI option, this warning appears:
com.sun.javafx.application.PlatformImpl startup
WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module #...'
The GUI then starts without problems.
How can I get rid of this warning?
The JDK of my project is openJDK 16 (I've already added module-info.java in order to work with javafx), openJFX 16, maven shade plugin 3.2.4, maven compiler plugin 3.8.1.
If there's need to add furthermore information, I'll add them.
It seems that maven is shading the JavaFX jars into a single fat jar.
Shading multiple modules into the same jar is not possible, because a jar can only contain 1 module. So, I suppose the shade plugin resolves that problem by removing the module-info files of the dependencies it's using, which means the JavaFX code will not be loaded as a module, and you get a warning like this.
I think the only way to get rid of the warning is to not use shading, but keep the JavaFX modules as separate jar files, that you then put on the module path when running the application.

Use java S2I for spring boot app with gradle build in openshift

How to get started with java S2I build for spring boot application with Gradle build?
Please suggest me any Json/yml file needs to be imported to get started.
Here is a whole repo - https://github.com/dsevost/gradle-s2i - with a Dockerfile to build a S2I gradle builder image, and a template to build applications on top of it.
Perhaps it is worth noting the BUILDER parameter in the template with possible values of 'Gradle' or 'Maven'. According to the assemble script, it will build a gradle project even when both pom.xml and build.gradle are present in the project directory.
I haven't tried it myself but I glanced over the template and it looks OK...assuming the image and S2I scripts are functional.

Multi-module grails build

I have multiple apps and inline plugins I want to be all next to each other so in IntelliJ I can have them all open at once and edit anything in any of them, refactoring work across all of them, etc.
And I want to have a top level build that will build everything.
I'm using grails 2.2.4 and maven
I looked at create-multi-project-build and all manner of links that talked about it but can't get it to work with the inline plugin. When it gets to building the app, for some reason it tries to compile the plugin files and gets lots of compile errors because it is not seeing the plugin's dependencies.
NOTE: Apparently the plugin pom.xml doesn't have the dependencies. So, is there a bug, or am I doing something wrong that would make it not find dependencies?
[INFO] --- grails-maven-plugin:2.2.4:maven-compile (default-maven-compile) # my-app ---
|Loading Grails 2.2.4
|Configuring classpath
|Running pre-compiled script
.
|Environment set to development
......Warning
|
No plugin [my-plugin-0.1-SNAPSHOT] installed, cannot uninstall
....
|Compiling 132 source files
.Error
|
Compilation error: startup failed:
Compile error during compilation with javac.
/path/to/file/in/my-plugin:3: package groovyx.net.http does not exist
import groovyx.net.http.AsyncHTTPBuilder;
^
etc. (lots more of the same kind of errors)
Is there some way to get this to work? If this maven build is the only option, I'd really like a solution that does not require manually editing the pom's. That way I can just regenerate them whenever I need to update the build.
Are there other straightforward options to creating a multi-module build for this case?
Further detail:
Running grails test-app in the plugin or in the app work successfully.

Maven java compile error can not access CommonClassA

Background:
I am developing Maven multi module project.
One of the module is common module needed by other all modules.
This module contain CommonClassA.java.
common module is properly compiled.
It is installed into maven local repository properly.
One of the class(Billtype.java) in other module (EmployeeBilling) refers this class(CommonClassA.java).
Maven Dependency for common module is properly specified in pom.xml of EmployeeBilling module.
Problem:
While compiling EmployeeBilling module it throws
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project EmployeeBilling: Compilation failure
[ERROR] \MyWorkspace\Biz\EmployeeBilling\src\main\java\com\employee\Billtype.java:[79,19] error: cannot access CommonClassA
[ERROR] -> [Help 1]**
Supporting details:
dependency defined in EmployeeBilling> pom.xml:
Other classes from common module seems accessible as no error observed
There are no other errors like Class not found/file not found.
The class CommonCLassA implements Serializable
Same error occurs from Eclipse as well as commond line
I am using M2E plugin
Tools:
jdk1.7.0_02
OS: Windows 7
Eclipse JUNO and apache-maven-3.1.0
Thanks in advance!
If project builds properly using eclipse compiler then it should work with Maven.
Few things to check if its not working with maven:
Manually check in repository that jar is installed properly and it contains your class file.
Try to build project using locally installed Maven instead of maven in eclipse.
Set -DskipTest=true while installing your jar, as it can cause issues at times.
If these steps don't work then show us your pom.
With no more information it's hard to find the cause. But I also had this problems now and then, and there are some things which could go wrong:
Are you using the right JAVA version (everywhere) ?
... and the right java PROVIDER? (Oracle, IBM, OpenJDK) In my case it's often this issue, I'm sometimes bound to IBM JDK, although I try to use Oracle where I can and this sometimes breaks my build.
Is the right maven dependency VERSION used? If you depend on it multiple times, and all in the same (lower than root) dept of dependencies, Maven will just "choose" a version. It could be that thát version is incompatible with your code of thát particular dependency
Skipping tests sometimes WORKS! It has something to do with maven phases and getting stuff ready for using it elsewhere.
Good luck :)
I had the same problem. Even the jar dependency has the required class files. Finally I deleted the local maven repo and restarted the build. Now it worked without any issue.
It looks like you are using an old version of maven-compiler-plugin (v2.3.2).
I suggest you upgrade it to 3.x. it won't magically fix your issue but it will definitely give you better / more detailed error message.

Tomcat Jersey SPI Error

I have a Jersey (1.4) app deployed on Tomcat 5.5, when Tomcat starts up I can see its loading all the resources and providers. But as soon as I access any of the web services I get this strange error
java.lang.NoClassDefFoundError: com/sun/jersey/spi/inject/Errors$Closure
I spent good long time finding out what's going on but had no luck.
I converted maven project into eclipse project using mvn eclipse:eclipse -Dwtpversion=1.5.
Any ideas?
I got this error when I also had a nuxeo related dependancy in my maven pom.xml, which itself has a dependency on jersey libraries, but at an earlier version (1.1.5 to be specific).
I changed the pom to depend on the latest version of jersey-core, jersey-server and jersey-client dependencies and ran mvn eclipse:eclipse and the problem went away!
There must have been a class clash involved.

Resources