sitewhere/sitewhere-examples

NoClassDefFoundError

Closed this issue · 0 comments

After I ran the "gradle clean tomcatRun" command, I encountered the following error:

E:\sitewhere-examples-master\air-traffic>gradle clean tomcatRun
Starting a Gradle Daemon, 1 incompatible and 2 stopped Daemons could not be reused, use --status for details
Download http://repo.maven.apache.org/maven2/org/slf4j/slf4j-log4j12/1.7.13/slf4j-log4j12-1.7.13.jar
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/win10/.gradle/caches/modules-2/files-2.1/org.apache.activemq/activemq-all/5.10.0/bb376083b608a6f74e3d3c06afb92049549302c9/activemq-all-5.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/win10/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-log4j12/1.7.13/55517a839e93c29d8a6ce8d8504a3e124e3a5a2f/slf4j-log4j12-1.7.13.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/win10/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-classic/1.1.3/d90276fff414f06cb375f2057f6778cd63c6082f/logback-classic-1.1.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
log4j:WARN No appenders could be found for logger (org.springframework.web.servlet.DispatcherServlet).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

Task :air-traffic:tomcatRun
Started Tomcat Server
The Server is running at http://localhost:8090/airtraffic
The web application [/airtraffic] appears to have started a thread named [pool-2-thread-1] but has failed to stop it. This is very likely to create a memory leak.

Exception in thread "pool-2-thread-1" java.lang.NoClassDefFoundError: org/apache/logging/log4j/message/SimpleMessage
at org.apache.logging.log4j.message.AbstractMessageFactory.newMessage(AbstractMessageFactory.java:48)
at org.apache.logging.log4j.spi.AbstractLogger.logMessage(AbstractLogger.java:1011)
at org.apache.logging.log4j.spi.AbstractLogger.logIfEnabled(AbstractLogger.java:988)
at org.apache.logging.log4j.spi.AbstractLogger.info(AbstractLogger.java:684)
at com.sitewhere.examples.airtraffic.AirTrafficModelLoader$AirTrafficModel.waitForSiteWhereToStart(AirTrafficModelLoader.java:175)
at com.sitewhere.examples.airtraffic.AirTrafficModelLoader$AirTrafficModel.run(AirTrafficModelLoader.java:142)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.message.SimpleMessage
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
... 9 more

Task :air-traffic:tomcatRun FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':air-traffic:tomcatRun'.

An error occurred starting the Tomcat server.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.7/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 34s
4 actionable tasks: 3 executed, 1 up-to-date

Can anyone helps me to solve this problem? Thanks a lot!