Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 02:43
    CangYa2021 commented #28541
  • 02:34
    CangYa2021 commented #28541
  • Nov 26 21:27
    sunitk commented #10743
  • Nov 26 21:27
    sunitk commented #10743
  • Nov 26 18:02
    wilkinsona commented #28419
  • Nov 26 17:51
    wilkinsona edited #28825
  • Nov 26 17:41
    wilkinsona milestoned #28828
  • Nov 26 17:41
    wilkinsona labeled #28828
  • Nov 26 17:41
    wilkinsona assigned #28828
  • Nov 26 17:41
    wilkinsona opened #28828
  • Nov 26 17:36
    wilkinsona labeled #28827
  • Nov 26 17:36
    wilkinsona milestoned #28827
  • Nov 26 17:36
    wilkinsona assigned #28827
  • Nov 26 17:36
    wilkinsona opened #28827
  • Nov 26 17:33
    wilkinsona labeled #28826
  • Nov 26 17:33
    wilkinsona milestoned #28826
  • Nov 26 17:33
    wilkinsona assigned #28826
  • Nov 26 17:33
    wilkinsona opened #28826
  • Nov 26 17:32
    wilkinsona milestoned #28825
  • Nov 26 17:32
    wilkinsona assigned #28825
nightswimmings
@nightswimmings
Looks like it has no effect. At least on test (spring.factories on main)
bjonnh
@bjonnh
Is there a way to catch error at the moment of bean creation and change application behavior? (I want the application to have less functions if that resource isn't available)
(it as a JavaFX/Spring application, if it cannot connect to a specific database, a specific tab shouldn't appear)
nightswimmings
@nightswimmings
debug: true shows it as an unconditional autoconfigration, but ConfigureBefore does not work
Brian Clozel
@bclozel
@jebeaudet mvnrepository is a 3rd party website indexing maven repositories. maven.org is the source of truth. Issues have been recently reported on https://issues.sonatype.org/ about 404s/CDN sync issues but it seems that artifacts are there. Do you have an exact error message?
nightswimmings
@nightswimmings
@scottfrederick Got it with
    @Bean
    public BeanFactoryPostProcessor dependsOnPostProcessor() {
        return (beanFactory) -> beanFactory.getBeanDefinition("AutConfiguredBean").setDependsOn("locallyConfiguredBean");
    }
Andy Wilkinson
@wilkinsona
@konstantinblaesi Typo? The metric is named jvm.threads.states not vm.threads.states.
Sivamaniyan
@Sivamani180915
Hi,
I installed tomcat 9.0.26 in RHEL5.
The catalina pid is not creating
Any suggestions
boda2004
@boda2004
101 is not error (if you mean http code)
boda2004
@boda2004
i assume that you're talking about http code, and thi is a part of typical websocket connection process
like
HTTP/1.1 101 Switching Protocols
Upgrade: websocket 
Connection: Upgrade
Magnus Persson
@magnusp
I'm in a situation where I need to validate a hmac based on http headers and the body. From what I understand a WebFilter should not read the body unless it intends to end the chain. Is there any way around this?
Magnus Persson
@magnusp
And as I wrote that google gave me a hit on using ServerWebExchangeDecorator + ServerHttpRequestDecorator. I think overriding getBody and using Flux#cache should be sufficient
Magnus Persson
@magnusp
.. or not. Bah!
Michael McFadyen
@michaelmcfadyen
Yeah, I've implemented a hmac validation filter in webflux. Have you taken a look at HandlerFilterFunction?
Magnus Persson
@magnusp
@michaelmcfadyen i'm down the path of using the @RestController annotation. I've gotten as far as using a request decorator to hook into the getBody flux and calculating the hmac once it's read. Problem now is that I can't find a good way to emit an error. I emit an ServerWebInputException but this is logged as an error by the invocation handler around my controller - i'm having the body injected as a parameter and it is at this point it is read.
wouldn't happen to have that filter out in the wild so that I can take a look at it? :)
Michael McFadyen
@michaelmcfadyen
sorry, not in a position to share the code. What I can say is that with a HandlerFilterFunction you get access to ServerRequest which has methods for extracting the body. HandlerFilterFunction need to be applied in the router though so I don't believe they are compatible with using annotation based webflux endpoints
Magnus Persson
@magnusp
No worries. I worked around it by not having the body extracted as part of creating the parameters for the controller method. Another approach could be to have the requestbody @Valid and create a validator for it. But problem solved any way :)
X.Sun
@XSun771
should it not happen that use applicationContext in a Bean to use its method "getBean()"?Why it is so complex, for example, to implement the ApplicationContextAware. why is it still not achieved that use @Autowired ApplicationContext context to get a context? Thanks...
Stéphane Nicoll
@snicoll
you can do that
Altough getting a bean programmatically is not really a mainstream use case IMO
(or getting a reference to the ApplicationContext for that matter)
Subodh Sharma
@subodh_atg_twitter

I am getting the below response when run application on Netty server. But i do not want to include the xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" if value is null/blank.
<employeeResponse>
<employee>
<empId>1000</empId>
<firstName xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<lastName xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<salary xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<status xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
</employee>
</employeeResponse>

When I run the same application on Netty Server, getting the proper response. Can anyone help me to get the below response on the netty server?
<employeeResponse>
<employee>
<empId>1000</empId>
<firstName />
<lastName />
<salary />
<status />
</employee>
</employeeResponse>

I am using Spring boot
In my project Netty server is used and can not move to Tomcat server
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?

That was a no then I guess

Yogesh Patel
@YogeshPat3l_gitlab
Can anyone please help me how to serve static pages from outside the jar in spring boot ?
Vyacheslav N. Boyko
@bvn13
@YogeshPat3l_gitlab http://<server>:<port>/<static-resource>
Yogesh Patel
@YogeshPat3l_gitlab

@bvn13 This works if the static content is within the jar itself in any of the following paths

"classpath:/META-INF/resources/",
"classpath:/resources/", "classpath:/static/", "classpath:/public/"

@bvn13 What I want is to put all the static pages outside the jar
Vyacheslav N. Boyko
@bvn13
@YogeshPat3l_gitlab https://spring.io/blog/2013/12/19/serving-static-web-content-with-spring-boot :
Spring Boot will automatically add static web resources located within any of the following directories:

    /META-INF/resources/
    /resources/
    /static/
    /public/
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
    registry
      .addResourceHandler("/files/**")
      .addResourceLocations("file:/opt/files/");
 }
hope it helps you
Jacques-Etienne Beaudet
@jebeaudet
@bclozel looks like it's an issue with our internal maven repo, never seen that one before so didn't think to look there. By switching to maven central it downloaded the release properly. thanks and sorry for the noise!
Stéphane Nicoll
@snicoll
This message was deleted
Jacques-Etienne Beaudet
@jebeaudet
Regarding the previous message, our internal repository was configured with maven central in http and this is not supported anymore as of January 15th, 2020 https://support.sonatype.com/hc/en-us/articles/360041287334. All I had to do is point to the proper upstream maven repository and it worked. I'm guessing mvnrepository might have the same problem!
Scott Frederick
@scottfrederick
@jebeaudet Glad you got it resolved. Note that if your internal repo is also mirroring repo.spring.io (e.g. for Spring milestones or snapshots), you’ll need to make a similar change. https://spring.io/blog/2019/09/16/goodbye-http-repo-spring-use-https
JavaBaseReviewCN
@xuanjinnan
guys,I want create log of my normal spring boot with strategy of saveing a month log,example day,I want it is from 2019-12-22 to 2020-01-21 and tomorrow 2019-12-23 to 2020-01-22,better can study at a offical URL,I don't find it!
Himanshu Shukla
@himanshushukla254
Hi, I want to run multiple short-lived java applications in isolation.
is there any particular framework / approach I should follow ?
Vyacheslav N. Boyko
@bvn13
@xuanjinnan you could search in google by "slf4j log4j rotation" https://examples.javacodegeeks.com/enterprise-java/log4j/log4j-rotation-example/ is an example
@himanshushukla254 what kind of isolation do you prefer? maybe Docker?
Himanshu Shukla
@himanshushukla254
@bvn13 - no, they are very small applications. Dockerizing them requires a lot of time and effort
they are like health monitors which were running based on cron. Now, we are migrating them to QuartzScheduler but i can see a lot of logging issue.
Since each file is configuring their own log4j and DomConfigurator/ PropertyConfigurator changing the whole log tree structur.
at first level, logger isolation is also enough
Vyacheslav N. Boyko
@bvn13
@himanshushukla254 Do you place your applications into one jar? If not you could adjust logging into separated folders.