- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有以下 pom.xml,其中包含手动 jax deps jaxb-api
、jaxb-impl
和 jaxb-core
由于其从 JDK 11 中删除:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.0.M2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<java.version>11</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<spring-cloud.version>Greenwich.RELEASE</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
<version>2.3.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<!--TEST-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<!--Three below dependencies due to JDK 11 removed jaxb-->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.3.0</version>
</dependency>
<!--For Eureka Client-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<!-- Spring Cloud Config Client -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<!--To provide version for Eureka Client -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</pluginRepository>
</pluginRepositories>
在mvn clean:install
之后,但是当尝试运行应用程序时,我不断收到有关过滤器的错误。
22:45:16.622 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.cloud.autoconfigure.RefreshAutoConfiguration$RefreshScopeBeanDefinitionEnhancer' Exception in thread "main" java.lang.TypeNotPresentException: Type javax.servlet.Filter not present at java.base/sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:117) at java.base/sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:125) at java.base/sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49) at java.base/sun.reflect.generics.visitor.Reifier.reifyTypeArguments(Reifier.java:68) at java.base/sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:138) at java.base/sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49) at java.base/sun.reflect.generics.repository.ClassRepository.computeSuperInterfaces(ClassRepository.java:117) at java.base/sun.reflect.generics.repository.ClassRepository.getSuperInterfaces(ClassRepository.java:95) at java.base/java.lang.Class.getGenericInterfaces(Class.java:1138) at org.springframework.core.ResolvableType.getInterfaces(ResolvableType.java:491) at org.springframework.core.ResolvableType.as(ResolvableType.java:449) at org.springframework.core.ResolvableType.as(ResolvableType.java:450) at org.springframework.core.ResolvableType.forMethodParameter(ResolvableType.java:1305) at org.springframework.core.ResolvableType.forMethodParameter(ResolvableType.java:1272) at org.springframework.core.ResolvableType.forMethodParameter(ResolvableType.java:1262) at org.springframework.core.BridgeMethodResolver.isResolvedTypeMatch(BridgeMethodResolver.java:157) at org.springframework.core.BridgeMethodResolver.isBridgeMethodFor(BridgeMethodResolver.java:141) at org.springframework.core.BridgeMethodResolver.searchCandidates(BridgeMethodResolver.java:120) at org.springframework.core.BridgeMethodResolver.findBridgedMethod(BridgeMethodResolver.java:82) at org.springframework.core.annotation.AnnotationsScanner.processMethodAnnotations(AnnotationsScanner.java:386) at org.springframework.core.annotation.AnnotationsScanner.processMethodHierarchy(AnnotationsScanner.java:266) at org.springframework.core.annotation.AnnotationsScanner.processMethod(AnnotationsScanner.java:236) at org.springframework.core.annotation.AnnotationsScanner.process(AnnotationsScanner.java:109) at org.springframework.core.annotation.AnnotationsScanner.scan(AnnotationsScanner.java:96) at org.springframework.core.annotation.AnnotationsScanner.scan(AnnotationsScanner.java:77) at org.springframework.core.annotation.TypeMappedAnnotations.scan(TypeMappedAnnotations.java:241) at org.springframework.core.annotation.TypeMappedAnnotations.isPresent(TypeMappedAnnotations.java:97) at org.springframework.core.annotation.AnnotatedElementUtils.hasAnnotation(AnnotatedElementUtils.java:531) at org.springframework.context.annotation.BeanAnnotationHelper.isBeanAnnotated(BeanAnnotationHelper.java:41) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.isMatch(ConfigurationClassEnhancer.java:439) at org.springframework.context.annotation.ConfigurationClassEnhancer$ConditionalCallbackFilter.accept(ConfigurationClassEnhancer.java:192) at org.springframework.cglib.proxy.Enhancer.emitMethods(Enhancer.java:1214) at org.springframework.cglib.proxy.Enhancer.generateClass(Enhancer.java:723) at org.springframework.cglib.transform.TransformingClassGenerator.generateClass(TransformingClassGenerator.java:33) at org.springframework.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanFactoryAwareGeneratorStrategy.generate(ConfigurationClassEnhancer.java:252) at org.springframework.cglib.core.AbstractClassGenerator.generate(AbstractClassGenerator.java:358) at org.springframework.cglib.proxy.Enhancer.generate(Enhancer.java:582) at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:110) at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:108) at org.springframework.cglib.core.internal.LoadingCache$2.call(LoadingCache.java:54) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at org.springframework.cglib.core.internal.LoadingCache.createEntry(LoadingCache.java:61) at org.springframework.cglib.core.internal.LoadingCache.get(LoadingCache.java:34) at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData.get(AbstractClassGenerator.java:134) at org.springframework.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:319) at org.springframework.cglib.proxy.Enhancer.createHelper(Enhancer.java:569) at org.springframework.cglib.proxy.Enhancer.createClass(Enhancer.java:416) at org.springframework.context.annotation.ConfigurationClassEnhancer.createClass(ConfigurationClassEnhancer.java:137) at org.springframework.context.annotation.ConfigurationClassEnhancer.enhance(ConfigurationClassEnhancer.java:109) at org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:429) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:263) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:286) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:130) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:705) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:531) at org.springframework.context.annotation.AnnotationConfigApplicationContext.(AnnotationConfigApplicationContext.java:88) at com.example.authservice.AuthServiceApplication.main(AuthServiceApplication.java:13) Caused by: java.lang.ClassNotFoundException: javax.servlet.Filter at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:398) at java.base/sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:114)
添加 3 个额外的依赖项后还有什么问题吗?
最佳答案
spring-security-oauth2 项目目前对 Spring MVC 和 Servlet API 具有很强的依赖性。请引用WebFlux oauth2 doc
关于java - JDK 11 Spring Boot 2 .TypeNotPresentException : Type javax. servlet.Filter 不存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55986692/
我有一个子类,它有一个在 Android 项目中抛出异常的方法。 public class Bar extends Foo { public void method(String someCl
我有一个包含 16 个模块的 android 项目。其中许多是 java 模块,有些包括注释处理。我还针对 Java 1.8,包括对 lambda 和其他 Java 8 特性的支持。 我的大部分依赖项
我有一个应用程序,其 Gradle 模块结构类似于: app - applies war common/utilities common/auth等app模块应用 WAR 插件。当部署到远程服务器时,
Crashlytics compile('com.crashlytics.sdk.android:crashlytics:2.4.0@aar') 与应用程序集成,正在 nexus 7 4.4.4 上进
我已将 Maven Surefire 插件 (2.17) 添加到我们的项目中,但构建失败并出现以下错误。 Error injecting: org.apache.maven.plugin.surefi
我正在编写一个 Maven 插件,我需要知道 List 的类型哪里Person是在依赖项中定义的对象。该插件在process-classes期间运行阶段根据在宿主项目中带注释的类上找到的内容生成一些文
项目在 IntelliJ IDEA 2018.1.1 和 JDK 1.8.0_221 中成功运行当我们的新同事尝试在 IntelliJ IDEA 2019.1.1 中启动它时,他们都遇到了错误: or
我在我正在处理的 android 测试项目中设置了以下示例测试用例。 package com.whatever.test; import static org.junit.Assert.fail; i
我希望通过引用链接 http://www.adam-bien.com/roller/abien/entry/jax_rs_get_swagger_json 来创建 swagger.json 定义。我将
我有以下 pom.xml,其中包含手动 jax deps jaxb-api、jaxb-impl 和 jaxb-core 由于其从 JDK 11 中删除: org.springfram
我是 Maven 的新手,一直在尝试为一个项目创建构建。我开火时出现以下错误: mvn 全新安装 检查项目。 [INFO] --- maven-surefire-plugin:2.12.4:test
我的一个应用程序中出现了非常有趣的错误。我的应用程序在 android L 上运行良好,但是当我尝试在其他 android 版本上运行它时,我在尝试使用 Retrofit 调用 Web 服务时收到 C
我正在用 java 创建一个示例 maven 项目,当我在目标中指定测试时遇到这个异常,它给出了构建错误。但是clean , compile , test-compile工作正常。即结果成功构建但在我
我的grails应用程序中出现TypeNotPresentException。下面是Stacktrace片段 [INFO] [groovyc] java.lang.TypeNotPresentEx
我是一名优秀的程序员,十分优秀!