2

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. 
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
jsolum
  • 196
  • 2
  • 15
  • I just tried this on Fedora 28 and it worked fine for me. Please include more of the logs before the error occurred – kgibm Oct 29 '18 at 15:13
  • I added some logs. If that helps then good, but I will try to give you some more later. I am looking at my maven setup and I might have something wrong there. I will update later today. Thank you! – jsolum Oct 29 '18 at 16:43
  • Alright. I thought it was my maven configuration because maven wasn't pointing to the right jdk, but I fixed that and I am still getting the same error. Would a full stack trace of the errors help? – jsolum Oct 30 '18 at 03:37
  • Hmm, that's weird. I even tried matching your OpenJDK version and I still can't reproduce it. I guess the questions are: 1) who's configuring the `org.codehaus.mojo.pluginsupport.logging.DelegatingLog` logger, and 2) is it supposed to be configured, and if so, why isn't it being found by the classloader. When you say you cleared the maven cache, did you blow away all of `~/.m2`? – kgibm Oct 30 '18 at 15:33
  • Yes I completely removed ~/.m2. I'll try looking around some more for where the codehaus logging is being used. – jsolum Oct 31 '18 at 16:33
  • I just tried removing specifically log4j from ~/.m2 and I got the error described at the bottom of my post. It looks like it can't find it on maven central? Any thoughts on how to fix this? – jsolum Oct 31 '18 at 16:47

4 Answers4

2

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.

1

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.

Luís Alves
  • 81
  • 2
  • 4
  • Thanks for Your answer, and I'm glad that it works for others, not just for me. To this day I do not know what is wrong with opensuse maven... PS: I've largely gained my "rep" through a random answer to intellij idea IDE problem... years ago. I mean to say: there's no problem too small to help with :) – Filip Paczyński May 04 '21 at 20:12
0

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"
dcendents
  • 753
  • 5
  • 7
0

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.

Scott Kurz
  • 4,985
  • 1
  • 18
  • 40