packtpublishing / learning-spring-boot-2.0-second-edition Goto Github PK
View Code? Open in Web Editor NEWLearning Spring Boot 2.0, Second edition, published by Packt
License: MIT License
Learning Spring Boot 2.0, Second edition, published by Packt
License: MIT License
I'm working through Learning Spring Boot 2.0 by Greg L. Turnquist and I'm getting a continuous spewing of errors with no idea how to debug them or even find them. I've just finished Chapter 3 and any time I do anything on the site I get the following error:
2019-07-22 19:57:58.245 DEBUG 17404 --- [ctor-http-nio-3] r.n.http.server.HttpServerOperations : [id: 0xbcb056a7, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:52374] Last HTTP response frame
2019-07-22 19:57:58.245 DEBUG 17404 --- [ctor-http-nio-3] r.n.http.server.HttpServerOperations : [id: 0xbcb056a7, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:52374] Decreasing pending responses, now 0
2019-07-22 19:57:58.245 DEBUG 17404 --- [ctor-http-nio-3] r.n.http.server.HttpServerOperations : [id: 0xbcb056a7, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:52374] Last HTTP packet was sent, terminating the channel
2019-07-22 19:57:58.246 TRACE 17404 --- [ctor-http-nio-3] reactor.netty.channel.ChannelOperations : [id: 0xbcb056a7, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:52374] Disposing ChannelOperation from a channel
java.lang.Exception: ChannelOperation terminal stack
at reactor.netty.channel.ChannelOperations.terminate(ChannelOperations.java:391) ~[reactor-netty-0.8.8.RELEASE.jar:0.8.8.RELEASE]
at reactor.netty.http.server.HttpServerOperations.cleanHandlerTerminate(HttpServerOperations.java:519) ~[reactor-netty-0.8.8.RELEASE.jar:0.8.8.RELEASE]
at reactor.netty.http.server.HttpTrafficHandler.operationComplete(HttpTrafficHandler.java:313) ~[reactor-netty-0.8.8.RELEASE.jar:0.8.8.RELEASE]
at reactor.netty.http.server.HttpTrafficHandler.operationComplete(HttpTrafficHandler.java:54) ~[reactor-netty-0.8.8.RELEASE.jar:0.8.8.RELEASE]
at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:502) ~[netty-common-4.1.36.Final.jar:4.1.36.Final]
at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:495) ~[netty-common-4.1.36.Final.jar:4.1.36.Final]
at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:474) ~[netty-common-4.1.36.Final.jar:4.1.36.Final]
at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:415) ~[netty-common-4.1.36.Final.jar:4.1.36.Final]
at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:540) ~[netty-common-4.1.36.Final.jar:4.1.36.Final]
at io.netty.util.concurrent.DefaultPromise.setSuccess0(DefaultPromise.java:529) ~[netty-common-4.1.36.Final.jar:4.1.36.Final]
at io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:101) ~[netty-common-4.1.36.Final.jar:4.1.36.Final]
at io.netty.util.internal.PromiseNotificationUtil.trySuccess(PromiseNotificationUtil.java:48) ~[netty-common-4.1.36.Final.jar:4.1.36.Final]
at io.netty.channel.ChannelOutboundBuffer.safeSuccess(ChannelOutboundBuffer.java:715) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]
at io.netty.channel.ChannelOutboundBuffer.remove(ChannelOutboundBuffer.java:270) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]
at io.netty.channel.ChannelOutboundBuffer.removeBytes(ChannelOutboundBuffer.java:350) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]
at io.netty.channel.socket.nio.NioSocketChannel.doWrite(NioSocketChannel.java:428) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]
at io.netty.channel.AbstractChannel$AbstractUnsafe.flush0(AbstractChannel.java:939) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.flush0(AbstractNioChannel.java:360) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]
at io.netty.channel.nio.AbstractNioByteChannel$1.run(AbstractNioByteChannel.java:54) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) ~[netty-common-4.1.36.Final.jar:4.1.36.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:405) ~[netty-common-4.1.36.Final.jar:4.1.36.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:906) ~[netty-common-4.1.36.Final.jar:4.1.36.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.36.Final.jar:4.1.36.Final]
at java.base/java.lang.Thread.run(Thread.java:835) ~[na:na]
I could just clone his repository (and I probably will) but I would like to know what the problem is here and how I can identify the root of similar problems should I encounter them again. None of the files in the stack trace are my code so I don't know what code snippets I could provide you to help.
When "delete" image, got Response status 405 with reason "Request method 'POST' not supported"
The delete post redirect to / GET.
I'm optaining this compilation error:
Error:(20, 29) java: incompatible types: cannot infer type-variable(s) R,S
(argument mismatch; bad return type in method reference
S cannot be converted to org.reactivestreams.Publisher<? extends R>)
In the method init of the LoadDatabase class:
@Bean
CommandLineRunner init(ChapterRepository repository) {
return args -> {
Flux.just(
new Chapter("Quick Start with Java"),
new Chapter("Reactive Web with Spring Boot"),
new Chapter("...and more!"))
.flatMap(repository::save)
.subscribe(System.out::println);
};
}
The problem is in the line: .flatMap(repository::save)
Any idea why this happends?
It is the source content registered on page 73 of Korean translation.
The return has been changed, but I want you to tell me if it's a different version or a typo.
Flux.just("alpha", "bravo", "charlie")
.map(String::toUpperCase)
.flatMap(s -> Flux.fromArray(s.split("")))
.groupBy(String::toString)
// .sort((s1, s2) -> s1.key().compareTo(s2.key()));
// .flatMap(group -> Mono.just((group.key()).zipWith(group.count()))
Mono.just(): Mono<T>
will return Mono<Void>
Mono.just().and(): Mono<Void>
.flatMap(group -> Mono.just(group.key()).and(group.count()))
.map(keyAndCount -> keyAndCount.getT1() + " => " + keyAndCount.getT2())
.subscribe(System.out::println);
http://localhost:8080/hystrix.stream is unavailable.
This issue might be related to spring-cloud/spring-cloud-netflix#2785 I tried to put the following in application.yml
:
management:
endpoints:
web:
exposure:
include: hystrix.stream
Alas, I had no success. http://localhost:8080/actuator/hystrix.stream is also unavailable.
May I know what I'm missing?
Hello, there seems to be an issue when mapping the Flux result to json when the entities are using Lombok: I get [{}, {},{}] as a response (even with the provided code in this repository).
If I remove the Data annotation from the Chapter entity, and generate plain old getters and setters, there is no issue in the json response, the id and name fields do appear.
I get this error:
Image.java:13: error: variable id not initialized in the default constructor
@Id final private String id;
^
Have I missed something?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.