ì 我得到java.lang.noclassdeffounderror:com/railinc/emis/services/soapfaultvalidationerror,即使在构建路径上指定的类作为jar(equipment service.jar)的一部分出现,我对这个错误感到非常沮丧。它是一个spring引导应用程序。下面是我的pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-
4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.uprr.ngl.mse.maintenance.schedule</groupId>
<artifactId>ems-ngl-mse-batch-maintenance-schedule-1_0</artifactId>
<version>1.0</version>
<description> The purpose of this application is to run a batch job for maintenance
schedule</description>
<name>ems-ngl-mse-batch-maintenance-schedule-1_0</name>
<properties>
<ice-cube-name>ems-ngl-mse-batch-maintenance-schedule-1_0</ice-cube-name>
<main-class-name>com.uprr.ngl.mse.maintenanceSchedule.Application</main-class-name>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<jacoco-acceptance-percentage>0.80</jacoco-acceptance-percentage>
<pitest.mutationThreshold>80</pitest.mutationThreshold>
<spring.boot.version>2.1.5.RELEASE</spring.boot.version>
<lib.dir>${project.basedir}/lib</lib.dir>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.uprr.netcontrol.shared.xml-bindings.jaxb2</groupId>
<artifactId>nc-shared-xml-bindings-jaxb2-timed-job-timed-job-triggered-1_0</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.uprr.netcontrol.shared.xml-bindings.jaxb2</groupId>
<artifactId>nc-shared-xml-bindings-jaxb2-timed-job-timed-job-status-updated-1_0</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring.boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>com.uprr.enterprise</groupId>
<artifactId>uprr-diesel-spring-boot-starter</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>com.uprr.netcontrol.shared</groupId>
<artifactId>nc-shared-jms-retry</artifactId>
<version>${nc-shared-jms-retry.version}</version>
</dependency>
<dependency>
<groupId>com.uprr.netcontrol.shared.components.business-transaction-tracing</groupId>
<artifactId>business-transaction-tracing-xmf-toolkit</artifactId>
<version>${btt-xmf-toolkit.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.uprr.netcontrol.shared.components.business-transaction-tracing</groupId>
<artifactId>business-transaction-tracing-eeb-toolkit</artifactId>
<version>${btt-eeb-toolkit.version}</version>
<scope>compile</scope>
</dependency>
<groupId>com.uprr.netcontrol.core.shared</groupId>
<artifactId>core-util</artifactId>
<version>0.0.7</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.uprr.netcontrol.shared.xml-bindings.jaxb2</groupId>
<artifactId>nc-shared-xml-bindings-jaxb2-timed-job-timed-job-triggered-1_0</artifactId>
<!-- <version>2.0.0</version> -->
</dependency>
<dependency>
<groupId>com.uprr.netcontrol.shared.xml-bindings.jaxb2</groupId>
<artifactId>nc-shared-xml-bindings-jaxb2-timed-job-timed-job-status-updated-1_0</artifactId>
<!-- <version>1.0.1</version> -->
</dependency>
<!-- Spring Boot -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>javax.cache</groupId>
<artifactId>cache-api</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.4.0</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Testing -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- JMS Configuration start -->
<dependency>
<groupId>javax.jms</groupId>
<artifactId>javax.jms-api</artifactId>
</dependency>
<dependency>
<groupId>com.uprr.xmf.toolkit</groupId>
<artifactId>xmf3</artifactId>
<version>3.3.2</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
</dependency>
<dependency>
<groupId>com.uprr.enterprise.data</groupId>
<artifactId>uprr-datasource-ucp</artifactId>
<version>1.0.0</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>org.apache.axis</groupId>
<artifactId>axis</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>axis</groupId>
<artifactId>axis-jaxrpc</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>com.uprr.netcontrol.shared.xml-bindings.jaxb2</groupId>
<artifactId>jaxb-shared-inspection-dates-changed</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>com.lowagie</groupId>
<artifactId>itext</artifactId>
<version>2.0.8</version>
</dependency>
<dependency>
<groupId>com.uprr.app</groupId>
<artifactId>xsd</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${lib.dir}/xsd.jar</systemPath>
</dependency>
<dependency>
<groupId>com.uprr.app</groupId>
<artifactId>equipment-service</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${lib.dir}/equipment-service.jar</systemPath>
</dependency>
<dependency>
<groupId>com.uprr.app</groupId>
<artifactId>xsc-client</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${lib.dir}/xsc-client.jar</systemPath>
</dependency>
<dependency>
<groupId>com.uprr.app</groupId>
<artifactId>xsd</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${lib.dir}/xsd.jar</systemPath>
</dependency>
<dependency>
<groupId>com.uprr.app</groupId>
<artifactId>xmf2</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${lib.dir}/xmf-3_0_1.jar</systemPath>
</dependency>
<dependency>
<groupId>com.uprr.netcontrol.shared.xml-bindings.jaxb2</groupId>
<artifactId>jaxb-equipment-storage-lifecycle-event</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
<build>
<defaultGoal>install</defaultGoal>
<!-- <finalName>target/${project.artifactId}-distribution</finalName> -->
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<configuration>
<tagNameFormat>@{project.version}</tagNameFormat>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<inherited>true</inherited>
<configuration>
<encoding>${project.build.sourceEncoding}</encoding>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<packagingExcludes>
WEB-INF/lib/spring-boot-devtools-*.jar
</packagingExcludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.21.0</version>
<inherited>false</inherited>
<configuration>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<systemPropertyVariables>
<org.springframework.boot.logging.LoggingSystem>none</org.springframework.boot.logging.LoggingSystem>
<uprr.implementation.environment>${testing.env}</uprr.implementation.environment>
<app.log.active.profile>local</app.log.active.profile>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.21.0</version>
<configuration>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<systemPropertyVariables>
<org.springframework.boot.logging.LoggingSystem>none</org.springframework.boot.logging.LoggingSystem>
<uprr.implementation.environment>${testing.env}</uprr.implementation.environment>
<app.log.active.profile>local</app.log.active.profile>
</systemPropertyVariables>
</configuration>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
<execution>
<id>verify</id>
<goals>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring.boot.version}</version>
<configuration>
<jvmArguments>
-Dorg.springframework.boot.logging.LoggingSystem=none
-Duprr.implementation.environment=${my.env}
-Dapp.log.active.profile=local
</jvmArguments>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>devtools</id>
<activation>
<property>
<name>env</name>
<value>local</value>
</property>
</activation>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
</dependencies>
</profile>
<profile>
<id>ice-platform</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>com.uprr.ice</groupId>
<artifactId>ice-deployer-maven-plugin</artifactId>
<version>1.0.7</version>
<configuration>
<cluster>${ice-cube-name}</cluster>
<tag>trunk</tag>
<deployType>ALL_AT_ONCE</deployType>
<archive>
target/${project.artifactId}-distribution.zip
</archive>
</configuration>
<executions><!-- Binds the deploy phase in the plugin to the build phase -->
<execution>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.uprr.ice.plugin.xml</groupId>
<artifactId>ice-xml-maven-plugin</artifactId>
<version>1.0.11</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>ice-generate</goal>
</goals>
<configuration>
<mainClassName>${main-class-name}</mainClassName>
<systemPropertyVariables>
<org.springframework.boot.logging.LoggingSystem>none</org.springframework.boot.logging.LoggingSystem>
</systemPropertyVariables>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeScope>runtime</includeScope>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<!-- spring-boot-devtools are only for local IDEs -->
<excludeArtifactIds>spring-boot-devtools</excludeArtifactIds>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>src/main/assembly/assembly-ice.xml</descriptor>
</descriptors>
<finalName>${project.artifactId}</finalName>
</configuration>
</execution>
</executions>
</plugin>
<plugin><!-- Skips the Maven Repo Deploy step -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<!-- Run code and mutation coverage and generate reports in target directory -->
<id>ci</id>
<properties>
<!-- JaCoCo -->
<jacoco.outputDirectory>${project.build.directory}/coverage-
reports/jacoco</jacoco.outputDirectory>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M2</version>
<executions>
<execution>
<configuration>
<rules>
<requireUpperBoundDeps/>
<banDuplicateClasses/>
</rules>
</configuration>
<goals>
<goal>enforce</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- JaCoCo (Code Coverage) -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.2</version>
<configuration>
<haltOnFailure>true</haltOnFailure>
<outputDirectory>${jacoco.outputDirectory}</outputDirectory>
<!-- These exclusions must be kept in sync with the PIT testing below-->
<excludes>
<exclude>**/*Config.*</exclude>
<exclude>**/*Test.*</exclude>
<exclude>**/*Model.*</exclude>
<exclude>**/*Dto.*</exclude>
<exclude>**/dto/**</exclude>
<exclude>**/bindings/**</exclude>
<exclude>**/*Exception.*</exclude>
<exclude>**/Application.*</exclude>
</excludes>
<rules>
<rule>
<element>BUNDLE</element>
<limits>
<limit>
<counter>INSTRUCTION</counter>
<value>COVEREDRATIO</value>
<minimum>${jacoco-acceptance-percentage}</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>default-report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>default-check</id>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- PiTest (Mutation Coverage) -->
<plugin>
<groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId>
<version>1.4.2</version>
<configuration>
<timestampedReports>false</timestampedReports>
<coverageThreshold>0</coverageThreshold>
<mutationThreshold>${pitest.mutationThreshold}</mutationThreshold>
<failWhenNoMutations>false</failWhenNoMutations>
<targetClasses>
<param>com.uprr.appTla.*</param>
</targetClasses>
<excludedClasses>
<!-- Exclude classes which can't be or don't need to be tested -->
<excludedClass>**Config</excludedClass>
<excludedClass>**IT</excludedClass>
<excludedClass>**Model</excludedClass>
<excludedClass>**Dto</excludedClass>
<excludedClass>**.dto.**</excludedClass>
<excludedClass>**.bindings.**</excludedClass>
<excludedClass>**Exception</excludedClass>
<excludedClass>**.Application</excludedClass>
</excludedClasses>
<excludedMethods>
<!-- Exclude methods that are boiler plate -->
<excludedMethod>equals</excludedMethod>
<excludedMethod>hashCode</excludedMethod>
<excludedMethod>toString</excludedMethod>
</excludedMethods>
<targetTests>
<!--
Don't use Integration Tests for mutation coverage.
it's dangerous as it could mess up the real environment.
-->
<param>com.uprr.appTla.*Test</param>
</targetTests>
<outputFormats>
<outputFormat>XML</outputFormat>
<outputFormat>HTML</outputFormat>
</outputFormats>
</configuration>
<executions>
<execution>
<id>run_pitest</id>
<phase>verify</phase>
<goals>
<goal>mutationCoverage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
下面是我的错误控制台
下面是错误控制台下面是错误控制台
Caused by: java.lang.IllegalStateException: Failed to introspect Class [com.uprr.ngl.mse.maintenanceSchedule.service.EquipmentServiceClient] from ClassLoader [sun.misc.Launcher$AppClassLoader@18b4aac2]
AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:593) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
... 17 more
Caused by: java.lang.NoClassDefFoundError: com/railinc/emis/services/SoapFaultValidationError
at java.lang.Class.getDeclaredMethods0(Native Method) ~[?:1.8.0_242]
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:593) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
... 17 more
Caused by: java.lang.ClassNotFoundException: com.railinc.emis.services.SoapFaultValidationError
at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[?:1.8.0_242]
at java.lang.ClassLoader.loadClass(ClassLoader.java:419) ~[?:1.8.0_242]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352) ~[?:1.8.0_242]
注意:soapfaultvalidationerror类存在于我的生成路径中。我仍然没有发现任何错误。请帮帮我
暂无答案!
目前还没有任何答案,快来回答吧!