spring-cloud-gateway icon indicating copy to clipboard operation
spring-cloud-gateway copied to clipboard

Spring Cloud Gateway that integrations with eureka route error , 404 on Wildfly8.1.0

Open TenYearsIn opened this issue 7 years ago • 27 comments

I do the demo from Spring Cloud Gateway Website , and I integration the project with eureka , then i run it on springboot embedded container (deployment on jar) , it can route ,However, I run it On Wildfly8.1.0,it error ,response status code is 404 .please give me some suggestions~

TenYearsIn avatar Jan 22 '19 11:01 TenYearsIn

Please provide an minimal, complete, verifiable example that reproduces the issue.

OlgaMaciaszek avatar Jan 22 '19 11:01 OlgaMaciaszek

Please provide an minimal, complete, verifiable example that reproduces the issue.

my Gateway Project? however this project runs on Wildfly8, so i also provider wildfly 8 zip ?

TenYearsIn avatar Jan 22 '19 12:01 TenYearsIn

What is returning a 404, the request from the gateway to register with Eureka?

ryanjbaxter avatar Jan 22 '19 22:01 ryanjbaxter

What is returning a 404, the request from the gateway to register with Eureka?

No , My Project Gateway successfully send hearbeat to Eureka Server and successfully register with Eureka Server . The Stituation whose response status code 404 is request from gateway routes to other eureka client(e.g. LogServer) ,the browser return status code 404 . my access to the address is http://gatewayIP:gatewayPort/log( log is other eureka client ),what's more , request from gateway accesss Gateway's Controller is also return 404 . The Project runs on Wildfly 8.1.0 as *.war

TenYearsIn avatar Jan 23 '19 01:01 TenYearsIn

Then we need a sample to reproduce it

ryanjbaxter avatar Jan 23 '19 16:01 ryanjbaxter

fine , My Demo Project'address is https://github.com/TenYearsIn/Demo.git 。please give me some suggestions , this sistuation obsesses me for a long time . log is my other eureka client.discovery integrations with eureka ,at the last , please run it on Wildfly 8.1.0

TenYearsIn avatar Jan 24 '19 06:01 TenYearsIn

Did you follow the guide in https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#build-tool-plugins-maven-packaging

The undertow dependencies need to be provided so they don't conflict with the app server.

spencergibb avatar Jan 24 '19 06:01 spencergibb

@spencergibb Thanks ! Dear friends , Sorry , I don't see Your suggestion , The undertow dependencies need to be provided so they don't conflict with the app server.

TenYearsIn avatar Jan 24 '19 23:01 TenYearsIn

@spencergibb hello ,Dear Sir, i have followed the Guide in (https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#build-tool-plugins-maven-packaging),but this doesn't work ! any suggestions can give?

TenYearsIn avatar Jan 25 '19 08:01 TenYearsIn

but it doesnt work

That is not useful, please more descriptive.

ryanjbaxter avatar Feb 01 '19 16:02 ryanjbaxter

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

spring-projects-issues avatar Feb 08 '19 16:02 spring-projects-issues

@ryanjbaxter hello,Dear friend,First i introduce My project ,I use gateway integrations with eureka (Spring-cloud dependency version is Finchley.RELEASE,spring boot dependency version is 2.0.3.release )and I use undertow as container,JBoss 8.1.0.Final as application server 。at last ,I deploy my project as *.war and it can compile successfully,but it can not route to eureka client in browser ,the response code is 404 。Could U give me a hand?

TenYearsIn avatar Feb 11 '19 03:02 TenYearsIn

but it can not route to eureka client in browser

Meaning you cannot get to the eureka dashboard?

ryanjbaxter avatar Feb 11 '19 18:02 ryanjbaxter

Even though you gave us a project (which is not minimal), there are no instructions on how to reproduce your problem. We still don't know exactly what the problem is.

spencergibb avatar Feb 11 '19 18:02 spencergibb

but it can not route to eureka client in browser

Meaning you cannot get to the eureka dashboard?

no no no ,In practice,My sample project has three modules and they are Log service (exposed port is 8082) ,discovery service(exposed port is 8080 ) and gateway service (exposed port is 8081 ) . I use undertow as container,JBoss 8.1.0.Final as application server . I deploy my project as *.war and it can compile successfully ,however I visit the url (http://localhost:8081/log/hello/mc ) on the browser ,the response code is 404 . I update My Demo Project , url : https://github.com/TenYearsIn/Demo.git by the way ,Is there any question in my configuration files and pom.xml in my gateway module?Thank U !

TenYearsIn avatar Feb 12 '19 06:02 TenYearsIn

I visit the url (http://localhost:8081/log/hello/mc ) on the browser

I have not run the applications but this seems like nothing that should be due to Spring Cloud Gateway it is just a RestController. Can you try the same thing without using the Gateway dependency?

ryanjbaxter avatar Feb 13 '19 22:02 ryanjbaxter

yes . I used zuul in the same case,I visit the url (http://localhost:8081/log/hello/mc ) on the browser .it can return my expectant result 。but i replace zuul with gateway and it return 404 。 I spend lots of time on it and I still can't find any reason。

TenYearsIn avatar Feb 14 '19 01:02 TenYearsIn

What happens when you hit this endpoint? https://github.com/TenYearsIn/Demo/blob/master/spring-cloud-example/gateway/src/main/java/com/example/lophie/gateway/web/controller/SystemController.java#L19

ryanjbaxter avatar Feb 14 '19 01:02 ryanjbaxter

it return plain text on the browser (I used Spring-web dependency,not spring-webflux denpendency),"Hello,mc!" it is just a "RestController",

TenYearsIn avatar Feb 14 '19 01:02 TenYearsIn

I am really confused because in the readme you say you get a 404

I visit gateway's Controller(url:http://localhost:8081/hello/test),it return 404

ryanjbaxter avatar Feb 15 '19 01:02 ryanjbaxter