Questions tagged [spring-config]

Refers to the org.springframework.context.annotation package of the Spring Framework that moves bean definition and Spring configuration out of XML file and into Java classes via annotations.

Questions referring to @Configuration and @Bean will be the primary source of questions for this tag.

Useful Links

178 questions
2
votes
0 answers

Error creating bean with name 'xx', but the factory method is present

I have this Spring Boot 2 config file: @SpringBootApplication @EnableAutoConfiguration(exclude = { WebMvcAutoConfiguration.class, WebMvcConfigurationSupport.class }) @ComponentScan(basePackages = { "com.mycompany.user" }, excludeFilters = …
DeadSpock
  • 478
  • 3
  • 13
2
votes
1 answer

Spring Cloud - Finchley.M8 - Refresh Get Operation returns Page Not found

I am using Spring Cloud Config server [git repo] with basic authentication and config client Spring Boot: 2.0.0.RELEASE Spring Cloud: Finchley.M8 In spring could client when refresh method is posted (http://localhost:8080/refresh) got below error…
2
votes
2 answers

how to make spring boot client's application.yml get value from config server

Is there anyway to make spring cloud config client's application.yml read values from spring config server? For example, on my spring cloud config client, the application.yml is like this spring: application: name: clienttest mvc: view: …
Gary Zhang
  • 33
  • 3
  • 6
2
votes
1 answer

How to initialize SpringContext once and share across tasks?

I am trying to initialize spring context in my Spark application. I want the context in my slave nodes as well as I want to re-use the beans. Here is the code for the same:- shipperRD2.foreach(shipper->{ AmazonS3 amazonS3Client =…
Sanchay
  • 1,053
  • 1
  • 16
  • 33
2
votes
2 answers

construct a dynamic url using path variables in spring controller

i would like to generate a dynamic url like http://example.com/path/to/page?name=ferret&color=purple where i can send name and color two separate input fields from my form to controller as a single parameter. can someone please help me with the…
2
votes
2 answers

Spring Boot and Apache Shiro with JWT - Am I using it correctly?

I have Spring Boot application and I attempted to integrate Apache shiro with it. As a first iteration, I am authenticating and authorizing the JWT way, no session whatsoever. The way I have architected it, every REST request has to contain a JWT…
2
votes
0 answers

proxy error when creating a bean with an @Async method

I have edited this as I realised I had misdiagnosed the cause of the error. The error is caused because I have an async method in the abstract class which is being instantiated by the bean. I've added this method to the abstract class below. If I…
gringogordo
  • 1,990
  • 6
  • 24
  • 60
2
votes
0 answers

Spring Cloud Config keeps checking out master branch

I am running into an issue with Spring Cloud Config. I have a remote git repo with my config files, which is cloned down locally for local testing. My project has 4 bootstrap.yml files as shown below bootstrap.yml spring: application: name:…
Nick H
  • 8,897
  • 9
  • 41
  • 64
2
votes
3 answers

Autowired not working for ConfigurationProperties bean in Spring

I have an application.yml file that has the list of objects as below: outlook: mailboxes: - id: m1 name: mailbox1 - id: m2 name: mailbox2 I have created a spring configuration class called MailBoxProperties to have these…
Ashwini
  • 381
  • 6
  • 23
2
votes
2 answers

Setting variable value based on spring profile

How to assign value to variable based on region? Lets says system properties, dev-url="dev-abc.com", prod-url="prod-abc.com" and qa-url="qa-abc.com" @Value( #{systemProperties. ??? ) String url;
2
votes
3 answers

Spring setting @value from another variable

Is it possible to set @Value from another variable For eg. System properties : firstvariable=hello ,secondvariable=world @Value(#{systemProperties['firstvariable']) String var1; Now I would like to have var2 to be concatenated with var1 and…
1
vote
1 answer

Own configuration properties

Following chapter 5 of Spring in action fifth edition I have tried to establish my own confuguration variables with spring boot: @Component @ConfigurationProperties(prefix = "myprops") public class MyClass { private int myvar1; //…
stakowerflol
  • 979
  • 1
  • 11
  • 20
1
vote
2 answers

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. Reason: Fa

I am developing a web application by using the Spring Boot, Spring Cloud Config and Docker. There are 3 projects. One is springboot web, Spring Cloud Config Server and MySql Database. I have use the Spring Boot Web with Themeleaf. It's basically…
Numery
  • 402
  • 1
  • 6
  • 16
1
vote
2 answers

How do I fix "There are not any available ciphers" JSch exception when attempting to use Spring Config Server?

I am attempting to get an embedded Spring Config Server implementation working that reads configuration from GitHub. I'm following this tutorial: https://mromeh.com/2017/12/04/spring-boot-with-embedded-config-server-via-spring-cloud-config/ I am…
CryptoFool
  • 21,719
  • 5
  • 26
  • 44
1
vote
1 answer

What could be causing Spring/Hibernate setup to not find Id of entity?

I have a spring boot application. I am trying to create a jar that will include some entities/controllers that I can pull in via dependency management (Maven) from our artifactory repository. I'm confident this is a config/annotation thing, so only…
DaFoot
  • 1,475
  • 8
  • 29
  • 58