当前位置: 首页 > 知识库问答 >
问题:

Maven spring boot应用程序启动失败-jmxAutoConfiguration.mbeanExporter

空英逸
2023-03-14

我正在使用一个spring boot项目2年了,我只是试图让一个同事参与,但我不能让存储库在他的计算机上运行。因此,我已经删除了我的.m2文件夹,并再次克隆了我自己的项目,我可以重现错误,但问题是我无法修复它。

spring boot版本:1.5.22.发布。有什么建议吗?

2021-03-08 15:29:48.563 [restartedMain] INFO  d.a.s.SpringBootproject - No active profile set, falling back to default profiles: default
2021-03-08 15:29:48.709 [background-preinit] INFO  o.h.v.internal.util.Version - HV000001: Hibernate Validator 5.3.6.Final
2021-03-08 15:29:48.789 [restartedMain] INFO  o.s.b.c.e.AnnotationConfigEmbeddedWebApplicationContext - Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@72d24d6a: startup date [Mon Mar 08 15:29:48 CET 2021]; root of context hierarchy
2021-03-08 15:29:53.456 [restartedMain] INFO  o.s.b.f.x.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [META-INF/cxf/cxf.xml]
2021-03-08 15:29:53.677 [restartedMain] ERROR o.s.boot.SpringApplication - Application startup failed
java.lang.IllegalStateException: Error processing condition on org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration.mbeanExporter
    at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:60)
    at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:102)
    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod(ConfigurationClassBeanDefinitionReader.java:179)
    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:140)
    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:116)
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:320)
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:228)
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:272)
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:92)
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:687)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:524)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:123)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:666)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:353)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:300)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1082)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1071)
    at de.myproject.project.SpringBootproject.main(SpringBootproject.java:40)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: java.lang.reflect.MalformedParameterizedTypeException: null
    at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.validateConstructorArguments(ParameterizedTypeImpl.java:58)
    at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.<init>(ParameterizedTypeImpl.java:51)
    at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.make(ParameterizedTypeImpl.java:92)
    at sun.reflect.generics.factory.CoreReflectionFactory.makeParameterizedType(CoreReflectionFactory.java:105)
    at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:140)
    at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
    at sun.reflect.generics.repository.MethodRepository.getReturnType(MethodRepository.java:68)
    at java.lang.reflect.Method.getGenericReturnType(Method.java:255)
    at org.springframework.core.MethodParameter.getGenericParameterType(MethodParameter.java:397)
    at org.springframework.core.SerializableTypeWrapper$MethodParameterTypeProvider.getType(SerializableTypeWrapper.java:338)
    at org.springframework.core.SerializableTypeWrapper.forTypeProvider(SerializableTypeWrapper.java:146)
    at org.springframework.core.ResolvableType.forType(ResolvableType.java:1346)
    at org.springframework.core.ResolvableType.forMethodParameter(ResolvableType.java:1249)
    at org.springframework.core.ResolvableType.forMethodParameter(ResolvableType.java:1217)
    at org.springframework.core.ResolvableType.forMethodReturnType(ResolvableType.java:1160)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:759)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:638)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:607)
    at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1496)
    at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1018)
    at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry.addBeanTypeForNonAliasDefinition(BeanTypeRegistry.java:217)
    at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry.addBeanTypeForNonAliasDefinition(BeanTypeRegistry.java:195)
    at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry.addBeanType(BeanTypeRegistry.java:188)
    at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry.updateTypesIfNecessary(BeanTypeRegistry.java:175)
    at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry.getNamesForType(BeanTypeRegistry.java:112)
    at org.springframework.boot.autoconfigure.condition.OnBeanCondition.collectBeanNamesForType(OnBeanCondition.java:171)
    at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getBeanNamesForType(OnBeanCondition.java:158)
    at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchingBeans(OnBeanCondition.java:128)
    at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchOutcome(OnBeanCondition.java:103)
    at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47)
    ... 22 common frames omitted
2021-03-08 15:29:53.679 [restartedMain] INFO  o.s.b.c.e.AnnotationConfigEmbeddedWebApplicationContext - Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@72d24d6a: startup date [Mon Mar 08 15:29:48 CET 2021]; root of context hierarchy
2021-03-08 15:29:53.681 [restartedMain] WARN  o.s.boot.SpringApplication - Unable to close ApplicationContext
java.lang.reflect.MalformedParameterizedTypeException: null
    at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.validateConstructorArguments(ParameterizedTypeImpl.java:58)
    at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.<init>(ParameterizedTypeImpl.java:51)
    at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.make(ParameterizedTypeImpl.java:92)
    at sun.reflect.generics.factory.CoreReflectionFactory.makeParameterizedType(CoreReflectionFactory.java:105)
    at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:140)
    at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
    at sun.reflect.generics.repository.MethodRepository.getReturnType(MethodRepository.java:68)
    at java.lang.reflect.Method.getGenericReturnType(Method.java:255)
    at org.springframework.core.MethodParameter.getGenericParameterType(MethodParameter.java:397)
    at org.springframework.core.SerializableTypeWrapper$MethodParameterTypeProvider.getType(SerializableTypeWrapper.java:338)
    at org.springframework.core.SerializableTypeWrapper.forTypeProvider(SerializableTypeWrapper.java:146)
    at org.springframework.core.ResolvableType.forType(ResolvableType.java:1346)
    at org.springframework.core.ResolvableType.forMethodParameter(ResolvableType.java:1249)
    at org.springframework.core.ResolvableType.forMethodParameter(ResolvableType.java:1217)
    at org.springframework.core.ResolvableType.forMethodReturnType(ResolvableType.java:1160)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:759)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:638)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:607)
    at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1496)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:425)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:395)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:515)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:508)
    at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1190)
    at org.springframework.boot.SpringApplication.getExitCodeFromMappedException(SpringApplication.java:785)
    at org.springframework.boot.SpringApplication.getExitCodeFromException(SpringApplication.java:773)
    at org.springframework.boot.SpringApplication.handleExitCode(SpringApplication.java:760)
    at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:715)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:310)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1082)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1071)
    at de.myproject.project.SpringBootproject.main(SpringBootproject.java:40)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)

到目前为止我所做的:

  • 使用maven-resources-plugin修复了所有依赖关系警告/错误
  • 将以下参数添加到我的application.yml
spring:
    jmx:
       enabled: false
  • 试图排除@SpringBootApplication
  • 中的 JMXAutoConfiguration.Class
  • 检查了Eclipse IDE中是否使用了Java 8。

感谢任何帮助。

共有1个答案

凤伟泽
2023-03-14

@Deveprasad Sharma

这是spring boot配置:

package de.myproject.project;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;
import org.springframework.core.env.Environment;

import de.all4cloud.scan4cloud.config.JpaConfig;
import de.all4cloud.scan4cloud.tenant.settings.SettingsService;

@Import(JpaConfig.class)
@SpringBootApplication(scanBasePackages =
{ "de.myproject.project" }, exclude =
{ DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class, FlywayAutoConfiguration.class })
public class SpringBootproject extends SpringBootServletInitializer
{
    @Autowired
    private SettingsService settingsService;

    @Autowired
    private Environment environment;

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
    {
        return application.sources(SpringBootproject.class);
    }

    public static void main(String[] args) throws Exception
    {
        SpringApplication.run(SpringBootproject.class, args);
    }

    @Bean
    public InitializingBean startupDevSettings()
    {
        return () ->
        {
            if (environment.getActiveProfiles().length == 0 || !environment.getActiveProfiles()[0].equals("production"))
            {
                settingsService.devSettings();
            }
        };
    }
}

第40行是SpringApplication.Run(SpringBootProject.Class,args);

 类似资料:
  • 我是spring的初学者,希望这样做示例项目…我有一个数据库,我想连接到它…我使用了像AutoWired和service这样的注释。但有个问题我解决不了 Controller包中的RegisterationController具有我要调用的服务: 第一个包中的DataManagement类: 第一包中的StudentAccountRepository: 第一包中得学生帐户..引用数据库中的表: M

  • > 出错原因:任务“:bootrun”执行失败。 进程'command'/library/java/javavirtualmachines/jdk1.8.0_60.jdk/contents/home/bin/java''以非零退出值1完成 发生异常:2015-08-23 01:37:57.989 WARN 6186---[main]ationConfigEmbeddedWebApplication

  • 当我运行这个错误时,请帮助我解决这个问题 启动应用程序上下文时出错。要显示条件,请报告启用“调试”后重新运行应用程序。2019-02-11 10:53:55.839错误8804 --- [ restartedMain]o. s. b. d.日志失败分析记者: 应用程序启动失败 说明: com中的字段userDao。实例Spring Security应用程序编程接口。服务UserServiceImp

  • 当我在WebSphere8.5.5中启动应用程序时,我得到了一个错误,并且应用程序启动失败,我搜索日志并得到了这个堆栈跟踪。你们知道吗?

  • 当我启动Spring Boot应用程序时,我得到了: 2020-11-11 03:02:24.333警告20648--[main]ConfigServletWebServerApplicationContext:上下文初始化过程中遇到异常-取消刷新尝试:org.springframework.beans.factory.unsatisfiedDependencyException:创建名为“org

  • 我正试图在设备上启动我的应用程序。它正在模拟器上成功发射。 null null 会不会是带有代码签名的东西? 目前我已将其设置为“不编码签名”