javax.servlet.ServletException: не удалось создать экземпляр класса WebApplicationInitializer весной 5, дубликат не помог мне - PullRequest
0 голосов
/ 30 января 2020

Я пытался полностью настроить аннотацию на основе пружины 5 mvc и столкнулся с приведенным ниже исключением, обнаружил похожую проблему, но она мне не помогла.

ниже приведены исключения, которые я получаю.

SEVERE: Error during ServletContainerInitializer processing
javax.servlet.ServletException: Failed to instantiate WebApplicationInitializer class
    at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:158)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5303)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:155)
    ... 8 more
Caused by: java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder
    at org.slf4j.LoggerFactory.getSingleton(LoggerFactory.java:189)
    at org.slf4j.LoggerFactory.bind(LoggerFactory.java:112)
    at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:105)
    at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:235)
    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:208)
    at org.apache.commons.logging.LogAdapter$Slf4jAdapter.createLocationAwareLog(LogAdapter.java:130)
    at org.apache.commons.logging.LogAdapter.createLog(LogAdapter.java:91)
    at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:67)
    at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:59)
    at org.springframework.web.context.AbstractContextLoaderInitializer.<init>(AbstractContextLoaderInitializer.java:45)
    at org.springframework.web.servlet.support.AbstractDispatcherServletInitializer.<init>(AbstractDispatcherServletInitializer.java:53)
    at org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer.<init>(AbstractAnnotationConfigDispatcherServletInitializer.java:44)
    at com.freelibrary.bookapi.config.MyWebAppInitializer.<init>(MyWebAppInitializer.java:5)
    ... 13 more
Caused by: java.lang.ClassNotFoundException: org.slf4j.impl.StaticLoggerBinder
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1333)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167)
    ... 26 more
...