Я искал решение для этого, но мог найти что-нибудь разумное. Большинство из них связаны с банками. Я продолжаю получать эту расстраивающую ошибку:
15-Jan-2020 11: 36: 06.605 SEVERE [Catalina-utility-1] org. apache .catalina.core.StandardContext.listenerStart Контекст отправки исключения инициализированное событие для экземпляра прослушивателя класса [org.springframework.web.context.ContextLoaderListener] java .lang.NoClassDefFoundError: org / apache / commons / logging / LogFactory в org.springframework.web.context.ConitxtA java: 269)
Это происходит из commons-logging.jar (1.2).
Я добавил свою зависимость, например:
<!-- https://mvnrepository.com/artifact/commons-logging/commons-logging -->
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</dependency>
Версия исходит от родительского pom. xml
У меня есть два заметных плагина:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<inherited>false</inherited>
<executions>
<execution>
<id>pal-copy-dependencies</id>
<phase>generate-sources</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<inherited>false</inherited>
<configuration>
<excludeScope>provided</excludeScope>
<excludeClassifiers>shared</excludeClassifiers>
<excludeTransitive>true</excludeTransitive>
<outputDirectory>${project.build.directory}/classes/lib</outputDirectory>
<overWriteIfNewer>true</overWriteIfNewer>
<silent>true</silent>
<useBaseVersion>false</useBaseVersion>
</configuration>
</execution>
</executions>
</plugin>
и
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<inherited>false</inherited>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<addDefaultEntries>true</addDefaultEntries>
<addBuildEnvironmentEntries>true</addBuildEnvironmentEntries>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
<classpathPrefix>WEB-INF/lib/</classpathPrefix>
</manifest>
</archive>
<attachClasses>true</attachClasses>
<classesClassifier>shared</classesClassifier>
<failOnMissingWebXml>true</failOnMissingWebXml>
<includeEmptyDirectories>true</includeEmptyDirectories>
<outputDirectory>${project.basedir}\lib</outputDirectory>
<webResources>
<webResource>
<directory>src/main/resources/ProcessOrderService</directory>
<include>*.*</include>
<targetPath>/ProcessOrderService/wsdl/</targetPath>
</webResource>
</webResources>
</configuration>
</plugin>
Я не знаю, что Я делаю не так Когда я помещаю файл commons-logging.jar в папку lib Tomcat, он работает как чудо.
В этом файле войны есть зависимость, которую я имею:
<dependency>
<groupId>com.test.mypackage</groupId>
<artifactId>common-files</artifactId>
<version>${project.version}</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
Здесь также используется регистрация общего достояния в объеме compile
. Но эта зависимость должна остаться provided
. Не могу изменить это!
Единственной другой зависимостью, которая могла вызвать конфликт или что-то еще, был activemq-core.jar, но я добавил к нему параметр exclusion. Но все равно не сработало.
Буду признателен за любую помощь! Спасибо!