简体   繁体   English

log4j2错误StatusLogger找不到log4j2配置文件和ResourceBundle错误

[英]log4j2 ERROR StatusLogger No log4j2 configuration file found and ResourceBundle error

I have below log4j2.xml within \\src\\main\\resources (this is in the class-path): 我在\\ src \\ main \\ resources中有下面的log4j2.xml(在类路径中):

<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="DEBUG">
    <Properties>
        <Property name="LOG_DIR">.</Property>
        <Property name="ARCHIVE">output.log</Property>
        <Property name="CONSOLE_PATTERN">[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n</Property>
        <Property name="FILE_PATTERN">%d{yyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n</Property>
    </Properties>
    <Appenders>
        <Console name="console" target="SYSTEM_OUT">
            <PatternLayout pattern="${CONSOLE_PATTERN}"/>
        </Console>
        <File name="file" fileName="${LOG_DIR}/${ARCHIVE}" immediateFlush="false" append="false">
            <PatternLayout pattern="${FILE_PATTERN}"/>
        </File>
    </Appenders>
    <Loggers>
        <Root level="INFO" additivity="false">
            <AppenderRef ref="console"/>
            <AppenderRef ref="file"/>
        </Root>
        <Logger name="com.my.package" level="TRACE" additivity="false">
            <AppenderRef ref="console"/>
            <AppenderRef ref="file"/>
        </Logger>
        <Logger name="com.my.package.errors" level="ERROR" additivity="false">
            <AppenderRef ref="console"/>
            <AppenderRef ref="file"/>        
        </Logger>
    </Loggers>
</Configuration>

If I run app from eclipse, either debugging or running, messages are correctly output to console and file. 如果我从eclipse运行应用程序(调试或运行),则消息将正确输出到控制台和文件。

I am using maven, and I have not put any dependencies to log4j in my maven pom.xml configuration file. 我正在使用maven,并且在我的maven pom.xml配置文件中没有对log4j放置任何依赖项。

I have tried to put below as stated here : 我试图把其陈述如下位置

<dependencies>
  <dependency>
    <groupId>org.apache.logging.log4j</groupId>
    <artifactId>log4j-api</artifactId>
    <version>2.5</version>
  </dependency>
  <dependency>
    <groupId>org.apache.logging.log4j</groupId>
    <artifactId>log4j-core</artifactId>
    <version>2.5</version>
  </dependency>
</dependencies>

but then it does not like to maven and below errors appears regarding pom.xml: 但是然后它不喜欢Maven,并且以下显示有关pom.xml的错误:

Failed to read artifact descriptor for org.apache.logging.log4j:log4j-api:jar:2.5

org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.logging.log4j:log4j-api:jar:2.5
    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:302)
    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:218)
    at org.eclipse.aether.internal.impl.DefaultDependencyCollector.resolveCachedArtifactDescriptor(DefaultDependencyCollector.java:535)
    at org.eclipse.aether.internal.impl.DefaultDependencyCollector.getArtifactDescriptorResult(DefaultDependencyCollector.java:519)
    at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:409)
    at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:363)
    at org.eclipse.aether.internal.impl.DefaultDependencyCollector.process(DefaultDependencyCollector.java:351)
    at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:254)
    at org.eclipse.aether.internal.impl.DefaultRepositorySystem.collectDependencies(DefaultRepositorySystem.java:316)
    at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:172)
    at org.apache.maven.project.DefaultProjectBuilder.resolveDependencies(DefaultProjectBuilder.java:215)
    at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:188)
    at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:119)
    at org.eclipse.m2e.core.internal.embedder.MavenImpl.readMavenProject(MavenImpl.java:636)
    at org.eclipse.m2e.core.internal.project.registry.DefaultMavenDependencyResolver.resolveProjectDependencies(DefaultMavenDependencyResolver.java:63)
    at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refreshPhase2(ProjectRegistryManager.java:529)
    at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager$3.call(ProjectRegistryManager.java:491)
    at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager$3.call(ProjectRegistryManager.java:1)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)
    at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:495)
    at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:350)
    at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:297)
    at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.getProjectFacade(MavenBuilder.java:154)
    at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod$1.call(MavenBuilder.java:89)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99)
    at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.execute(MavenBuilder.java:86)
    at org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:200)
    at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:734)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:205)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:245)
    at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:300)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:303)
    at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:359)
    at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:382)
    at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:144)
    at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Failure to transfer org.apache.logging.log4j:log4j-api:pom:2.5 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.logging.log4j:log4j-api:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): Connection refused: connect
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:444)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:223)
    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:287)
    ... 41 more
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Failure to transfer org.apache.logging.log4j:log4j-api:pom:2.5 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.logging.log4j:log4j-api:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): Connection refused: connect
    at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.newException(DefaultUpdateCheckManager.java:238)
    at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.checkArtifact(DefaultUpdateCheckManager.java:206)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.gatherDownloads(DefaultArtifactResolver.java:585)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:503)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:421)
    ... 44 more

So I do not include these dependencies in maven. 因此,我没有在Maven中包括这些依赖项。 Anyway without these dependencies, my app works well if I debug or run within eclipse IDE. 无论如何,如果没有这些依赖项,如果我在Eclipse IDE中调试或运行,我的应用程序将运行良好。

My problem is on deploying my app. 我的问题是部署我的应用程序。 Through eclipse export wizard I select "export" and then under Java I select Runnable JAR File. 通过eclipse导出向导,我选择“导出”,然后在Java下选择Runnable JAR File。 In following screen I check "Extract required libraries into generated JAR", and jar file is created without problems. 在以下屏幕中,我检查“将所需的库提取到生成的JAR中”,并且jar文件创建成功。

Finally, I try to run my app from console by typing: 最后,我尝试通过键入以下命令从控制台运行我的应用程序:

java -jar myapp.jar

but below error messages appear: 但出现以下错误消息:

ERROR StatusLogger No log4j2 configuration file found. Using default configurati
on: logging only errors to the console.
######## STARTING APP ################
######## ESTABLISHING CULTURE APP ################
Exception in thread "main" java.util.MissingResourceException: Can't find bundle
 for base name Strings, locale es_ES
        at java.util.ResourceBundle.throwMissingResourceException(Unknown Source
)
        at java.util.ResourceBundle.getBundleImpl(Unknown Source)
        at java.util.ResourceBundle.getBundle(Unknown Source)
        at com.distributed.analyzer.Main.establecerIdiomaLogging(Main.java:73)
        at com.distributed.analyzer.Main.main(Main.java:52)

As you can see from above error, I have checked if my main entry point is detected correctly: yes, it is correctly detected, in main class I have put some "System.out.println" when application starts, and they are shown as you can see above. 从上面的错误中可以看到,我检查了是否正确检测到我的主入口点:是的,可以正确检测到它,在主类中,当应用程序启动时我放置了一些“ System.out.println”,它们显示为您可以在上方看到。 The problem is that messages that comes from log4j2 are not printed in the console due to log4j2.xml does not seem to be detected and it takes into account the default one so my messages are not shown.... 问题是由于似乎未检测到log4j2.xml,因此未在控制台中打印来自log4j2的消息,并且考虑了默认消息,因此未显示我的消息。

The last error that appears is regarding ResourceBundle. 出现的最后一个错误与ResourceBundle有关。 I have a resource string called "Strings_es_ES.properties" that is located in the same place as log4j2.xml, that is, in /src/main/resources/ and this path is in my class-path. 我有一个名为“ Strings_es_ES.properties”的资源字符串,它与log4j2.xml位于同一位置,即/ src / main / resources /中,并且此路径在我的类路径中。

So What am I doing wrong? 那我在做什么错呢? How can I solve this 2 errors? 我该如何解决这2个错误? What can I check? 我可以检查什么?

ATTEMPT1 ATTEMPT1

As hohenheim suggested I have tried to manually install below log4j2 entries: 正如hohenheim所建议的那样,我尝试手动在log4j2条目下进行安装:

<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.5</version>

<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.5</version>

but I get errors. 但我得到了错误。 It seems that tries to connect to apache repository but connection is refused by the proxy (I am at work now). 似乎尝试连接到apache存储库,但是代理拒绝了连接(我现在在工作)。 I will try at home later, 以后我会在家尝试

Below the message: 消息下方:

C:\Program Files\apache-maven-3.3.9\bin>mvn install:install-file -Dfile=D:\apache-log4j-2.5-bin -DgroupId=org.apache.logging.log4j -DartifactId=log4j-ap
i -Dversion=2.5 -Dpackaging=jar
[INFO] Scanning for projects...
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven
-clean-plugin/2.5/maven-clean-plugin-2.5.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:mave
n-clean-plugin:2.5: Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or on
e of its dependencies could not be resolved: Failed to read artifact descriptor
for org.apache.maven.plugins:maven-clean-plugin:jar:2.5
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven
-install-plugin/2.4/maven-install-plugin-2.4.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:mave
n-install-plugin:2.4: Plugin org.apache.maven.plugins:maven-install-plugin:2.4 o
r one of its dependencies could not be resolved: Failed to read artifact descrip
tor for org.apache.maven.plugins:maven-install-plugin:jar:2.4
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven
-deploy-plugin/2.7/maven-deploy-plugin-2.7.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:mave
n-deploy-plugin:2.7: Plugin org.apache.maven.plugins:maven-deploy-plugin:2.7 or
one of its dependencies could not be resolved: Failed to read artifact descripto
r for org.apache.maven.plugins:maven-deploy-plugin:jar:2.7
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven
-site-plugin/3.3/maven-site-plugin-3.3.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:mave
n-site-plugin:3.3: Plugin org.apache.maven.plugins:maven-site-plugin:3.3 or one
of its dependencies could not be resolved: Failed to read artifact descriptor fo
r org.apache.maven.plugins:maven-site-plugin:jar:3.3
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven
-antrun-plugin/1.3/maven-antrun-plugin-1.3.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:mave
n-antrun-plugin:1.3: Plugin org.apache.maven.plugins:maven-antrun-plugin:1.3 or
one of its dependencies could not be resolved: Failed to read artifact descripto
r for org.apache.maven.plugins:maven-antrun-plugin:jar:1.3
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven
-assembly-plugin/2.2-beta-5/maven-assembly-plugin-2.2-beta-5.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:mave
n-assembly-plugin:2.2-beta-5: Plugin org.apache.maven.plugins:maven-assembly-plu
gin:2.2-beta-5 or one of its dependencies could not be resolved: Failed to read
artifact descriptor for org.apache.maven.plugins:maven-assembly-plugin:jar:2.2-b
eta-5
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven
-dependency-plugin/2.8/maven-dependency-plugin-2.8.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:mave
n-dependency-plugin:2.8: Plugin org.apache.maven.plugins:maven-dependency-plugin
:2.8 or one of its dependencies could not be resolved: Failed to read artifact d
escriptor for org.apache.maven.plugins:maven-dependency-plugin:jar:2.8
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven
-release-plugin/2.3.2/maven-release-plugin-2.3.2.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:mave
n-release-plugin:2.3.2: Plugin org.apache.maven.plugins:maven-release-plugin:2.3
.2 or one of its dependencies could not be resolved: Failed to read artifact des
criptor for org.apache.maven.plugins:maven-release-plugin:jar:2.3.2
Downloading: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metada
ta.xml
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven
-metadata.xml
[WARNING] Could not transfer metadata org.apache.maven.plugins/maven-metadata.xm
l from/to central (https://repo.maven.apache.org/maven2): Connect to repo.maven.
apache.org:443 [repo.maven.apache.org/185.31.17.215] failed: Connection refused:
 connect
[WARNING] Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/
to central (https://repo.maven.apache.org/maven2): Connect to repo.maven.apache.
org:443 [repo.maven.apache.org/185.31.17.215] failed: Connection refused: connec
t
[WARNING] Failure to transfer org.apache.maven.plugins/maven-metadata.xml from h
ttps://repo.maven.apache.org/maven2 was cached in the local repository, resoluti
on will not be reattempted until the update interval of central has elapsed or u
pdates are forced. Original error: Could not transfer metadata org.apache.maven.
plugins/maven-metadata.xml from/to central (https://repo.maven.apache.org/maven2
): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/185.31.17.215] fa
iled: Connection refused: connect
[WARNING] Failure to transfer org.codehaus.mojo/maven-metadata.xml from https://
repo.maven.apache.org/maven2 was cached in the local repository, resolution will
 not be reattempted until the update interval of central has elapsed or updates
are forced. Original error: Could not transfer metadata org.codehaus.mojo/maven-
metadata.xml from/to central (https://repo.maven.apache.org/maven2): Connect to
repo.maven.apache.org:443 [repo.maven.apache.org/185.31.17.215] failed: Connecti
on refused: connect
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.619 s
[INFO] Finished at: 2016-02-11T12:51:15+01:00
[INFO] Final Memory: 6M/184M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'install' in the current project and in the p
lugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the re
positories [local (C:\Users\A\.m2\repository), central (https://repo.maven.apach
e.org/maven2)] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundF
orPrefixException

C:\Program Files\apache-maven-3.3.9\bin>

ATTEMPT 2 尝试2

I have installed all dependencies in maven after performing mvn clean install from eclipse I recieve below error? 从Eclipse执行mvn全新安装后,我已经在maven中安装了所有依赖关系,我收到以下错误?

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building analyzer 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.12.4/maven-surefire-plugin-2.12.4.pom
[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.12.4/maven-surefire-plugin-2.12.4.pom (11 KB at 4.0 KB/sec)
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire/2.12.4/surefire-2.12.4.pom
[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire/2.12.4/surefire-2.12.4.pom (14 KB at 44.0 KB/sec)
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/2.4/maven-jar-plugin-2.4.pom
[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/2.4/maven-jar-plugin-2.4.pom (6 KB at 26.3 KB/sec)
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ distributed.analyzer ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 9 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ distributed.analyzer ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 14 source files to D:\eclipse-workspace\DistributedAnalyzer\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: 16.491 s
[INFO] Finished at: 2016-02-11T17:10:55+01:00
[INFO] Final Memory: 10M/117M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project distributed.analyzer: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[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

ATTEMPT 3 尝试3

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building analyzer 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ distributed.analyzer ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 9 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ distributed.analyzer ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 14 source files to D:\eclipse-workspace\DistributedAnalyzer\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Analizador.java:[9,32] package org.apache.logging.log4j does not exist
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Analizador.java:[10,32] package org.apache.logging.log4j does not exist
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Analizador.java:[23,30] cannot find symbol
  symbol:   class Logger
  location: class com.distributed.analyzer.Analizador
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Ordenante.java:[9,32] package org.apache.logging.log4j does not exist
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Ordenante.java:[10,32] package org.apache.logging.log4j does not exist
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Ordenante.java:[38,30] cannot find symbol
  symbol:   class Logger
  location: class com.distributed.analyzer.Ordenante
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Manager.java:[8,32] package org.apache.logging.log4j does not exist
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Manager.java:[9,32] package org.apache.logging.log4j does not exist
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Manager.java:[22,30] cannot find symbol
  symbol:   class Logger
  location: class com.distributed.analyzer.Manager
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Main.java:[6,32] package org.apache.logging.log4j does not exist
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Main.java:[7,32] package org.apache.logging.log4j does not exist
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Main.java:[22,30] cannot find symbol
  symbol:   class Logger
  location: class com.distributed.analyzer.Main
[INFO] 12 errors 
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.057 s
[INFO] Finished at: 2016-02-11T17:35:25+01:00
[INFO] Final Memory: 16M/184M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project distributed.analyzer: Compilation failure: Compilation failure:
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Analizador.java:[9,32] package org.apache.logging.log4j does not exist
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Analizador.java:[10,32] package org.apache.logging.log4j does not exist
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Analizador.java:[23,30] cannot find symbol
[ERROR] symbol:   class Logger
[ERROR] location: class com.distributed.analyzer.Analizador
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Ordenante.java:[9,32] package org.apache.logging.log4j does not exist
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Ordenante.java:[10,32] package org.apache.logging.log4j does not exist
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Ordenante.java:[38,30] cannot find symbol
[ERROR] symbol:   class Logger
[ERROR] location: class com.distributed.analyzer.Ordenante
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Manager.java:[8,32] package org.apache.logging.log4j does not exist
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Manager.java:[9,32] package org.apache.logging.log4j does not exist
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Manager.java:[22,30] cannot find symbol
[ERROR] symbol:   class Logger
[ERROR] location: class com.distributed.analyzer.Manager
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Main.java:[6,32] package org.apache.logging.log4j does not exist
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Main.java:[7,32] package org.apache.logging.log4j does not exist
[ERROR] /D:/eclipse-workspace/DistributedAnalyzer/src/main/java/com/distributed/analyzer/Main.java:[22,30] cannot find symbol
[ERROR] symbol:   class Logger
[ERROR] location: class com.distributed.analyzer.Main
[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

For log4j.jar you have error caused by this : 对于log4j.jar您有以下原因引起的错误:

Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Failure to transfer org.apache.logging.log4j:log4j-api:pom:2.5 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.logging.log4j:log4j-api:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): Connection refused: connect

I think it's a problem of proxy because he can't connect to Maven Repository. 我认为这是代理的问题,因为他无法连接到Maven存储库。 So for this you can DL this jar and install it manually with the command below : 因此,您可以对此jar进行DL处理,并使用以下命令手动安装它:

mvn install:install-file -Dfile=<path to jar> -DgroupId=<group> -DartifactId=<artifact> -Dversion=<version> -Dpackaging=jar

and then declare it in your pom.xml with the configuration in the command line (mvn install:install ) with the same group , artifact and version. 然后使用相同的组,工件和版本在命令行(mvn install:install)中的配置在pom.xml中声明它。 Then launch mvn clean install and it will be fine 然后启动mvn clean install就可以了

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Maven - ERROR StatusLogger找不到log4j2配置文件 - Maven - ERROR StatusLogger No log4j2 configuration file found 错误StatusLogger找不到log4j2配置文件。 使用默认配置:仅将错误记录到控制台 - ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console PreBuiltTransportClient 写入消息:错误 StatusLogger 找不到 log4j2 配置文件 - PreBuiltTransportClient Writes Message : ERROR StatusLogger No log4j2 configuration file found 错误 StatusLogger 未找到 log4j2 配置文件。 在更新 Struts 2.5.12 版本时 - ERROR StatusLogger No log4j2 configuration file found. While updating the version 2.5.12 of Struts log4j2 - StatusLogger未找到Log4j 2配置文件。 使用默认配置 - log4j2 - StatusLogger No Log4j 2 configuration file found. Using default configuration 错误StatusLogger找不到log4j2配置文件。 使用ANT目标进行编译时使用默认配置 - ERROR StatusLogger No log4j2 configuration file found. Using default configuration while compiling using ANT target Log4j2 配置 - 找不到 log4j2 配置文件 - Log4j2 configuration - No log4j2 configuration file found 在将jmeter依赖项添加到我的pom.xml中时,获取log4j错误ERROR StatusLogger“未找到log4j2配置文件” - Gettting log4j error ERROR StatusLogger “No log4j2 configuration file found” while adding jmeter dependencies to my pom.xml 错误 StatusLogger Log4j2 找不到日志记录实现 - ERROR StatusLogger Log4j2 could not find a logging implementation log4j2 错误 StatusLogger 无法识别的转换说明符 - log4j2 ERROR StatusLogger Unrecognized conversion specifier
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM