Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 23:15
    scottfrederick closed #26445
  • 23:15

    scottfrederick on main

    Handle long file names in build… (compare)

  • 23:00
    scottfrederick edited #26445
  • 22:59
    scottfrederick labeled #26445
  • 22:54
    scottfrederick milestoned #26445
  • 22:54
    scottfrederick assigned #26445
  • 22:54
    scottfrederick opened #26445
  • 21:16
    wilkinsona commented #26443
  • 21:15
    wilkinsona commented #26443
  • 21:15
    wilkinsona commented #26443
  • 21:00
    wilkinsona unlabeled #26444
  • 21:00
    wilkinsona labeled #26444
  • 21:00
    wilkinsona labeled #26444
  • 21:00
    wilkinsona labeled #26444
  • 21:00
    wilkinsona closed #26444
  • 21:00
    wilkinsona commented #26444
  • 20:52
    scottfrederick demilestoned #25840
  • 20:52
    scottfrederick milestoned #25840
  • 20:52
    scottfrederick milestoned #25839
  • 20:52
    scottfrederick demilestoned #25839
Nick Caballero
@nickcaballero
tippl
@tippl
@nickcaballero Thanks, the room is not listed on the gitter page linked at spring.io/community
abdullah_ali
@abdullah_ali:matrix.org
[m]
Hello All. I want to know when to use @JsonProperty?
Nick Caballero
@nickcaballero
@abdullah_ali:matrix.org , you mean the Jackson annotation?
4 replies
Nicolas Bonilla
@Nicobonilla
Hi there. I just finished a full-stack java bootcamp, quiet intensive, I learnt to do a spring web project (mvc), with maven and hibernate. I made a database using SQL Oracle, I know litle of css, html, js, jquery, spring security and API Rest. I just finished the course the last weak and I want to keep coding so, if I can be usefull for somebody, I am here. Also I know some about data, I worked with dataframes in python few years ago, doing an udemy course, becouse I like data science, I am commercial enginieer and know some about modeling and analysing data.
x+
Mehmet
@mehmetcc
did somebody use jooq+hibernate+spring data?
is there any complications you encountered
Alexandre Rocha
@alexandrececchin
Hello Folks,
I'm trying to consume application information from my register service (Eureka) using the Feign-client from an app with spring 2.2.4. But When I try to find an application that is registered in the eureka but that uses the spring 1.5 I'm getting the error
Load balancer does not contain an instance for the service
Does anyone here have seem this before ?
3 replies
HaloFour
@HaloFour
huh, noticed that when using Spring Start and you select Java 16 and Gradle that it uses Gradle 6.x which isn't compatible with JDK 16.
3 replies
Kranthi
@Krannthi
IS spring boot 2.x compatible with websphere 8.5.5.x
Nick Caballero
@nickcaballero
i think you would have to package the application as a war no?
Kranthi
@Krannthi
yeah as a war
abdullah_ali
@abdullah_ali:matrix.org
[m]
I am unable to write @ApiModelProperty annotation although I have imported io.swagger
Anders Clausen
@AndersClausen

Good morning all. I'm still having an issue using a buildpack and I'm getting the following error

[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.5.0-RC1:build-image (default-cli) on project billoflading-summary: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.5.0-RC1:build-image failed: Error pulling buildpack image 'mskregistry.azurecr.io/datadog-trace-paketo-buildpack:1.0.0': Docker API call to 'localhost/v1.24/images/create?fromImage=mskbolregistry.azurecr.io%2Fdatadog-trace-paketo-buildpack%3A1.0.0' failed with status code 500 "Internal Server Error" and message "Head ***/v2/datadog-trace-paketo-buildpack/manifests/1.0.0: unauthorized: authentication required

I'm using java 11, spring boot 2.5.0-RC1 and this is my configuration:

                <configuration>
                    <image>
                        <verboseLogging>true</verboseLogging>
                        <buildpacks>
                            <buildpack>urn:cnb:builder:paketo-buildpacks/java</buildpack>
                            <buildpack>docker://mskregistry.azurecr.io/datadog-trace-paketo-buildpack:${datadog-buildpack-version}</buildpack>
                        </buildpacks>
                        <bindings>
                            <binding>${basedir}/binding:/platform/bindings/DatadogTrace</binding>
                        </bindings>
                    </image>
                </configuration>

Is this a permission issue with the buildpack I'm using? I've downloaded it from the Datadog GitHub packages and put it into our own Azure Container Registry but it looks to be complaining about access to some inner buildpack file that I don't know about

Head ***/v2/datadog-trace-paketo-buildpack/manifests/1.0.0: unauthorized: authentication required

Am I doing something wrong in the configuration or is this a buildpack error that I should report to Datadog? I appreciate your help. Cheers

17 replies
Lukáš Vasek
@bilak
Hello, please how do I enable POST on /actuator/env endpoint?
1 reply
veeru
@veerumallavarapu
HI All , I am using Spring boot webflux, wrote a controller to upload a file , however it is getting rejected with 415 error , Unsupported Media Type
@PostMapping(value = "/provider/enrolment/bulkcopyenrolment", produces = "application/json", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
@ApiOperation(value = "This operation returns job details based on search criteria")
public ResponseEntity uploadFile(@RequestBody BulkCopyEnrolmentRequestDTO bulkrequestDTO, @RequestParam(required = true) String tenantURI) {
log.info(
String.format("File name '%s' uploaded successfully.", bulkrequestDTO.getFile().getOriginalFilename()));
return ResponseEntity.ok().build();
}
is there any specific configuration required

public class BulkCopyEnrolmentRequestDTO {

private MultipartFile file;
private String contextId;
private String requestName;

}

veeru
@veerumallavarapu
"status":415,"error":"Unsupported Media Type","message":""
Rahul Narula
@ranarula

I need to set an environment variable which is equivalent to the property a.b.UNDER_SCORE.c in properties/yml file

I have tried various options like
a_b_UNDER_SCORE_c = 10
a.b.UNDER_SCORE.c = 10
a_b_UNDER__SCORE_c = 10

but none seems to be working as expected to override the property defined in application.properties file.
Any idea on how I should I go about setting the env variable.

6 replies
HaloFour
@HaloFour
This is kind of a generic Reactor/Reactive-Streams question but I'm curious if anyone has found a tool that can detect during build if a Publisher would go unsubscribed? I've found this to be a common bug in our WebFlux projects, especially onboarding new folks onto the team, especially for methods that return Mono<Void> and the developer assumes that they can ignore the return value.
Florian RUEN
@EYESR_gitlab
Hello there, I'm looking to use repository that return Page<EntityDto> instead of Page <Entity>, do you know if there is a way to do this ?
Philipp Kraus
@flashpixx
Hello I try to build a Spring-Boot application which contains some Spark components, I'm using the Spring-Boot Maven plugin, so my Spring application works fine, but the Spark calls are failing because some classes are not found. Spark has got a environment flag spark.jars so I can pass a jar file with all necessary dependencies https://spark.apache.org/docs/latest/configuration.html but for this my Jar file need a fat jar, so all classes are extracted into a single jar file. On normal commandline tools I'm using Maven shade plugin to build an executable Jar file, this creates a Jar file which contains all classes of all dependencies, but on the Spring-Boot build I get Jar files in the application Jar, so this does not work with Spark together. So my question is, is there the possibility to extract all dependencies and repack it into a single Jar file and how can I do this?
2 replies
Maziz
@MazizEsa
Hi all. Notice spring boot 2.4.x no longer has Release. Is this the latest production ready version? Or I need to use 2.3.* Release?
4 replies
revised
@carlmolemans
This message was deleted
2 replies

I recently, I'm receiving the warning "Property 'spring.profiles' imported from location 'file [application.yml]' is invalid and should be replaced with 'spring.config.activate.on-profile' [origin: URL [file:application.yml] - 2:13]"

I have several profiles where I run my application with. These profiles make use of, or "group", other profiles.
to make this work, I group these profiles like this, which works perfectly and causes me zero headaches:

spring:
profiles:
group:
local: hoverfly
nightly: remote-acc
ci: mariadb,hoverfly
dev: mariadb,remote-qa
qa: mariadb,remote-qa
acc: mariadb,remote-acc
prd: mariadb,remote-prd

I have had a look at this "activate.on-profile" property but this implies that I would have to move all these configurations into a single configuration file?
This would make things less readable and manageble inside my project.

How do I ensure that I'm compliant with your standards while not being forced to write everything in one big messy configuration file?

Also from the spring blog I would assume I'm correctly applying the configuration: https://spring.io/blog/2020/08/14/config-file-processing-in-spring-boot-2-4
"Profile groups are a new feature in Spring Boot 2.4 that allow you to expand a single profile into multiple sub-profiles."
"spring.profiles.group.prod=proddb,prodmq,prodmetrics"

11 replies
Nick Caballero
@nickcaballero
@carlmolemans you don't have to use one single configuration file, keeping other profile specific files, like application-mariadb.yml will still work
you also don't have to use profiles to organize your properties. if all you want is to keep your property files DRY, you can use the new spring.config.import as well to include other files
i think there are still a lot of valid use cases for spring.config.activate.on-profile, specially if having a separate file just for one property feels like overkill
one thing that hasn't been very clear to me from spring documentation is how profiles should be used. with the new config.import support, i think it addresses one of the use cases that some used profiles for: property reuse
abdullah_ali
@abdullah_ali:matrix.org
[m]
@chris-peng-1244: If you may help here
Gavin Fitzgerald
@Zeouterlimits
Hey, can anyone help with a Spring-Boot Websocket / Spring Messaging problem? We want to override the HeartbeatTask in SimpleBrokerMessageHandler to add logging and metrics (debugging a disconnect issue on iOS). Is it possible?
It seems to be a mess of beans and channels so I am struggling a bit.
James Howe
@OrangeDog
I can't find the SpEL documentation that lists all the syntax. Looking for whether you can reference fields of the annotated method's class.
Lukáš Vasek
@bilak

Hello, if I'm using resources plugin + spring boot maven plugin then in final jar file I'm missing application.yml. Is there some workaround how to fix this?
This is how my build look like.

  <build>
    <resources>
      <resource>
        <directory>target/dist</directory>
        <targetPath>META-INF/spring-boot-admin-server-ui/extensions/df</targetPath>
        <filtering>false</filtering>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <groupId>com.github.eirslett</groupId>
        <artifactId>frontend-maven-plugin</artifactId>
        <version>${frontend-maven-plugin.version}</version>
        <configuration>
          <installDirectory>./target</installDirectory>
        </configuration>
        <executions>
          <execution>
            <id>install-node-and-npm</id>
            <goals>
              <goal>install-node-and-npm</goal>
            </goals>
            <configuration>
              <nodeDownloadRoot>${frontend-maven-plugin-node-download.url}</nodeDownloadRoot>
              <nodeVersion>${frontend-maven-plugin-node.version}</nodeVersion>
              <npmDownloadRoot>${frontend-maven-plugin-npm-download.url}</npmDownloadRoot>
              <npmVersion>${frontend-maven-plugin-npm.version}</npmVersion>
            </configuration>
          </execution>
          <execution>
            <id>npm-install</id>
            <goals>
              <goal>npm</goal>
            </goals>

          </execution>
          <execution>
            <id>npm-build</id>
            <goals>
              <goal>npm</goal>
            </goals>
            <configuration>
              <arguments>run build</arguments>
              <environmentVariables>
                <PROJECT_VERSION>${project.version}</PROJECT_VERSION>
              </environmentVariables>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>com.google.cloud.tools</groupId>
        <artifactId>jib-maven-plugin</artifactId>
        <version>${jib-maven-plugin.version}</version>
        <configuration>
          <container>
            <jvmFlags>
              <jvmFlag>-agentlib:jdwp=transport=dt_socket,server=y,address=5005,suspend=n,quiet=y</jvmFlag>
              <jvmFlag>-Djava.security.egd=file:/dev/./urandom</jvmFlag>
            </jvmFlags>
          </container>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </build>

when I remove this part

    <resources>
      <resource>
        <directory>target/dist</directory>
        <targetPath>META-INF/spring-boot-admin-server-ui/extensions/df</targetPath>
        <filtering>false</filtering>
      </resource>
    </resources>

then application.yaml is in place but I'm missing resources that I need to be on classpath.

1 reply
nitineman
@nitineman
Although this might be completely related to Spring Security kindly help me with the concern raised as part of the stackoverflow question. https://stackoverflow.com/questions/67469283/spring-security-oauth2-webclient-setup-for-oauth2-client-calls-fails-with-empty
Binay Agrawal
@bnayagrawal
Can someone please tell me the difference between spring-data-releasetrain and spring-data-bom. Both are bom files but which one to use?
nitineman
@nitineman
Although this might be completely related to Spring Security kindly help me with the concern raised as part of the stackoverflow question. https://stackoverflow.com/questions/67469283/spring-security-oauth2-webclient-setup-for-oauth2-client-calls-fails-with-empty
Gautam Garg
@gautam.garg:matrix.org
[m]
It regarding spring webflux - I'm trying to use WebClient in synchronous way Ref - https://docs.spring.io/spring-framework/docs/current/reference/html/web-reactive.html#webflux-client-synchronous
But getting this error while using block() method

2021-05-11 20:01:28.677 INFO 55613 --- [ main] com.example.demo.DemoApplication : Started DemoApplication in 1.305 seconds (JVM running for 1.669)
2021-05-11 20:02:15.521 ERROR 55613 --- [ctor-http-nio-2] a.w.r.e.AbstractErrorWebExceptionHandler : [19114471-1] 500 Server Error for HTTP GET "/test"
java.lang.IllegalStateException: block()/blockFirst()/blockLast() are blocking, which is not supported in thread reactor-http-nio-2
at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:83) ~[reactor-core-3.4.3.jar:3.4.3]
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Error has been observed at the following site(s):
|_ checkpoint ⇢ HTTP GET "/test" [ExceptionHandlingWebHandler]
Stack trace:
at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:83) ~[reactor-core-3.4.3.jar:3.4.3]
at reactor.core.publisher.Mono.block(Mono.java:1703) ~[reactor-core-3.4.3.jar:3.4.3]
at com.example.demo.DemoApplication.getData(DemoApplication.java:28) ~[main/:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at org.springframework.web.reactive.result.method.InvocableHandlerMethod.lambda$invoke$0(InvocableHandlerMethod.java:146) ~[spring-webflux-5.3.4.jar:5.3.4]
at reactor.core.publisher.FluxFlatMap.trySubscribeScalarMap(FluxFlatMap.java:151) ~[reactor-core-3.4.3.jar:3.4.3]
4 replies
Used spring-boot version 2.4.5, any idea why I'm getting this error
Carlos Gómez
@Kurolox

Hello! I have a question regarding custom repositories. I'm trying to extend a JPA repository with my own methods. However, spring complains saying that "there's no property ... found for type ...!"

I've double checked that everything is named correctly according to the spring 2 docs (the custom interface is called name-of-original-interface-ending-with-Custom, and the implementation of that interface has the same name with the suffix Impl), and I'm not sure what am I doing wrong.

Since I can't share the whole code, I've created a gist with a minimum non-working example of my issue: https://gist.github.com/Kurolox/681fbd563877577fb9b1db0cc260a9eb

I'm using springboot 2.4.5, and the full stack trace can be found inside the gist.

Mark Pruden
@kiwisincebirth

@Kurolox - Some suggestions based on comparing you code to a working project I have:

  1. TestRepositoryCustomImpl - does not need the @Component annotation.
  2. In TestRepositoryCustomImpl - I would caution @Autowire of TestRepository, you are effectively creating a dependancy on itself.
  3. TestRepositoryCustomImpl - should be named TestRepositoryImpl

In summary - TestRepositoryCustomImpl is not a seperate component in itself, it is not a managed bean. An instance of it is bound into a proxy class (that is created at the startup of the application), that implements the main Repository Interface.

Hope this helps.

Carlos Gómez
@Kurolox

Hey @kiwisincebirth, thanks for the input.

About using autowire, is there any alternative if I want to use methods defined in the repository inside the custom repository? I can add @Lazy if the issue is the dependency having risk of becoming a circular dependency, but I'm not sure if there's any other downside to it.

I'll try with the other changes and get back to you. I thought the 'TestRepositoryImpl' naming was the old convention used in spring 1.X, but maybe I did my research wrong.

1 reply
Removing the @Component annotation and renaming the class to TestRepositoryImpl didn't solve the issue, unfortunately.
Eric Deandrea
@edeandrea

Anyone here know if Spring (or any of the Spring ecosystem projects) has an equivalent of the Vert.x EventBus? Specifically the ability for one part of your app to publish a message, another part to consume, and then emit a response back.

I know there is the ApplicationEventPublisher/ApplicationEventMulticaster, but those mechanisms are "fire-and-forget" - no way for the listener/consumer to emit a response back to the publisher, like the EventBus.request method (https://vertx.io/docs/apidocs/io/vertx/core/eventbus/EventBus.html#request-java.lang.String-java.lang.Object-).

4 replies
Julian Jarecki
@IARI
with the gradle plugin gradle-git-properties I can generate a git.properties file, and I can configure to expose the content via the /actuator/info endpoint.
The plugin can also generate custom properties that do end up in the git.properties - however, they are not exposed on /actuator/info - is there an easy way to expose custom properties on the info endpoint?
2 replies
Navid Ghahremani
@ghahramani
Hi, can someone help me understand how is it possible to add multi-gauge to Prometheus metrics via actuator? I know to add one by one with implementating of MeterRegistryCustomizer<PrometheusMeterRegistry> and add @Bean on top of that but couldn't find anyway to add multi-gauge at once
1 reply