我正尝试在Fedora28上运行OpenLiberty java服务器,但无法从OpenLiberty主页启动示例应用程序。
说明书上写着:
git clone https://github.com/OpenLiberty/sample-getting-started.git
cd sample-getting-started
mvn clean package liberty:run-server当我运行服务器时,我得到了一个构建失败,错误如下:
Caused by: org.apache.commons.logging.LogConfigurationException:
User-specified log class 'org.codehaus.mojo.pluginsupport.logging.DelegatingLog' cannot be found or is not useable.我尝试清除maven缓存并执行另一个mvn install,但仍然没有帮助。这个项目在我的macbook上运行得很好。有什么办法解决这个问题吗?
其他日志:
这是我在运行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版本:
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) 更新
在删除~/.m2/log4j之后,我得到了这个错误:
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. 发布于 2021-03-12 03:11:34
我也遇到过这个问题。
最后,事实证明是opensuse提供的maven版本造成的,或者是我选择的随附安装的插件。
在切换到官方的Maven二进制文件之后,这个问题就消失了。
发布于 2021-04-27 08:11:46
对于OpenSUSE,请按照Filip Paczyński所说的做。切换到maven的官方版本。
OS maven发行版(当前为3.6.3)中缺少某些内容。有了官方版本,一切都运行得很好。我安装了3.8.1的最新版本,但可能旧版本也可以。只需跳过操作系统。
附言:遗憾的是,我还没有对菲利普的回答发表评论。所以..。很抱歉放大了页面。
发布于 2018-12-18 22:24:20
尝试将插件依赖项添加到旅行车-http:
<dependencies>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-http</artifactId>
<version>3.2.0</version>
</dependency>
</dependencies>我在一个多模块项目中遇到了和你一样的错误,似乎错误User-specified log class 'org.codehaus.mojo.pluginsupport.logging.DelegatingLog' cannot be found or is not useable不是问题本身的原因,而是插件试图记录问题时的第二个错误。
直接在模块中运行插件,我会得到这个错误:[WARNING] Error injecting: org.apache.maven.wagon.providers.http.HttpWagon java.lang.ExceptionInInitializerError
您的堆栈跟踪中有一个类似的错误,因此将依赖项添加到http http中为我修复了它。
下面是我的maven + Java配置:
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"https://stackoverflow.com/questions/52980706
复制相似问题