These are chat archives for spring-cloud/spring-cloud

30th
Jun 2018
Barath Arivazhagan
@BarathArivazhagan
Jun 30 2018 07:25
Hi I have a question, earlier eureka server artifact was spring-cloud-starter-eureka but after 2.0 it is spring-cloud-starter-eureka-server. But the docs are misleading as it pointing to older artifact name and its showing error while doing mvn command http://projects.spring.io/spring-cloud/
Am I missing something ?
Marcos Barbero
@marcosbarbero
Jun 30 2018 07:58
Hello @BarathArivazhagan, seems like this page is wrong the new name is spring-cloud-starter-netflix-eureka-server, you can follow this documentation instead https://cloud.spring.io/spring-cloud-netflix/single/spring-cloud-netflix.html
@KaijuDeluxe you can use RestTemplate
Barath Arivazhagan
@BarathArivazhagan
Jun 30 2018 08:01
ya got it resolved. Thanks @marcosbarbero . It will be good if we also fix the other page to avoid noise around that issue from the users in the future.
KaijuDeluxe
@KaijuDeluxe
Jun 30 2018 08:01
@marcosbarbero thank you
Marcos Barbero
@marcosbarbero
Jun 30 2018 08:02
Follow this blog post @KaijuDeluxe
KaijuDeluxe
@KaijuDeluxe
Jun 30 2018 08:02
@marcosbarbero Thx !! Do you have any idea why i am getting following error ? java.lang.IllegalStateException: Error processing condition on org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration$EurekaHealthIndicatorConfiguration.eurekaHealthIndicator
Marcos Barbero
@marcosbarbero
Jun 30 2018 08:03
I totally agree @BarathArivazhagan
Do you have some code to share?
KaijuDeluxe
@KaijuDeluxe
Jun 30 2018 08:04
what for example? its only a eureka name server i dont changed anything since yesterday it wont work
image.png
Marcos Barbero
@marcosbarbero
Jun 30 2018 08:05
which spring cloud version?
KaijuDeluxe
@KaijuDeluxe
Jun 30 2018 08:05
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.2.RELEASE</version>
</parent>
Marcos Barbero
@marcosbarbero
Jun 30 2018 08:06
sure, that's the boot version. What for the cloud? Finchley?
KaijuDeluxe
@KaijuDeluxe
Jun 30 2018 08:07
ah yes
image.png
but where can i find the version
sould i give you whole pom?
Marcos Barbero
@marcosbarbero
Jun 30 2018 08:08
You can change it to Finchley.RELEASE
It's not necessary
instead of Finchley.BUILD-SNAPSHOT go for Finchley.RELEASE
KaijuDeluxe
@KaijuDeluxe
Jun 30 2018 08:09
YEEEAAAHHHH Thank you. i spent 4 hours :(:(:(:(
Marcos Barbero
@marcosbarbero
Jun 30 2018 08:09
did it work?
KaijuDeluxe
@KaijuDeluxe
Jun 30 2018 08:09
yes for starting nameserver
Marcos Barbero
@marcosbarbero
Jun 30 2018 08:10
nice :)
KaijuDeluxe
@KaijuDeluxe
Jun 30 2018 08:10
now i will check the other one, have a sec please
SubhamAshish
@SubhamAshish
Jun 30 2018 08:11
I have registered eureka server to basic authentication.
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
    auth.inMemoryAuthentication()
    .passwordEncoder(NoOpPasswordEncoder.getInstance())                   // for inMemory Authentication
        .withUser("admin").password("password").authorities("ADMIN");       

}

@Override
 public void configure(HttpSecurity http) throws Exception {

     http.csrf().disable().authorizeRequests().anyRequest().authenticated().and().httpBasic();
and while sending request with client to register with eureka its not able to do so
KaijuDeluxe
@KaijuDeluxe
Jun 30 2018 08:12
my services are starting, so there is a bug in the latest built or? Wow, thank you so much @marcosbarbero !!!
SubhamAshish
@SubhamAshish
Jun 30 2018 08:12

eureka:
client:
register-with-eureka: true
fetch-registry: true
service-url:
defaultZone: http://admin:password@localhost:8070/eureka/

instance:
hostname: localhost
prefer-ip-address: true

anyone can please guide on this

?

KaijuDeluxe
@KaijuDeluxe
Jun 30 2018 08:13
@SubhamAshish i need basic auth also. so every client which will consume your server need to use auth? Did you only implement it in the naming server?
Marcos Barbero
@marcosbarbero
Jun 30 2018 08:17
@KaijuDeluxe BUILD-SNAPSHOT means it's under development so yeah, it can contain some bugs, try to always use the GA version, in spring cloud it's always something like *.RELEASE or *.SR${some-number-here}
KaijuDeluxe
@KaijuDeluxe
Jun 30 2018 08:19
@marcosbarbero ok i will do thx. so back to my xml problem. it woul be nice if you provide me some help :)
i have the following code
Marcos Barbero
@marcosbarbero
Jun 30 2018 08:19
Did you check the blog I sent earlier?
@SubhamAshish do you have this code in github?
KaijuDeluxe
@KaijuDeluxe
Jun 30 2018 08:19
yes but i dont find there something how to get xml
Marcos Barbero
@marcosbarbero
Jun 30 2018 08:20
it's simple
KaijuDeluxe
@KaijuDeluxe
Jun 30 2018 08:20
image.png
this is not correct or?
SubhamAshish
@SubhamAshish
Jun 30 2018 08:20
@marcosbarbero yes i did and i could able to resolve that issue
KaijuDeluxe
@KaijuDeluxe
Jun 30 2018 08:21
my service log when calling the api:
image.png
so it dont request xml, it request json
Marcos Barbero
@marcosbarbero
Jun 30 2018 08:22
@KaijuDeluxe try not to upload images to share code, it's a little big difficult to read and also if someone wants to copy and reproduce the issue it won't be possible
KaijuDeluxe
@KaijuDeluxe
Jun 30 2018 08:22
ah ok thx fpr the info
Marcos Barbero
@marcosbarbero
Jun 30 2018 08:22
you can copy and paste your code between ```
SubhamAshish
@SubhamAshish
Jun 30 2018 08:23
@KaijuDeluxe i have basic auth only to server not client
KaijuDeluxe
@KaijuDeluxe
Jun 30 2018 08:23
test
ahh great
Marcos Barbero
@marcosbarbero
Jun 30 2018 08:23
nice :)
KaijuDeluxe
@KaijuDeluxe
Jun 30 2018 08:23
so i had this code
HttpHeaders headers = new HttpHeaders();            headers.setAccept(Arrays.asList(MediaType.APPLICATION_XML));
HttpEntity<String> entity = new HttpEntity<String>("parameters", headers);

ResponseEntity<Products[]> eghProduct = new RestTemplate().exchange(apiUrl, HttpMethod.GET, entity,
Products[].class);
log.info("" + eghProduct.getBody().length);
SubhamAshish
@SubhamAshish
Jun 30 2018 08:23
@marcosbarbero not right now i dont have this on github
Marcos Barbero
@marcosbarbero
Jun 30 2018 08:24
@KaijuDeluxe almost there, some line breaks would be nice hehe
KaijuDeluxe
@KaijuDeluxe
Jun 30 2018 08:24
i edited it right now :)
Marcos Barbero
@marcosbarbero
Jun 30 2018 08:25
the ```part needs a line for itself
and then you put the code in between
that!
KaijuDeluxe
@KaijuDeluxe
Jun 30 2018 08:25
nooow i got it wuhuu
Marcos Barbero
@marcosbarbero
Jun 30 2018 08:26
@SubhamAshish would be nice if you could make a minimum shareable code that reproduces the problem
KaijuDeluxe
@KaijuDeluxe
Jun 30 2018 08:27
so the xml will be like
<products>
      <product>
           ……..
     </product>
 <product>
           ……..
     </product>
</products>
Marcos Barbero
@marcosbarbero
Jun 30 2018 08:27
so, in this line log.info("" + eghProduct.getBody().length);, what's logged?
SubhamAshish
@SubhamAshish
Jun 30 2018 08:27
@marcosbarbero putting it on github
KaijuDeluxe
@KaijuDeluxe
Jun 30 2018 08:27
i get an exception : org.springframework.web.client.RestClientException: Could not extract response: no suitable HttpMessageConverter found for response type [class [Lcom.import2shop.EGHmodel.Products;] and content type [text/xml]
Marcos Barbero
@marcosbarbero
Jun 30 2018 08:28
do you have your Product class properly configured?
KaijuDeluxe
@KaijuDeluxe
Jun 30 2018 08:29
yes product and products
products (with s) contains lot of product objects
Marcos Barbero
@marcosbarbero
Jun 30 2018 08:29
can you share this class here? at least a part of it
KaijuDeluxe
@KaijuDeluxe
Jun 30 2018 08:29
both?
Marcos Barbero
@marcosbarbero
Jun 30 2018 08:30
One is enough
KaijuDeluxe
@KaijuDeluxe
Jun 30 2018 08:30
package com.import2shop.EGHmodel;

import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement
public class Products {
    private Product product;

    public Product getProduct() {
        return product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }

    @Override
    public String toString() {
        return "ClassPojo [product = " + product + "]";
    }
}
Marcos Barbero
@marcosbarbero
Jun 30 2018 08:31
and the xml, you have it?
KaijuDeluxe
@KaijuDeluxe
Jun 30 2018 08:31
@marcosbarbero i think the productS class which hold product-objects need to be a list or?
its huge, i can send a part one sec plesae
its to big i send it via pastebin ok?
Marcos Barbero
@marcosbarbero
Jun 30 2018 08:32
just a pice of it works
pastebin is also fine
I'll be right back, I need some breakfast :)
buon appetit :) mee to getting a coffee. where you fromß europe also?
Marcos Barbero
@marcosbarbero
Jun 30 2018 08:34
yeah, Amsterdam
KaijuDeluxe
@KaijuDeluxe
Jun 30 2018 08:34
cool :) 😎
Marcos Barbero
@marcosbarbero
Jun 30 2018 08:34
yourself?
KaijuDeluxe
@KaijuDeluxe
Jun 30 2018 08:34
dresden do you know it?
Marcos Barbero
@marcosbarbero
Jun 30 2018 08:35
Germany, right?
KaijuDeluxe
@KaijuDeluxe
Jun 30 2018 08:35
yep
do you offer private support?
i am looking for some one who can help me if i am getting in errors (like the latest one) but i dont have time to wait for answers in blogs etc.
so i need some pro to ask and getting a relatvilexy fast answer (payed of course) so i am getting my coffee an brb
Marcos Barbero
@marcosbarbero
Jun 30 2018 08:38
based on your xml I had that feeling you were from Germany.
Let's discuss that privately later, ok @KaijuDeluxe?
KaijuDeluxe
@KaijuDeluxe
Jun 30 2018 08:41
ok cool how does it work here privately?
Fabricio
@ofabricio
Jun 30 2018 15:23
I've created a spring-gateway project with start.spring.io, but in the first run it says:
***************************
APPLICATION FAILED TO START
***************************

Description:

Parameter 0 of method websocketRoutingFilter in org.springframework.cloud.gateway.config.GatewayAutoConfiguration required a bean of type 'org.springframework.web.reactive.socket.client.WebSocketClient' that could not be found.
    - Bean method 'reactorNettyWebSocketClient' not loaded because @ConditionalOnClass did not find required class 'reactor.ipc.netty.http.client.HttpClient'


Action:

Consider revisiting the conditions above or defining a bean of type 'org.springframework.web.reactive.socket.client.WebSocketClient' in your configuration.
Fabricio
@ofabricio
Jun 30 2018 15:38
I downgraded from 2.1.0.BUILD-SNAPSHOT to 2.0.4.BUILD-SNAPSHOT and it worked
Fabricio
@ofabricio
Jun 30 2018 16:07
how do you work with gziped responses with spring-gateway? the filter.modifyResponseBody method throws a JsonParseException: Illegal character when the response is gzipped