Giter Site home page Giter Site logo

Comments (5)

xkcoding avatar xkcoding commented on May 2, 2024

首先帮你修改了下 issue 的规范,下次贴异常信息 麻烦使用下面的语法

```java
异常信息
```

其次,请问你是哪个模块报出的错误呢?根据日志,是 properties 模块,但是还是希望得到准确的异常信息

from spring-boot-demo.

k214k avatar k214k commented on May 2, 2024

异常信息如下:

 Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'applicationProperty': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'application.name' in value "${application.name}"

就是在

public class ApplicationProperty {
	@Value("${application.name}")
	private String name;
	@Value("${application.version}")
	private String version;
}

@Value("${application.name}") 这个无法注册

from spring-boot-demo.

xkcoding avatar xkcoding commented on May 2, 2024

第一,你的 ApplicationProperty 这个类上添加 @Component@Data 注解了吗?
第二,你的 application.yml 配置文件添加如下信息了吗?

application:
  name: prod环境 @artifactId@
  version: prod环境 @version@

from spring-boot-demo.

k214k avatar k214k commented on May 2, 2024

非常感谢,能在百忙之中给我回信息,由于对springboot不是太熟悉,一直在摸索,由于少加

spring:
  profiles:
    active: prod

已经解决了。

from spring-boot-demo.

xkcoding avatar xkcoding commented on May 2, 2024

没事,能解决问题就行,还有就是下次的提问,建议学学 markdown 的语法多学习下,几乎你的每个回复我都得改一遍 。 。。加油~

from spring-boot-demo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.