`
wiselyman
  • 浏览: 2094358 次
  • 性别: Icon_minigender_1
  • 来自: 合肥
博客专栏
Group-logo
点睛Spring4.1
浏览量:82374
74ae1471-94c5-3ae2-b227-779326b57435
点睛Spring MVC4...
浏览量:130817
社区版块
存档分类
最新评论

《JavaEE开发的颠覆者: Spring Boot实战》资源及勘误

 
阅读更多

感谢大家对《JavaEE开发的颠覆者: Spring Boot实战》的支持,您可以在如下地址购买:

 

京东地址:http://item.jd.com/11894632.html

当当地址:http://product.dangdang.com/23926195.html

亚马逊地址:http://www.amazon.cn/图书/dp/B01D5ZBFUK/ref=zg_bsnr_663834051_6

 

本书源码下载地址:http://www.broadview.com.cn/file/resource/061078061207186156162159222041137008231100137136

 

本书试读样章下载地址:

http://d.download.csdn.net/download/broadview2006/9482222

 

以下为《JavaEE开发的颠覆者: Spring Boot实战》勘误,常年更新,读者发现错误和问题,感谢您在此处反馈。或者到此处来查看已发现的错误,我会第一时间反馈出版社在下次印刷中订正。

 

6页 1.2.1节:Maven简介

项目依赖的jar包将不在包含在项目内 -> 项目依赖的jar包将不再包含在项目内

 

37页 2.2.2 示例(Spring EL和资源调用,感谢forever_jenova)
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ResourceConfig.class);

 
->

  AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ELConfig.class);

 

44页 2.5.1 点睛(自定义事件,感谢forever_jenova)

集成ApplicationEvent ->继承ApplicationEvent

 

48页 表格第5行(感谢微博网友@辉Ge1986)

时间发布器->事件发布器

 

 

124页 5.1.4:关于本书的Spring Boot版本

Spring Boot 1.3.1.M2里程碑版本已经发布->Spring Boot 1.3.0.M2里程碑版本已经发布

Spring Boot 1.3.1.x提供了大量的新特性->Spring Boot 1.3.x提供了大量的新特性

 

176 页 代码中(感谢wuxiaozeng2)

防止在->放置在

 

237页 8.1引入docker

(xen、kvm、vmware、virtual) -> (xen、kvm、vmware、virtualbox)

 

268页 6.定义数据访问接口(感谢yhvh)
List<Person> withNameAndAddressNamedQuery(String name,String address);
 
->
Person withNameAndAddressNamedQuery(String name,String address);
 

 

300页8.4.4节:类级别使用@Transactional(感谢微博网友@冇有个性)

则使用在类级别的注解会重载方法级别的注解注解->则使用在方法级别的注解覆盖类级别的注解

 

301页8.4.5:Spring Data JPA的事务支持(感谢java_dsl )

 其余查询操作readOnly仍然为false  
->
其余查询操作readOnly仍然为true

 

305页 注释4(感谢Sailfishc )
指定特定异常时,数据不回滚 

 

413页10.2.1:jar形式(感谢anh20028)

 

mvn pakage

 

->

 

mvn package

 

 

4
7
分享到:
评论
27 楼 先笙夺人 2016-11-29  
博主,下载源码的链接不能用了
26 楼 ljf_home 2016-11-10  
反映一个错误:
148页,“6.3日志配置”小节中,“配置日志级别”、“配置日志文件”这两个写反了。第一个应是文件 ,第二个是级别。
25 楼 allerror 2016-11-04  
hygtx 写道
274页  自定义Repository实现
我运行时出现如下错误:
org.springframework.data.mapping.PropertyReferenceException:No property auto found for type Person!

咋回事啊? 我用的是spring boot 1.4.0.M3,难道是版本的问题,查了官方文档,也没找到解决问题的办法,求老师指点。


這個問題必須在 主入口 也就是main方法的類上加 @EnableJpaRepositories(repositoryFactoryBeanClass = CustomRepositoryFactoryBean.class)
就可以了
24 楼 qwfys200 2016-10-25  
12章的代码跑不起来,我这边用的是版本是jdk1.8.0_101,maven用的版本Apache Maven 3.3.9
23 楼 happy380318 2016-09-22  
云飞兄好(感觉好像自己是李云龙啊)
在第108页 关于基于SSE的服务器推送技术
页面js中多次出现e.readyStata
source.addEventListener('error',function(e){
if(e.readyState==EventSource.CLOSED){
console.log("连接关闭");
}else{
console.log(e.readyState);
}
},false);
页面调试时
连接打开  sse:23:3
undefined sse:29:4
连接打开  sse:23:3
undefined sse:29:4

一直出现undefine,也就是e.readyState未定义
应该是source.readyState就对了
22 楼 MacTavish 2016-09-19  
第9张 系统集成Spring Integration 实战例子中的流程定义
@Bean
	public IntegrationFlow myFlow() throws IOException {
		return IntegrationFlows.from(feedMessageSource()) //4
				.<SyndEntry, String> route(payload -> payload.getCategories().get(0).getName(),//5
						mapping -> mapping.channelMapping("releases", "releasesChannel") //6
								.channelMapping("engineering", "engineeringChannel")
								.channelMapping("news", "newsChannel"))

		.get(); // 7
	}


提示payload和mapping未定义
21 楼 MacTavish 2016-09-06  
第7章的WebSocket聊天室程序总是报错  运行ch7_6也是报同样的错
2016-09-06 16:30:20.088 ERROR 14796 --- [boundChannel-17] .WebSocketAnnotationMethodMessageHandler : Unhandled exception

org.springframework.messaging.converter.MessageConversionException: Could not read JSON: Unrecognized token 'hello': was expecting ('true', 'false' or 'null')
at [Source: [B@48c4d60c; line: 1, column: 11]; nested exception is com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'hello': was expecting ('true', 'false' or 'null')
at [Source: [B@48c4d60c; line: 1, column: 11]
at org.springframework.messaging.converter.MappingJackson2MessageConverter.convertFromInternal(MappingJackson2MessageConverter.java:223) ~[spring-messaging-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.messaging.converter.AbstractMessageConverter.fromMessage(AbstractMessageConverter.java:175) ~[spring-messaging-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.messaging.converter.CompositeMessageConverter.fromMessage(CompositeMessageConverter.java:67) ~[spring-messaging-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.messaging.handler.annotation.support.PayloadArgumentResolver.resolveArgument(PayloadArgumentResolver.java:115) ~[spring-messaging-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:77) ~[spring-messaging-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:139) ~[spring-messaging-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:108) ~[spring-messaging-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.messaging.handler.invocation.AbstractMethodMessageHandler.handleMatch(AbstractMethodMessageHandler.java:465) [spring-messaging-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.messaging.simp.annotation.support.SimpAnnotationMethodMessageHandler.handleMatch(SimpAnnotationMethodMessageHandler.java:482) [spring-messaging-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.messaging.simp.annotation.support.SimpAnnotationMethodMessageHandler.handleMatch(SimpAnnotationMethodMessageHandler.java:86) [spring-messaging-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.messaging.handler.invocation.AbstractMethodMessageHandler.handleMessageInternal(AbstractMethodMessageHandler.java:426) [spring-messaging-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.messaging.handler.invocation.AbstractMethodMessageHandler.handleMessage(AbstractMethodMessageHandler.java:364) [spring-messaging-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.messaging.support.ExecutorSubscribableChannel$SendTask.run(ExecutorSubscribableChannel.java:135) [spring-messaging-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_45]
at java.lang.Thread.run(Thread.java:744) [na:1.7.0_45]
Caused by: com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'hello': was expecting ('true', 'false' or 'null')
at [Source: [B@48c4d60c; line: 1, column: 11]
at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1581) ~[jackson-core-2.6.3.jar:2.6.3]
at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:533) ~[jackson-core-2.6.3.jar:2.6.3]
at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._reportInvalidToken(UTF8StreamJsonParser.java:3451) ~[jackson-core-2.6.3.jar:2.6.3]
at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._handleUnexpectedValue(UTF8StreamJsonParser.java:2610) ~[jackson-core-2.6.3.jar:2.6.3]
at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._nextTokenNotInObject(UTF8StreamJsonParser.java:841) ~[jackson-core-2.6.3.jar:2.6.3]
at com.fasterxml.jackson.core.json.UTF8StreamJsonParser.nextToken(UTF8StreamJsonParser.java:737) ~[jackson-core-2.6.3.jar:2.6.3]
at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:3776) ~[jackson-databind-2.6.3.jar:2.6.3]
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3721) ~[jackson-databind-2.6.3.jar:2.6.3]
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2851) ~[jackson-databind-2.6.3.jar:2.6.3]
at org.springframework.messaging.converter.MappingJackson2MessageConverter.convertFromInternal(MappingJackson2MessageConverter.java:210) ~[spring-messaging-4.2.3.RELEASE.jar:4.2.3.RELEASE]
... 15 common frames omitted




查了很久都没查出哪里有问题?
20 楼 wuxiaozeng2 2016-08-09  
书本176页
关于Thymeleaf的默认位置
应该为放置在classpath,而不是防止在classpath
19 楼 Sailfishc 2016-07-28  
305页事务那一节注释4,使用的注解是@Transactional(noRollbackFor={IllegalArgumentException.class}),这个应该是指定了特定的异常,不会数据回滚,书中写成了指定特定异常时,数据回滚。
18 楼 lkx635903318 2016-07-16  
源码地址挂了 下载不了了    本书源码下载地址:
http://www.broadview.com.cn/?#book/bookdetail/bookDetailAll.jsp?book_id=b47a1c54-5747-4628-b3e2-b8bc4899a97e&isbn=978-7-121-28208-9 求马上解决
17 楼 wiselyman 2016-07-08  
ddsdggsg 写道
关于Docker的描述似乎有误吧?https://www.docker.com/上描述Windows版要求Win10x64,书中所述不支持Win10?

在我写的时候还不支持。
16 楼 ddsdggsg 2016-07-07  
关于Docker的描述似乎有误吧?https://www.docker.com/上描述Windows版要求Win10x64,书中所述不支持Win10?
15 楼 bresai 2016-07-01  
难得的好书,国内技术书少见的经典
14 楼 jonsvien 2016-06-09  
云飞兄,按照你编的书中的事例,一直加载不到静态资源。
结构和配置如下:
------------------------------------

-----------------------------------------
package com.example.mp;


import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;

@SpringBootApplication
@EnableWebMvc
public class Application {
	public static void main(String[] args) {
		SpringApplication.run(Application.class, args);
	}
}

--------------------------------------
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8" />
<title>Insert title here</title>
<link rel="stylesheet" th:href="@{bootstrap-3.3.5-dist/css/bootstrap.min.css}" />
<script type="text/javascript" th:src="@{jquery-2.2.4.min.js}"></script>
<script type="text/javascript" th:src="@{bootstrap-3.3.5-dist/js/bootstrap.min.js}"></script>
</head>
<body>
	<h1>Thymeleaf tutorial - Answer for exercise 1: bean values</h1>
	<h2>Product information</h2>
	<dl>
		<dt>Product name</dt>
		<dd th:text="${user.account}">Red Chair</dd>

		<dt>Product price</dt>
		<dd th:text="${user.password}">350</dd>
	</dl>
</body>
</html>

------------------------------------------
logging.level.org.springframework.web = DEBUG
#spring.thymeleaf.prefix=/WEB-INF/page/
#spring.thymeleaf.suffix=.html

--------------------------------------------
能够正常返回view,显示后台返回的数据,但是就是不能引用到js和css.
13 楼 hygtx 2016-06-08  
274页  自定义Repository实现
我运行时出现如下错误:
org.springframework.data.mapping.PropertyReferenceException:No property auto found for type Person!

咋回事啊? 我用的是spring boot 1.4.0.M3,难道是版本的问题,查了官方文档,也没找到解决问题的办法,求老师指点。
12 楼 wiselyman 2016-05-27  
yinshuili 写道
wiselyman 写道
yinshuili 写道
yhvh 写道
268页 6.定义数据访问接口
//4
List<Person> withNameAndAddressNamedQuery(String name,String address);
应为
Person withNameAndAddressNamedQuery(String name,String address);


我运行这句的时候(Intellij Idea),报错:
Caused by: org.springframework.data.mapping.PropertyReferenceException: No property withName found for type Person!

@NamedQuery的方法命名,最近的spring boot 1.3.5_RELEASE 必须用类的属性名么?

为啥你们可以?请多多指教!谢谢!


实体类上的@NamedQuery是否写了?


是的,用的是原代码

yinshuili 写道
wiselyman 写道
yinshuili 写道
yhvh 写道
268页 6.定义数据访问接口
//4
List<Person> withNameAndAddressNamedQuery(String name,String address);
应为
Person withNameAndAddressNamedQuery(String name,String address);


我运行这句的时候(Intellij Idea),报错:
Caused by: org.springframework.data.mapping.PropertyReferenceException: No property withName found for type Person!

@NamedQuery的方法命名,最近的spring boot 1.3.5_RELEASE 必须用类的属性名么?

为啥你们可以?请多多指教!谢谢!


实体类上的@NamedQuery是否写了?


是的,用的是原代码


@Entity //1
@NamedQuery(name = "Person.withNameAndAddressNamedQuery",
query = "select p from Person p where p.name=?1 and address=?2")
public class Person {
有吧?
11 楼 yinshuili 2016-05-27  
wiselyman 写道
yinshuili 写道
yhvh 写道
268页 6.定义数据访问接口
//4
List<Person> withNameAndAddressNamedQuery(String name,String address);
应为
Person withNameAndAddressNamedQuery(String name,String address);


我运行这句的时候(Intellij Idea),报错:
Caused by: org.springframework.data.mapping.PropertyReferenceException: No property withName found for type Person!

@NamedQuery的方法命名,最近的spring boot 1.3.5_RELEASE 必须用类的属性名么?

为啥你们可以?请多多指教!谢谢!


实体类上的@NamedQuery是否写了?


是的,用的是原代码
10 楼 wiselyman 2016-05-27  
yinshuili 写道
yhvh 写道
268页 6.定义数据访问接口
//4
List<Person> withNameAndAddressNamedQuery(String name,String address);
应为
Person withNameAndAddressNamedQuery(String name,String address);


我运行这句的时候(Intellij Idea),报错:
Caused by: org.springframework.data.mapping.PropertyReferenceException: No property withName found for type Person!

@NamedQuery的方法命名,最近的spring boot 1.3.5_RELEASE 必须用类的属性名么?

为啥你们可以?请多多指教!谢谢!


实体类上的@NamedQuery是否写了?
9 楼 yinshuili 2016-05-26  
yhvh 写道
268页 6.定义数据访问接口
//4
List<Person> withNameAndAddressNamedQuery(String name,String address);
应为
Person withNameAndAddressNamedQuery(String name,String address);


我运行这句的时候(Intellij Idea),报错:
Caused by: org.springframework.data.mapping.PropertyReferenceException: No property withName found for type Person!

@NamedQuery的方法命名,最近的spring boot 1.3.5_RELEASE 必须用类的属性名么?

为啥你们可以?请多多指教!谢谢!
8 楼 qiusenvs 2016-05-26  
你好 ch12 导入 eclipse 运行任何一个项目 都报错 ,错误信息一样:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor': Invocation of init method failed; nested exception is javax.validation.ValidationException: Unable to create a Configuration, because no Bean Validation provider could be found. Add a provider like Hibernate Validator (RI) to your classpath.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:199)
at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:615)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:465)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:139)
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:126)
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:75)
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:55)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:151)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:128)
at org.springframework.boot.context.event.EventPublishingRunListener.publishEvent(EventPublishingRunListener.java:100)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:59)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:285)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:957)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:946)
at com.wisely.config.ConfigApplication.main(ConfigApplication.java:14)
Caused by: javax.validation.ValidationException: Unable to create a Configuration, because no Bean Validation provider could be found. Add a provider like Hibernate Validator (RI) to your classpath.
at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:271)
at org.springframework.validation.beanvalidation.LocalValidatorFactoryBean.afterPropertiesSet(LocalValidatorFactoryBean.java:223)
at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor$Jsr303ValidatorFactory.run(ConfigurationPropertiesBindingPostProcessor.java:381)
at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.afterPropertiesSet(ConfigurationPropertiesBindingPostProcessor.java:174)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1633)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
... 23 common frames omitted


是否是缺包?

相关推荐

Global site tag (gtag.js) - Google Analytics