学成在线项目异常
Day01
1 出現(xiàn)本地倉庫的包存在,但是pom文件找不到
解決方式:首先打開IDEA中的Maven設(shè)置,勾選work offline,將倉庫中目錄中的__remote.repositories文件全部刪除,此時還不行,發(fā)現(xiàn)重新手敲依賴代碼,pom文件文件依賴不再爆紅,還有spring-cloud-starter-feign這個沒有添加版本,添加版本即可。
2 <relativePath>../xc-framework-parent/pom.xml</relativePath>標(biāo)簽內(nèi)容為紅色
解決方式:應(yīng)該是因?yàn)樽庸こ滩]有放到父工程下,所以導(dǎo)致出現(xiàn)警告,但是按照講義,這個子工程確實(shí)沒有放到父工程下,只是在pom中聲明了父工程,這個沒解決,但是好像不影響項(xiàng)目。
Day02
3 出現(xiàn) sh: webpack‐dev‐server: command not found 異常
解決方式:將nodejs以及webpack換成文檔所使用的版本,將npm_modules刪除,重新執(zhí)行安裝命令。還有一種可能是從文檔拷貝到IDE中的代碼格式有問題,手敲一遍。自己解決也有點(diǎn)稀了糊涂,弄了一遍,不好使,然后重新弄了一遍就好使了,也有可能是IDE提醒要```npm install```一下。
4 Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.configuration.entry should be one of these:
首先在build/webpack.dev.conf.js文件中devServer: {}中添加```inline: false,```。然后在終端npm uninstall webpack-dev-server@3.9.1, npm install install webpack-dev-server
5 internal/child_process.js:340 throw errnoException(err, 'spawn');
在根目錄下打開終端運(yùn)行命令 chmod -R u+x .
6 Node Sass could not find a binding for your current environment: OS X 64-bit with Node.js 9.x Found bindings for the following environments:Windows 64-bit with Node.js 9.x.......
參考鏈接:https://www.cnblogs.com/shanidea/p/11792196.html
問題原因:
MacOS 下 node-sass 編譯沒通過,導(dǎo)致 node-sassvendordarwin-x86-59 目錄下缺少 binding.node 文件。
解決辦法:
解決方法一:執(zhí)行命令```npm rebuild node-sass```,即從新編譯 node-sass 即可。
注意:前提是--安裝python,并擁有python環(huán)境!
解決方法二(本人本項(xiàng)目所使用的解決方法):
問題原因:
由于..
ode-sassvendordarwin-x86-59inding.node文件的版本缺失,導(dǎo)致出現(xiàn)報錯。
本人的電腦系統(tǒng)是MacOS,而資料的代碼開發(fā)在windows平臺下,系統(tǒng)報錯在darwin-x64-59目錄下缺少binding.node文件,使用以下命令查看對應(yīng)的版本```node -p "[process.platform, process.arch, process.versions.modules].join('-')"```,所以去官網(wǎng)https://github.com/sass/node-sass/releases下載相應(yīng)版本的 binding.node 文件。并放入到報錯項(xiàng)目的 node-sassvendor文件夾下(注意下載的是.node文件,不要下載錯),如:我的系統(tǒng)需要下載的 darwin-x64-59_binding.node 文件,下載之后將該文件重命名為 binding.node 后放入到 node-sassvendordarwin-x64-59 目錄下即可。最后:運(yùn)行成功。
Day03
6 "JSON parse error: Cannot deserialize value of type java.util.Date from String "2018‐06‐11T02:01:25.667Z": expected format "yyyy-MM-dd'T'HH:mm:ss.SSSZ";
JSON parse error: Cannot deserialize instance of java.lang.String out of START_ARRAY token;
修改json數(shù)據(jù)pageCreateTime為"2020-02-06T07:34:21.255Z"
7 JSON parse error: Cannot deserialize instance of java.lang.String out of START_ARRAY token;
"pageParameter": [{
"pageParamName": "string",
"pageParamValue": "string"
}]
使用這個測試,會報錯,所以還是先修改為"pageParameter":"string"
8"export 'page_add' (imported as 'cmsApi') was not found in '../api/cms'
因?yàn)閏ms.js中沒有定義page_add ,所以先定義一個空的,之后需要什么功能再填寫即可。
export const page_add = () => {
}
Day04
9 "Field restTemplate in com.xuecheng.test.freemarker.controller.FreemarkerController required a bean of type 'org.springframework.web.client.RestTemplate' that could not be found."
Spring Boot >= 1.4
Spring Boot no longer automatically defines a RestTemplate but instead defines a RestTemplateBuilder allowing you more control over the RestTemplate that gets created. You can inject the RestTemplateBuilder as an argument in your @Bean method to create a RestTemplate:
@Bean
public RestTemplate restTemplate(RestTemplateBuilder builder) {
// Do any additional configuration here
return builder.build();
}
Using it in your class
@Autowired
private RestTemplate restTemplate;
10 " “Circular view path” exception with Spring MVC test"
首先注意使用@Controller不是@RestControll,然后還不行,就是freemarker包導(dǎo)入有問題,本工程解決該問題,是將parent工程的freemark版本移除,直接在freemarker工程下的pom文件中添加freemarker版本。
Day04
11 "出現(xiàn)無法注入RabbitTemplate"
在Producer05_topics_springboot類上添加SpringBootApplication。
12 "Unable to find a @SpringBootConfiguration when doing a JpaTest"
將Rabbitmq中的交換機(jī)刪除,重新運(yùn)行程序即可。
Day07
13 出現(xiàn)使用Jpa的findById查不到數(shù)據(jù)庫數(shù)據(jù)。
public CourseMarket getCourseMarketById(String courseId) {
Optional<CourseMarket> optional = courseMarketRepository.findById(courseId);
if (optional.isPresent()) {//在這之前有一個!,找到半天錯誤才找到因?yàn)檫壿嬋》磳?dǎo)致出錯
return optional.get();
}
return null;
}
Day10
14 Elasticsearch error: cluster_block_exception FORBIDDEN/12/index read-only / allow delete (api)], flood stage disk watermark exceeded異常
使用postman
PUT localhost:9200/_cluster/settings
{
"transient":{
"cluster.routing.allocation.disk.watermark.low":"90%"
}
}
原因就是電腦內(nèi)存不夠了,修改最低內(nèi)存為90%,不想弄可以換個大內(nèi)存電腦^_^。
如果還不行,就是電腦內(nèi)存剩的少于百分之10了,用如下方式解決:
PUT localhost:9200/_settings
{
"index": {
"blocks": {
"read_only_allow_delete": "false"
}
}
}
發(fā)現(xiàn)每次給9200端口發(fā)送請求都需要設(shè)置一下。
總結(jié)
- 上一篇: python消息队列框架持久化_消息队列
- 下一篇: 自动化运维系统具备的功能