java.lang.ClassNotFoundException:org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration

时间:2018-07-06 02:12:19

标签: java spring-boot

  1. 我自己设置了项目springboot + dubbo,该项目可以启动 通常,但是我添加了一种融合机制 spring-cloud-starter-hystrix,该项目将无法启动。 下列:         org.springframework.boot         弹簧启动启动器父母         1.4.7。发布     

    <properties>
        <springboot_version>1.4.7.RELEASE</springboot_version>
        <springboot_dubbo_version>2.0.0</springboot_dubbo_version>
        <netflix_hystrix_version>1.4.4.RELEASE</netflix_hystrix_version>
        <zookeeper_version>3.4.8</zookeeper_version>
        <zkclient_version>0.9</zkclient_version>
        <junit_version>4.12</junit_version>
    </properties>
    
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <version>${springboot_version}</version>
        </dependency>
        <dependency>
            <groupId>com.alibaba.spring.boot</groupId>
            <artifactId>dubbo-spring-boot-starter</artifactId>
            <version>${springboot_dubbo_version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-autoconfigure</artifactId>
            <version>${springboot_version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit_version}</version>
            <scope>test</scope>
        </dependency>
        <!-- zookeeper start-->
        <dependency>
            <groupId>org.apache.zookeeper</groupId>
            <artifactId>zookeeper</artifactId>
            <version>${zookeeper_version}</version>
            <scope>compile</scope>
            <exclusions>
                <exclusion>
                    <groupId>log4j</groupId>
                    <artifactId>log4j</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.101tec</groupId>
            <artifactId>zkclient</artifactId>
            <version>${zkclient_version}</version>
            <exclusions>
                <exclusion>
                    <groupId>log4j</groupId>
                    <artifactId>log4j</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- zookeeper end-->
        <dependency>
            <groupId>com.bee.tsmall</groupId>
            <artifactId>tsmall-common</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
        <!--<dependency>-->
        <!--<groupId>org.springframework.cloud</groupId>-->
        <!--<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>-->
        <!--<version>${netflix_hystrix_version}</version>-->
        <!--<exclusions>-->
        <!--<exclusion>-->
        <!--<groupId>com.google.guava</groupId>-->
        <!--<artifactId>guava</artifactId>-->
        <!--</exclusion>-->
        <!--<exclusion>-->
        <!--<groupId>com.netflix.archaius</groupId>-->
        <!--<artifactId>archaius-core</artifactId>-->
        <!--</exclusion>-->
        <!--</exclusions>-->
        <!--</dependency>-->
        <dependency> <!--I add this dependence to the mistake -->
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-hystrix</artifactId>
            <version>1.4.5.RELEASE</version>
            <exclusions>
                <exclusion>
                    <groupId>com.google.guava</groupId>
                    <artifactId>guava</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.netflix.archaius</groupId>
                    <artifactId>archaius-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>
    

错误

  

错误如下:强文本 09:56:57.825 [main]错误       org.springframework.boot.SpringApplication-应用程序启动       失败的java.lang.IllegalArgumentException:找不到类       [org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration]         在       org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:287)         在       org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:176)         在       org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:102)         在       org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:68)         在       org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167)         在       org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)         在       org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:122)         在       org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:72)         在       org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54)         在       org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:338)         在       org.springframework.boot.SpringApplication.run(SpringApplication.java:309)         在       org.springframework.boot.SpringApplication.run(SpringApplication.java:1187)         在       org.springframework.boot.SpringApplication.run(SpringApplication.java:1176)         在       com.bee.tsmall.ProducerApplication.main(ProducerApplication.java:24)       造成原因:java.lang.ClassNotFoundException:       org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration         在java.net.URLClassLoader.findClass(URLClassLoader.java:381)在       java.lang.ClassLoader.loadClass(ClassLoader.java:424)在       sun.misc.Launcher $ AppClassLoader.loadClass(Launcher.java:335)在       java.lang.ClassLoader.loadClass(ClassLoader.java:357)在       org.springframework.util.ClassUtils.forName(ClassUtils.java:250)在       org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:284)         ...省略了13个常见框架

期待您的回答。

0 个答案:

没有答案