Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 01:44
    philwebb closed #24805
  • 01:44

    philwebb on master

    Switch default MVC path matchinÔÇŽ (compare)

  • 01:06
    philwebb unlabeled #26033
  • 01:06
    philwebb labeled #26033
  • 01:06
    philwebb closed #26033
  • 01:06
    philwebb commented #26033
  • 01:05
    spring-projects-issues labeled #26033
  • 01:03
    philwebb labeled #25999
  • 01:03
    philwebb unlabeled #25999
  • 01:03
    philwebb demilestoned #25999
  • 01:02
    philwebb closed #25999
  • 01:02
    philwebb commented #25999
  • 01:02
    Paradox98 opened #26033
  • Apr 12 23:25
    philwebb labeled #26023
  • Apr 12 23:14
    philwebb assigned #24891
  • Apr 12 21:10
    scottfrederick labeled #25529
  • Apr 12 21:06
    scottfrederick demilestoned #25797
  • Apr 12 21:06
    scottfrederick milestoned #25797
  • Apr 12 21:05
    scottfrederick closed #26032
  • Apr 12 21:05
    scottfrederick closed #25797
HARITHA
@harithab22

Hi ,I am getting below error
Description:

The ApplicationContext could not start as 'org.springframework.aot.StaticSpringFactories' that is generated by the Spring AOT plugin could not be found.

Action:

Review your local configuration and make sure that the Spring AOT plugin is configured properly.
If you're trying to run your application with 'mvn spring-boot:run', please use 'mvn package spring-boot:run' instead.
See https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/#spring-aot for more details.

4 replies
I have tried all solutions which are in above document ,please help on it if anyone faced or how to resolve this "aot" plugin issues
springroll12
@springroll12
Hello. I am looking at the recommendations for Dockerizing spring boot applications with layertools and I'm confused about the build step. All the Dockerfile examples start with the jar already built . This seems to defeat part the purpose of splitting up the jar in the first place, because it must make your builds slower. Is there a way to skip the "build jar" step and go straight to the exploded layers in a multi-stage Dockerfile? For example, we currently have a dockerfile that builds the jar, then copies the jar into another stage and runs it. In that scenario you can see how forcing a rebuild of the jar each time would break Docker layer caching.. and it would be nice not to have to add another stage to extract the jar after it is built.
john
@xccjohn_gitlab
I think so
pipeline script
@springroll12
springroll12
@springroll12
@xccjohn_gitlab I'm not sure I understand what you're suggesting?
Brian Clozel
@bclozel
@springroll12 you should not add the JAR to a container layer, but rather use a builder image to do that; see https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-container-images-docker
springroll12
@springroll12
@bclozel Not sure I follow? The multi-stage example in that link has : COPY ${JAR_FILE} application.jar which is what I'm taking issue with. I want to build that jar inside a builder stage (not layer) and output the expanded jar. But if I understand the documentation correctly the jar must be built first for it to be expanded, which means all build-time benefits (caching of previous layers) are nullified since the jar always has to be rebuilt.
18 replies
springroll12
@springroll12
Here's more what I mean: https://pastebin.com/hjx1QWTB
Joeren Haag
@hjoeren_gitlab

Hi, I was just experimenting with Spring MVC and especially with updating (simple) entities via controller endpoints:

public class Controller {
  @Autowired
  FooRepository fooRepository;

  @PostMapping(path = "foos/create")
  public RedirectView createFoo(@ModelAttribute Foo foo) {
    fooRepository.save(foo);
    return new RedirectView("/foos")
  }

  @PostMapping(path = "foos/{id}/update")
  public ModelAndView updateFoo(@PathVariable("id") Long id, @ModelAttribute Foo foo) {
    fooRepository.save(foo);
    return new RedirectView("/foos");
  }

  // ...
}

What I was wondering: In the updateFoo method, in this case there only the code of the snippet above and no implemented logic of merging entities/copying attributes (e. g. find -> edit -> save), but - somehow magic - when calling the endpoint, previous created entities get updated:

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" "http://localhost:8080/foos/create?name=bar"
   Hibernate: call next value for hibernate_sequence
   Hibernate: insert into foos (name, id) values (?, ?)
curl -X POST -H "Content-Type: application/x-www-form-urlencoded" "http://localhost:8080/foos/1/update?name=foo"
   Hibernate: select foo0_.id as id1_4_0_, foo0_.name as name2_4_0_ from foos foo0_ where foo0_.id=?
   Hibernate: update foos set name=? where id=?

Is this by design? Thank you!

2 replies
Francis
@francis-a

Hello everyone, I'm working through a Spring upgrade from 4.3 to 5.3.5. Our application made use of the path extension content negotiation strategy in a few places. I see this is deprecated but still included, I enabled it in WebMvcConfigurer::configureContentNegotiation. With favorPathExtension set to true it does look like path based negotiation is working again but it looks like the path extensions are included in any @PathVariable I have defined in a controller. This leads to a MethodArgumentTypeMismatch exception being thrown for controller methods that accept a non-string path variable.
e.g:

@RequestMapping(value = "/{id}", method = RequestMethod.GET, produces = CUSTOM_CONTENT)
public Content getContent(@PathVariable Long id)

This will result in
MethodArgumentTypeMismatch "Unable to parse id=1.content. For input string: "1.content""

I'm not sure if I'm missing a config setting here or of this is expected

2 replies
choubani amir
@amirensit
Hello.
I have question about htmlunit
Does it work only with server side rendering(like thymeleaf)
Or it is also possible to use it with javascript frameworks like angular and react ?
Sorry if the question is ouside of this channel scope
­čśü
choubani amir
@amirensit
I think yes according to this docs
Peter Davie
@pdavie
I am serving an Angular app from Spring Boot. I have an api_url variable in the environment.ts file which I would like to patch dynamically as it is served so that it is the hostname and port number of the running Spring Boot application.
6 replies
What is the easiest way to do this?
I have thought of using a Servlet Filter, but this will impact every request, I am wondering if there's a way to do it through RouterFunction where I can grab the file and patch it and then send it to the client. I am not familiar with RouterFunction so I am a little lost here...
Subba Reddy Venna
@subbareddy.venna789:matrix.org
[m]
Hi,
I am looking for the best and cleanest solution to handle the spring-boot JMS listener with throttling the consumption of messages like 1 message per 10 seconds.
Tried with Thread.sleep(10000) after message read but looking for any other better solution.
1 reply
NicklasWallgren
@NicklasWallgren
Does the org.springframework.boot:spring-boot-starter-amqp starter support Spring Native? I tried generating a new project using the initializer, and got the following error on boot.
Caused by: java.io.FileNotFoundException: class path resource [org/springframework/amqp/rabbit/annotation/MultiRabbitBootstrapConfiguration.class] cannot be opened because it does not exist
        at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:187) ~[na:na]
        at org.springframework.core.type.classreading.SimpleMetadataReader.getClassReader(SimpleMetadataReader.java:55) ~[na:na]
        at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:49) ~[na:na]
        at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:103) ~[na:na]
        at org.springframework.boot.type.classreading.ConcurrentReferenceCachingMetadataReaderFactory.createMetadataReader(ConcurrentReferenceCachingMetadataReaderFactory.java:86) ~[na:na]
        at org.springframework.boot.type.classreading.ConcurrentReferenceCachingMetadataReaderFactory.getMetadataReader(ConcurrentReferenceCachingMetadataReaderFactory.java:73) ~[na:na]
        at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:81) ~[na:na]
        at org.springframework.context.annotation.ConfigurationClassParser.asSourceClass(ConfigurationClassParser.java:696) ~[na:na]
        at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorGroupingHandler.lambda$processGroupImports$1(ConfigurationClassParser.java:813) ~[na:na]
4 replies
sss1515
@sss1515
hello
Neo
@Neo-sunny
Hi I have springboot with jersey. I have written test cases using Junit4 and mockito.when I run then individually. its fine but when I build none of the testcases are picked up
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
Any suggestion would be helpful.
6 replies
yohasakur
@yohasakur
Hello, I am using webflux and mono filePart for uploading files but the maximum concurrent upload requests is only 4 the number of reactor-http-epoll, is there a better way or am I doing something wrong, please help, thanks.
drmyr
@drmyr
For k8s Readiness/Liveness in Spring Boot, it looks like the Readiness or Liveness state is treated as a singleton global, so if one healthy part of the application published that it was healthy, doing so could overwrite an unhealthy state that was published by another part of the application. Is this correct? Is there a way to use the Readiness/Liveness state as more a voting mechanism, where each part of application can vote on its health? Or is there a recommended way to use if the Readiness/Liveness API if some parts of the application can be healthy, and other parts unhealthy, at the same time?
6 replies
kazi
@kazi:kazigk.me
[m]
hello everyone
zharvey-bh
@zharvey-bh
hi, I'm using Spring Boot 2.3.8 and Gradle 6.7. When I run ./gradlew clean build it produces a jar at ./app/build/lib/app.jar. How do I specify a custom name for my built jar, such as ./app/build/libs/my-service.jar?
2 replies
aasifkhan7
@aasifkhan7
i am running a gwt application inside a docker container and as i open up multiple instances of that application in chrome browser, the docker container's RAM usage seems to increase and doesn't seem to go down even after closing these tabs. i don't have much idea about it - but is there a way to optimize the RAM usage?
koyaja
@koyaja
Hi all, pls i deploy on production my spring boot app with ssl +jetty and i get this error (35) gnutls_handshake() failed: Handshake failed Thanks
1 reply
kazi
@kazi:kazigk.me
[m]
I guess that's the error from cURL and it means you either received invalid packet or your curl is outdated and doesn't support required TLS version
give us more information if you expect us to help you
Anders Clausen
@AndersClausen
Hey @scottfrederick, I finally managed to get the Datadog buildpack working - you were actually very close with your proposed solution here :point_up: March 18, 2021 3:50 PM and I'll post that shortly.
I have a follow up question if you don't mind. The Datadog buildpack has a hard-coded version of the java-agent in it and it would be much better if I could pass that version in as an argument to the buildpack, so I wouldn't have to rely on updates from DD instead. Do you know if there are any plans for the spring-boot-maven-plugin to accept arguments for buildpacks? Many thanks
4 replies
DevZyra
@DevZyra

image.png

JDK 15 , facing issues after installing environment, no clue what to do any directions?

2 replies
Braffolk
@Braffolk
Hello. I'm wondering whether it is possible to customise the HttpServer that is used by a @MessageMapping endpoint in case thats used with a websocket&RSocket. The reason for this is to handle WebSocket message fragments, connect them back together into single messages. Fragments are in the websocket specification, but for some reason they arent supported by default in this case.
1 reply
Wiliam Li
@nghiatle
hello
Jan Nielsen
@JanStureNielsen
Is there a way to shut-down the keep-alive task-scheduler for a Spring WebSocket STOMP client so the JVM exits when the main thread finishes?
Knut Schle├čelmann
@kschlesselmann
Looks like query params are now (SB 2.4) included in the URI of WebClient metrics. Is there a nice builder variant of consturcting requests with a lot of params that treat every parameter as a template variable?
Laurence Mommers
@LaurenceMommers

Hi all,
I have a question about the ordering of bean definitions and auto configuration.

The camel JMS component is using this line to find a connectionFactory.
ConnectionFactory cf = applicationContext.getBeansOfType(ConnectionFactory.class).values().iterator().next();

But now i have to create a second connection to a different activeMQ and this bean definition is added before my jmsConnectionFactory. From what i can see this only happens because the configuration is loaded in order of the name.
But i am wondering if there is something like the AutoConfigurationSorter which might help me here? basically i am trying to sort bean definitions instead of beans.

I know i can create a new jmsComponent endpoint and give it the connectionFactory but i'd like for the automatically created 'activemq:' (extending the jmsComponent) endpoint to remain the same.

Anders Clausen
@AndersClausen

Good morning all. I posted a question in the spring-data channel but was told that it's more of a Spring Boot question, so here goes.
I need some help with the health check of Elasticsearch. I'm using Spring Boot 2.5.0-M3 and spring-data-elasticsearch 4.2.0-M5 and I'm using the ReactiveElasticsearchClient.
When checking /actuator/health locally it works fine, however after I've deployed to Kubernetes the heath check keeps reporting

elasticsearch: {
   status: "DOWN",
   details: {
   statusCode: 401,
   reasonPhrase: "Unauthorized"
}

I have set the following properties but without any luck.

spring:
  data:
    elasticsearch:
      client:
        reactive:
          use-ssl: true
          endpoints: ${ELASTICSEARCH_HOST}
          socket-timeout: 10s
          username: ${ELASTICSEARCH_USER}
          password: ${ELASTICSEARCH_PWD}

I can use those credentials and successfully call the /_cluster/health endpoint through Postman, so why does it give me a 401 when Spring Boot tries to call?
The documentation https://docs.spring.io/spring-boot/docs/2.5.0-M3/reference/html/production-ready-features.html#auto-configured-reactivehealthindicators says that the ElasticsearchReactiveHealthIndicator is auto-configured, so I'm not sure what else to do.
FWIW, my ReactiveElasticsearchClient is only set up with SSL, as that's all that's required when querying ES but I'd expect the ElasticsearchReactiveHealthIndicator to use the properties set above.
Am I missing something? Thank you

2 replies
NicklasWallgren
@NicklasWallgren
How do I access the application startup metrics in spring boot 2.4? I have added management.endpoints.web.exposure.include=startup but the endpoint actuator/startup returns 405. I can access the other actuator-endpoints fine.
4 replies
Marco Zangh├Č
@marcozanghi
hi I have a problem with spring cloud gateway and resilience4j circuit breaker ... I am not able to specify into application.tml for a specific route the relative filter that implement the Circuit-breaker Logic for fallbackuri specification ... I am using 2020.0.2 spring cloud .... any ideas?
2 replies
miha-
@miha-
Hello, how to compile in jar package via "mvn package" so that data will not be installed again from pom.xml? In pom.xml I have links for wsdsl. Issue is that this wsdls are not ok classes which are genereted from them are edited. Everytime i run "mvn pacakage" wsdl files are downloaded and classes are newley generated, which i do not want to. tnx
Asky-GH
@Asky-GH
Hello, where can I find the release date of 2.5.0? Is it known?
3 replies
HaloFour
@HaloFour
Speaking of, I noticed that support for Gradle 7 was included in the milestones for Spring Boot 2.5.0 RC-1. We're testing upgrading to Gradle 7 now and haven't noticed any issues with the Spring Boot gradle plugins or the like, is there anything we should be concerned about or is that change largely about documentation and enforcing minimum versions?
1 reply
nightswimmings
@nightswimmings
What is the rationale for spring-boot-dependencies not setting <scope>test</scope> by default on test dependencies like junit, mockito etc..?