Open Liberty Log Configuration Exception on Sample Project - java

I am attempting to get started with running the OpenLiberty java server on Fedora 28, but I can't launch the sample app from the OpenLiberty home page.
The instructions say:
git clone https://github.com/OpenLiberty/sample-getting-started.git
cd sample-getting-started
mvn clean package liberty:run-server
When I ran the server I got a build failure with this error:
Caused by: org.apache.commons.logging.LogConfigurationException:
User-specified log class 'org.codehaus.mojo.pluginsupport.logging.DelegatingLog' cannot be found or is not useable.
I tried clearing the maven cache and doing another mvn install and that still didn't help. This project works on my macbook just fine. Any ideas how to fix this?
Additional Logs:
This is a shortened version of what I get after running mvn clean package liberty:run-server
[WARNING] Error injecting: org.apache.maven.wagon.providers.http.HttpWagon$__sisu21
java.lang.ExceptionInInitializerError
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.<clinit> (SSLConnectionSocketFactory.java:146)
at org.apache.maven.wagon.shared.http.AbstractHttpClientWagon.createConnManager (AbstractHttpClientWagon.java:347)
at org.apache.maven.wagon.shared.http.AbstractHttpClientWagon.<clinit> (AbstractHttpClientWagon.java:273)
...
Caused by: org.apache.commons.logging.LogConfigurationException: User-specified log class 'org.codehaus.mojo.pluginsupport.logging.DelegatingLog' cannot be found or is not useable.
at org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation (LogFactoryImpl.java:804)
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance (LogFactoryImpl.java:541)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance (LogFactoryImpl.java:292)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance (LogFactoryImpl.java:269)
...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.941 s
[INFO] Finished at: 2018-10-29T09:22:12-07:00
[INFO] Final Memory: 18M/185M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal net.wasdev.wlp.maven.plugins:liberty-maven-plugin:2.0:install-server (install-liberty) on project io.openliberty.sample.getting.started: Execution install-liberty of goal net.wasdev.wlp.maven.plugins:liberty-maven-plugin:2.0:install-server failed: An API incompatibility was encountered while executing net.wasdev.wlp.maven.plugins:liberty-maven-plugin:2.0:install-server: java.lang.ExceptionInInitializerError: null
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>net.wasdev.wlp.maven.plugins:liberty-maven-plugin:2.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/home/jsolum/.m2/repository/net/wasdev/wlp/maven/plugins/liberty-maven-plugin/2.0/liberty-maven-plugin-2.0.jar
[ERROR] urls[1] = file:/home/jsolum/.m2/repository/net/wasdev/wlp/ant/wlp-anttasks/1.3/wlp-anttasks-1.3.jar
[ERROR] urls[2] = file:/home/jsolum/.m2/repository/org/apache/ant/ant/1.8.4/ant-1.8.4.jar
[ERROR] urls[3] = file:/home/jsolum/.m2/repository/org/apache/ant/ant-launcher/1.8.4/ant-launcher-1.8.4.jar
[ERROR] urls[4] = file:/home/jsolum/.m2/repository/org/codehaus/mojo/plugin-support/1.0-alpha-1/plugin-support-1.0-alpha-1.jar
[ERROR] urls[5] = file:/home/jsolum/.m2/repository/ant/ant/1.6.5/ant-1.6.5.jar
[ERROR] urls[6] = file:/home/jsolum/.m2/repository/commons-lang/commons-lang/2.3/commons-lang-2.3.jar
[ERROR] urls[7] = file:/home/jsolum/.m2/repository/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar
[ERROR] urls[8] = file:/home/jsolum/.m2/repository/commons-jexl/commons-jexl/1.1/commons-jexl-1.1.jar
[ERROR] urls[9] = file:/home/jsolum/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
[ERROR] urls[10] = file:/home/jsolum/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.20/plexus-utils-3.0.20.jar
[ERROR] urls[11] = file:/home/jsolum/.m2/repository/org/sonatype/plexus/plexus-build-api/0.0.7/plexus-build-api-0.0.7.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------
[ERROR] : User-specified log class 'org.codehaus.mojo.pluginsupport.logging.DelegatingLog' cannot be found or is not useable.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException '
Java version:
openjdk version "9.0.4"
OpenJDK Runtime Environment (build 9.0.4+11)
OpenJDK 64-Bit Server VM (build 9.0.4+11, mixed mode)
Update
After removing ~/.m2/log4j I get this error:
Downloading from central: https://repo.maven.apache.org/maven2/io/openliberty/openliberty-runtime/maven-metadata.xml
[WARNING] Could not transfer metadata io.openliberty:openliberty-runtime/maven-metadata.xml from/to central (https://repo.maven.apache.org/maven2): User-specified log class 'org.codehaus.mojo.pluginsupport.logging.DelegatingLog' cannot be found or is not useable.

I've also encountered this problem.
In the end, it turned out that opensuses-provided maven version was to blame, or maybe my choice of plugins installed along with it.
After switching to official Maven binaries, the problem is gone.

For OpenSUSE, do as Filip PaczyƄski said. Switch to maven's official one.
Something in the OS maven distribution (currently 3.6.3) is missing. With a official release all worked fine. I installed the latest, 3.8.1, but probably with older releases will do too. Just skip the OS one.
P.S.: sadly i dont have reputation yet to comment on Filip's answer. So... sorry for enlarging the page.

Try to add a plugin dependency to wagon-http:
<dependencies>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-http</artifactId>
<version>3.2.0</version>
</dependency>
</dependencies>
I had the same error as you in a multi-module project, it seems the error User-specified log class 'org.codehaus.mojo.pluginsupport.logging.DelegatingLog' cannot be found or is not useable is not the cause of the problem itself but a second error when the plugin trying to log the problem.
Running the plugin directly in the module I would get this error instead: [WARNING] Error injecting: org.apache.maven.wagon.providers.http.HttpWagon
java.lang.ExceptionInInitializerError
You have a similar error in your stacktrace, so adding the dependency to wagon-http fixed it for me.
Here is my maven + Java configuration:
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T14:41:47-04:00)
Maven home: C:\Users\Public\Apps\Maven\apache-maven-3.6.0
Java version: 1.8.0_121, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_121\jre
Default locale: en_CA, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

Hit this today on a VM using version: Apache Maven 3.5.4 (Red Hat 3.5.4-5). Upgraded to Maven 3.6.3 and problem solved.

Related

How to deploy spring boot to heroku?

I wanted to deploy my application to heroku server and I am facing this problem. Any idea?
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.339 s
[INFO] Finished at: 2021-08-09T04:05:01Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project russion_spring_boot: Fatal error compiling: invalid target release: 11 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
! ERROR: Failed to build app with Maven
We're sorry this build is failing! If you can't find the issue in application code,
please submit a ticket so we can help: https://help.heroku.com/
! Push rejected, failed to compile Java app.
! Push failed
<properties>
<java.version>15.0.1</java.version>
</properties>
Logs depict the error - invalid target release: 11. Basically this error means that you have mentioned higher/mismatched version of Java in maven compiler's source and target java version settings in your pom.xml compared to the JDK which is being pointed out by JAVA_HOME environment variable.
To fix this error, just check the Java version in pom.xml and JAVA_HOME. They should match.
To know more about this issue, check this post - https://dzone.com/articles/how-to-fix-invalid-target-release-17-18-19-or-110

Maven: How do I use JMetro styling with Maven?

I wanted to use JMetro styling in my Maven project, but whatever I do, Maven gives me the same error. I am using javafx-archetype-simple from org.openjfx, and I tried using JMetro by adding it as a dependency in my pom.xml, and downloading it from JCenter by adding the .settings.xml to ~/.m2/. Whenever I tried to do mvn javafx:run after mvn clean, I always get this error:
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------< io.colocasian.calc:ore-no-calculator >----------------
[INFO] Building ore-no-calculator 1.2-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] >>> javafx-maven-plugin:0.0.4:run (default-cli) > process-classes # ore-no-calculator >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # ore-no-calculator ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/rishvic/Documents/Java/ore-no-calculator/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # ore-no-calculator ---
[WARNING] Can't extract module name from jmetro-11.6.5.pom: zip END header not found
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to /home/rishvic/Documents/Java/ore-no-calculator/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/rishvic/Documents/Java/ore-no-calculator/src/main/java/io/colocasian/calc/App.java:[17,22] package jfxtras.styles does not exist
[ERROR] /home/rishvic/Documents/Java/ore-no-calculator/src/main/java/io/colocasian/calc/App.java:[35,26] cannot find symbol
symbol: class Style
location: class io.colocasian.calc.App
[ERROR] /home/rishvic/Documents/Java/ore-no-calculator/src/main/java/io/colocasian/calc/App.java:[35,40] cannot find symbol
symbol: variable Style
location: class io.colocasian.calc.App
[ERROR] /home/rishvic/Documents/Java/ore-no-calculator/src/main/java/io/colocasian/calc/App.java:[377,13] cannot find symbol
symbol: class JMetro
location: class io.colocasian.calc.App
[INFO] 4 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.443 s
[INFO] Finished at: 2020-01-31T21:46:28+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project ore-no-calculator: Compilation failure: Compilation failure:
[ERROR] /home/rishvic/Documents/Java/ore-no-calculator/src/main/java/io/colocasian/calc/App.java:[17,22] package jfxtras.styles does not exist
[ERROR] /home/rishvic/Documents/Java/ore-no-calculator/src/main/java/io/colocasian/calc/App.java:[35,26] cannot find symbol
[ERROR] symbol: class Style
[ERROR] location: class io.colocasian.calc.App
[ERROR] /home/rishvic/Documents/Java/ore-no-calculator/src/main/java/io/colocasian/calc/App.java:[35,40] cannot find symbol
[ERROR] symbol: variable Style
[ERROR] location: class io.colocasian.calc.App
[ERROR] /home/rishvic/Documents/Java/ore-no-calculator/src/main/java/io/colocasian/calc/App.java:[377,13] cannot find symbol
[ERROR] symbol: class JMetro
[ERROR] location: class io.colocasian.calc.App
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Link to Gist containing my edited pom.xml, settings.xml and App.java which I used to try to use JMetro in my project. Source code (without JMetro, which actually runs with mvn clean javafx:run) linked here.
Output of java -version:
openjdk version "11.0.6" 2020-01-14
OpenJDK Runtime Environment (build 11.0.6+10)
OpenJDK 64-Bit Server VM (build 11.0.6+10, mixed mode)
Output of mvn --version:
Apache Maven 3.6.3 (NON-CANONICAL_2019-11-27T20:26:29Z_root)
Maven home: /opt/maven
Java version: 11.0.6, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-11-openjdk
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.4.15-2-manjaro", arch: "amd64", family: "unix"
PS: I am really new to using Maven, I would really appreciate some advice regarding using Maven, in general, and also using JavaFX on it. Originally, posted this question on Github Issues, on the JFXtras Styles Git repo, but it wasn't really an issue with JMetro itself, so posted this question here.
Extra info: I don't know if this has anything to do with it, but I am still adding it as reference. When I added JMetro 11.6.7 as a dependency and reran mvn clean javafx:run, while downloading, it gave me these warnings,
...
[WARNING] Can't extract module name from jmetro-11.6.7.pom: zip END header not found
...
[WARNING] Can't extract module name from jmetro-11.6.7.pom: Only outputDirectories and jars are accepted on the path
[WARNING] Some dependencies encountered issues while attempting to be resolved as modules and will not be included in the classpath; you can change this behavior via the 'includePathExceptionsInClasspath' configuration parameter.
The official Maven repo of JMetro didn't work for me as well. I resorted to downloading the JMetro jar from GitHub, adding it manually to Maven, and then use it in my JavaFX apps.
Here's what I did to make JMetro play nice with Maven:
Download the official JMetro jar from GitHub
Add the downloaded jar to the local Maven repo:
mvn install:install-file -Dfile=jmetro-11.6.15.jar -DgroupId=com.jfxtras -DartifactId=jmetro -Dversion=11.6.15
Add it to the project's pom.xml as a dependency:
<dependency>
<groupId>com.jfxtras</groupId>
<artifactId>jmetro</artifactId>
<version>11.6.15</version>
</dependency>
For modular projects, declare it in project's module-info.java:
module <ModuleName> {
...
requires org.jfxtras.styles.jmetro;
...
}
Now JMetro can be used normally.

Apache Beam execution

I'm following this example but in the step: Run WordCount, throught direct command
$ mvn compile exec:java -Dexec.mainClass=org.apache.beam.examples.WordCount \
-Dexec.args="--inputFile=pom.xml --output=counts" -Pdirect-runner
And finally I have this error:
[INFO] -----------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.065 s
[INFO] Finished at: 2018-10-02T17:36:05+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (default-cli) on project word-count-beam: An exception occured while executing the Java class. java.lang.UnsupportedOperationException: Cannot define class using reflection: Could not find sun.misc.Unsafe -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
You need to use the Java Development Kit (JDK) version 8. Verify that the JAVA_HOME environment variable is set and points to your JDK installation.
To understand this change better, read:
The official Feature Request JEP 260: Encapsulate Most Internal APIs.
Understanding sun.misc.Unsafe

Alfresco-Addon Java

I want to develop a ticket-system Add-On for Alfresco,
I am new into Alfresco so I have some troubles getting started
I have downloaded maven and set the path var
Also for java and javac
And now I installed an simple Maven projects with the command
mvn archetype:generate -Dfilter=org.alfresco:
everything installed fine.
Then I tried used the command
mvn install
but there I get the error:
[INFO] Compiling 3 source files to E:\HTL\Alfresco\maven_projects\quick-
start-project\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.473 s
[INFO] Finished at: 2018-04-17T15:58:33+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5:compile (default-compile) on project quick-start-project: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
I also tried to run the run.bat file in my folder, but it closed after some time with an error!
Can anyone help me and has some tips for getting started in developing for Alfresco?
please try this
On your Eclipse IDE, go into Window > Preferences > Java > Installed JREs >
and check your installed JREs.
You should have an entry with a JDK there.
Select the Execution Env as show below.
Click OK
Then Right-Click on your Project -> Maven -> Update Project
and select jdk
refer this community link may help you

Ninja framework Install Error with Maven

I'm trying to learn Ninja framework for building RESTful web services at here
I got the following error when I run "mvn clean install" inside the newly created maven project folder:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.610 s
[INFO] Finished at: 2014-05-19T11:39:50-07:00
[INFO] Final Memory: 11M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project ninja: Fatal error compiling: invalid target release: 1.7 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
I am on Mac Mavericks with Java 8, if this matters. Thanks
well, it may sound silly, but I fixed the problem by adding JAVA_HOME to the path on my Mac, otherwise, maven still uses Java 1.6 (I've installed Java 1.8) on my computer.
export JAVA_HOME=$(/usr/libexec/java_home)

Categories