by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 11:16
    wilkinsona milestoned #22214
  • 11:15
    wilkinsona labeled #22214
  • 11:15
    wilkinsona unlabeled #22214
  • 11:13
    wilkinsona milestoned #22211
  • 11:13
    wilkinsona labeled #22213
  • 11:13
    wilkinsona unlabeled #22213
  • 11:13
    wilkinsona milestoned #22213
  • 11:12
    wilkinsona edited #22213
  • 11:12
    wilkinsona milestoned #22210
  • 11:12
    wilkinsona labeled #22210
  • 11:12
    wilkinsona unlabeled #22210
  • 11:11
    wilkinsona edited #22210
  • 11:11
    wilkinsona milestoned #22209
  • 11:10
    wilkinsona milestoned #22212
  • 11:10
    wilkinsona labeled #22212
  • 11:10
    wilkinsona unlabeled #22212
  • 11:10
    wilkinsona edited #22212
  • 11:07
    wilkinsona unlabeled #22211
  • 11:07
    wilkinsona labeled #22211
  • 11:07
    wilkinsona edited #22211
EugeneZakhno
@EugeneZakhno
image.png
Can you help me?
image.png
But nothing
James Howe
@OrangeDog
@EugeneZakhno this is an IntelliJ question, not a Spring Boot question. And the answer is because you haven't assigned a data source.
Stéphane Nicoll
@snicoll
:+1:
A C SREEDHAR REDDY
@a-c-sreedhar-reddy
Is there any oops functionality in spring boot controllers?
Stéphane Nicoll
@snicoll
Check spring boot actuator in the reference guide
James Howe
@OrangeDog
Is there a good way to supply different beans depending on the detected/configured db type (MySQL, PostgreSQL, etc.)?
i.e. of the autoconfigured DataSource
checking the class doesn't work e.g. if it's a Hikari one
Stéphane Nicoll
@snicoll
that’s the pooling implementation
James Howe
@OrangeDog
indeed
Stéphane Nicoll
@snicoll
you could have profile for each db and use that as a trigger
James Howe
@OrangeDog
oh, I could use DataSourceProperties.determineDriverClassName()?
this is the code that is determining a database name to then load the proper, database-specific sql script from the classpath.
Tyler Van Gorder
@tkvangorder
you should be able to use something similar to conditionally add a bean to the context .
VipinPokhriyal
@VipinPokhriyal
Hi All, can anyone suggest me how to create connection pool in couchbase,
I am using spring 5 and java8 for it.
Arthur Kazemi
@bidadh
Hi, I need to add an implicit validation to all incoming requests with specific request body or request parameter as part the request lifecycle and return 400 in it's not valid. validation definition comes as part of the request message model. we do have HttpMessageConverter<Model> which reads the message from http request so that we receive the Model in the controller method. I need to know if I can add another thing to the chain after HttpMessageConverter to handle the validation. Filter cannot be used since it is before HttpMessageConverter
Connected Softec
@connectedsoftec_twitter
ServerPropertiesAutoConfiguration missing in SpringBoot 2.2.1 ! What is the workaround/solution?
Brian Clozel
@bclozel
@connectedsoftec_twitter it's beenteh case since 2.0 and it shouldn't matter. If a library is referring to that type, maybe you need to upgrade that library too.
Arthur Kazemi
@bidadh

Hi, I need to add an implicit validation to all incoming requests with specific request body or request parameter as part the request lifecycle and return 400 in it's not valid. validation definition comes as part of the request message model. we do have HttpMessageConverter<Model> which reads the message from http request so that we receive the Model in the controller method. I need to know if I can add another thing to the chain after HttpMessageConverter to handle the validation. Filter cannot be used since it is before HttpMessageConverter

Any suggestions ? :pray:

aghag10
@aghag10
Hello! I'm seeing some issues with a class (class A) marked with Configurable annotation autowiring another class. Class A is being manually instantiated by Class X that's not Spring managed. Class A is autowiring class B. There is a delay in the instantiation order of Class A and class B. As a result, we end up hitting an NPE in class A, when it tries to invoke a method in class B. I tried debugging the issue to see in what order the 2 classes are being instantiated. I'm seeing two issues here - 1) post construct method in class A is never called 2) post construct method in class B is being called 2-3 minutes after I see a log message from an init function in class A. I've tried setting @Configurable(preconstruct = true, autowire=Autowire.BY_NAME), but no luck. Any comments/suggestions?
tahany fawzy
@tahanyFawzy1994
Hi Guys I want to get records from a many to many relationship using predicates
Vyacheslav N. Boyko
@bvn13
@aghag10 1) try to instantiate your class A by Spring itself. 2) don't use @Autowire on property private ClassB classB, turn it out to ClassA's constructor param.
Vyacheslav N. Boyko
@bvn13
@echooymxq according to https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-external-config seems Spring reads your properties and yaml in random order. So you could not predict which value will be the actual one.
Jorge
@jmanzaro

Hello! In order to do retries with a feign client, I've been following this documentation: spring-cloud-feign-overriding-defaults. It seemed to me extremely easy and I created the @Configuration class and modified the @FeignClient overriding its configuration this way:


@FeignClient(value = “service”, url = "\${service.url}", configuration = [ServiceConfig::class])
@Configuration
class ServiceConfig {
    @Bean
    fun retryFactory(): Retryer = Retryer.Default()
}

But it doesn’t work. Am I missing something? I will appreciate so much any help!

James Howe
@OrangeDog
I don't suppose there's a way to have a fallback static error page for when your normal error page fails?
I imagine it depends on the container, if it's supported at all
Stéphane Nicoll
@snicoll
@jmanzaro you’d have more luck asking this on #spring-cloud
@bvn13 I don’t see what makes you think SB loads the config in random order (it doesn’t, that url points to the order we use for loading the config)
Jorge
@jmanzaro
@snicoll Ok, thanks!
Niels Doucet
@NielsDoucet
Hi, in spring-boot-dependencies version 2.2.2 the following incompatible libraries are being managed: org.eclipse.jetty:jetty-util:9.4.24.v2191120 and org.glassfish.jersey.containers:jersey-container-jetty-http:2.29.1
The incompatibility was fixed in jersey version 2.30 (see eclipse-ee4j/jersey@1504174)
Is this the right channel to report the issue? According to the github issue template I shouldn't raise an issue in github to upgrade a library.
the error resulting from this combination of libraries is: java.lang.IllegalAccessError: org.glassfish.jersey.jetty.JettyHttpContainerFactory$JettyConnectorThreadPool.newThread(Ljava/lang/Runnable;)Ljava/lang/Thread;
Stéphane Nicoll
@snicoll
@NielsDoucet Thanks for the feedback. An incompatiblity is more a bug than a dependency upgrade request. If you can provide more details, we’d like an issue please
Niels Doucet
@NielsDoucet
will do, thanks :+1:
Daniil Gaidukov
@danzik
Hi! I have a few SpringBootTest's, but I'm not sure that it good approach create applicationcontext for each class annotated @SpringBootTest. Could anyone explain why we should create each time context/ use only one?
boda2004
@boda2004
to eliminate influence of previous tests
so you get clean environment for each test
James Howe
@OrangeDog
within a test class it reuses the environment unless @DirtiesContext
it's assumed that separate @SpringBootTest classes will want different configurations
Ingo Griebsch
@ingogriebsch
Hi all, I want to test a special flyway migration step. I implemented a flyway callback and integrated it into Flyway. So far so good. Know I want to implement some tests to check how the migration works a) if the database is empty, b) if the database is not yet migrated, c) if the database was already migrated. Therefore I started to implement a @JdbcTest using a posgres-testcontainer. The env is so far working, the only problem I have is to find a place where I can prepare the database for the different cases. Therefore I'm searching for a place I could hook into to execute some sql files/statements before Flyway is getting executed. All things I tried (spring.datasource.data, spring.flyway.initSqls etc) are not working (i.e. a triggered to late). Has someone a hint how to implement such a test? :)
aghag10
@aghag10

Hello! I'm seeing some issues with a class (class A) marked with Configurable annotation autowiring another class. Class A is being manually instantiated by Class X that's not Spring managed. Class A is autowiring class B. There is a delay in the instantiation order of Class A and class B. As a result, we end up hitting an NPE in class A, when it tries to invoke a method in class B. I tried debugging the issue to see in what order the 2 classes are being instantiated. I'm seeing two issues here - 1) post construct method in class A is never called 2) post construct method in class B is being called 2-3 minutes after I see a log message from an init function in class A. I've tried setting @Configurable(preconstruct = true, autowire=Autowire.BY_NAME), but no luck. Any comments/suggestions?

@aghag10 1) try to instantiate your class A by Spring itself. 2) don't use @Autowire on property private ClassB classB, turn it out to ClassA's constructor param.

@bvn13 1) I can't make class A spring managed since class X that's instantiating class A can not be made Spring managed. 2) I don't follow. If that's the case, class B won't be autowired anymore?

Vyacheslav N. Boyko
@bvn13

Hello! I'm seeing some issues with a class (class A) marked with Configurable annotation autowiring another class. Class A is being manually instantiated by Class X that's not Spring managed. Class A is autowiring class B. There is a delay in the instantiation order of Class A and class B. As a result, we end up hitting an NPE in class A, when it tries to invoke a method in class B. I tried debugging the issue to see in what order the 2 classes are being instantiated. I'm seeing two issues here - 1) post construct method in class A is never called 2) post construct method in class B is being called 2-3 minutes after I see a log message from an init function in class A. I've tried setting @Configurable(preconstruct = true, autowire=Autowire.BY_NAME), but no luck. Any comments/suggestions?

@aghag10 1) try to instantiate your class A by Spring itself. 2) don't use @Autowire on property private ClassB classB, turn it out to ClassA's constructor param.

@bvn13 1) I can't make class A spring managed since class X that's instantiating class A can not be made Spring managed. 2) I don't follow. If that's the case, class B won't be autowired anymore?

1) I got it. 2) This way - yes. But I've found an example of how to get spring bean from outside of spring-managed zone https://confluence.jaytaala.com/display/TKB/Super+simple+approach+to+accessing+Spring+beans+from+non-Spring+managed+classes+and+POJOs

Witold Kupś
@Azbesciak
@boda2004 the problem is that that nginx is not mine - I am using this API, only. And pay for it...
20min ago it worked ...
Ibanga Enoobong Ime
@IEnoobong
use https?