为了账号安全,请及时绑定邮箱和手机立即绑定

Java从零打造企业级电商项目实战-服务端_课程问答-FAQ

标签:
Java Linux

图片描述

此手记会根据Java从零打造企业级电商项目实战课程的问答区不断更新。目前已经1200多个问题啦。也算是一个小型问答知识库啦。我在这里特意给大家人肉整理整理~提炼一些有代表性的问题,供大家学习~提供更有效的问答路径~不要太感动哟~

注:此FAQ会不断更新......

看完整源码
linux&&windows
请问视频中Linus和windows两条路线是分别独立的吗?只需要跟随其中一条主线就可以完整的完成视频中项目吗?
源配置能干嘛?它的作用是啥?目的又是什么?为什么这么配置?
tomcat
nginx、vsftpd图片服务器
老师您好 http 转发可以实现,但是无法找到图片
关于image.imooc.com.conf域名解析的问题
为什么要上传到ftp服务器
关于在创建一个user去更新的问题
idea技巧
快速从service页面跳到.xml页面。
请问老师哦,idea怎么设置成您那样的 变量高亮显示,您的是亮绿色的
SpringMVC
为什么老师的int全部用的Integer?
忘记密码中的token
为什么用token,还要有有效时间
vsftpd文件配置正确,ftpfile文件目录权限正确的情况下出现该问题。
226 Transfer done(fial to open directory)
Maven环境变量为什么不是M2_HOME
老师你好,之前看的Maven的环境变量都是配置为M2_HOME,这和MAVEN_HOME有什么区别呢?
pageHelper的应用
为什么不直接用new pageInfo(productListVolList)

http://coding.imooc.com/learn/questiondetail/qid/19765

ServerResponse
为什么要新建ResponseCode这个枚举类呢,serverResponse类的status直接赋值为数字岂不是更快捷?

http://coding.imooc.com/learn/questiondetail/19783.html

datasource.properties
applicationContext-datasorce.xml文件无法读取datasource.properties

http://coding.imooc.com/learn/questiondetail/19868.html

执行git push -u origin master报错
$ git push -u origin master Permission denied (publickey).

http://coding.imooc.com/learn/questiondetail/19864.html

为什么我打开像conf这类文件没有格式,连在一起

http://coding.imooc.com/learn/questiondetail/19844.html

tomcat local配置完成后,启动的图标找不到tomcat

http://coding.imooc.com/learn/questiondetail/19745.html

图片上传,点击上传,直接报404,没有走后台服务,路径上都是对的啊,也是用的注解中的名字upload_file

http://coding.imooc.com/learn/questiondetail/19625.html

driverLocation配置文件路径在哪看啊?

http://coding.imooc.com/learn/questiondetail/15189.html

不明白最后切到阿里云是什么意思

http://coding.imooc.com/learn/questiondetail/19990.html

AlipaySDK3.0面对面扫码

http://coding.imooc.com/learn/questiondetail/55475.html

求解,是不是将支付宝提供的案例集成到自己的业务逻辑代码中?SDK具体到底是啥,是支付宝扫码支付的源码吗?

还有一点,是不是当在购物车里点击购买,这就生成了一个订单?然后如果不支付,就留订单一段时间,状态是未支付?

http://coding.imooc.com/learn/questiondetail/20329.html

mysql服务启动失败 查看日志Can't open the mysql.plugin table异常

http://coding.imooc.com/learn/questiondetail/20588.html

/usr/libexec/mysqld: Table 'mysql.plugin' doesn't exist
170812 14:33:08 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
170812 14:33:08  InnoDB: Initializing buffer pool, size = 8.0M
170812 14:33:08  InnoDB: Completed initialization of buffer pool
170812 14:33:08  InnoDB: Started; log sequence number 0 44233
170812 14:33:08 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
170812 14:33:08 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
hi 同学你好,这个估计是安装mysql的时候权限不对,导致mysql.plugin这个表没有安装上。
建议卸载mysql,重新安装试试看,如果安装正确,这个表是在mysql初始化的时候就会ok的~~
或者还有一个办法,在qq群里找同学要一个安装ok的同学,要这个表过来,然后query中create上这个表即可。当然要用mysql的root权限哟~~
default Mybatis Configuration

[15:50:39.055][DEBUG][org.mybatis.spring.SqlSessionFactoryBean][main] Property configuration or 'configLocation' not specified, using default MyBatis Configuration

http://coding.imooc.com/learn/questiondetail/20564.html

hi 同学,你好,这个没有关系。

看看这段代码
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">  
    <property name="configLocation" value="classpath:mybatis-config.xml" />  
    <property name="dataSource" ref="dataSource" />  
</bean>  

这里是注入了configLocation这个property,而我们课程中是这样的配置的

<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
   <property name="dataSource" ref="dataSource"/>
   <property name="mapperLocations" value="classpath*:mappers/*Mapper.xml"></property>

   <!-- 分页插件 -->
   <property name="plugins">
       <array>
           <bean class="com.github.pagehelper.PageHelper">
               <property name="properties">
                   <value>
                       dialect=mysql
                   </value>
               </property>
           </bean>
       </array>
   </property>

</bean>

我们没有指定,而是通过mapperLocations指定了mapper的位置,所以没有关系的。提示只是说用了默认的property的value。
我得一个项目里面的定时方法在idea下到了指定时间不执行 启动tomcat无报错 同样是这个项目在eclipse这个方法在指定的时间会执行到

http://coding.imooc.com/learn/questiondetail/20525.html


hi 同学给你一个思路,请按照检查

1.eclipse和idea中关于tomcat、maven、jdk等配置保持一致

2.eclipse中如果打开这个项目,schedule是ok的,那么代表这个bean是create 成功的,那么idea中不ok,那么说明在idea启动中这个schedule的bean creae失败

3.如果是先打开eclipse,没有关闭服务,请记得关闭eclipse启动的服务,避免和idea中的服务端口等发生冲突。

4.检查日志,把spring schedule相关的日志的logger全部打开,看看项目启动过程中在eclipse和idea中的日志,有没有什么不一样的地方。

5.检查tomcat的localhost日志。

6.建议idea和eclipse如果是同一台机器,请部署在不同的tomcat当中。避免冲突。

7.这个不是咱们课程里的问题,但是能帮的到的我会尽力帮你的~

8.锻炼自己解决问题的能力,多多谷歌,百度。找到关键异常。

9.加油!!
4-10 的 mybatis generator 双击创建失败

http://coding.imooc.com/learn/questiondetail/20460.html

[ERROR] Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate (default-cli) on project mmall: Execution default-cli of goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate failed: Exception getting JDBC Driver: com.mysql.jdbc.Driver -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
按照百度的添加了一个version标签。还是不行?求解答,谢谢
 Exception getting JDBC Driver: com.mysql.jdbc.Driver -> [Help 1]

提示是说jdbc的驱动有问题,请检查一下,在课程下载的代码中tools里有那个工具,要指向这一个。

图片描述

jdk下载 403异常

http://coding.imooc.com/learn/questiondetail/9185.html

这个操作咱们视频里有讲,因为oracle官方需要token进行下载,所以我们要登录一下我们的oracle账号,如果没有的话,注册一个登录。然后点击下载,在下载的时候,先别着急关闭,然后通过浏览器的下载工具找到真实的下载url,然后在阿里云上wget,这样就ok了,这个时候不要关闭自己浏览器发起的下载,否则token就要失效啦,另外建议可以从这里下载。我们已经为大家准备好了哈。http://learning.happymmall.com/jdk/
按照老师操作的方式启动tomcat localhost 404 错误

http://coding.imooc.com/learn/questiondetail/9371.html

项目以后会有技术演进的讲解吗?

http://coding.imooc.com/learn/questiondetail/9336.html

Chrome 浏览器打开的怎么是这样,nginx配置conf文件无排版,无格式化

http://coding.imooc.com/learn/questiondetail/9235.html

图片描述

未登录状态下如何实现购物车,大致实现原理是什么

http://coding.imooc.com/learn/questiondetail/9674.html

关于表结构中表ENGINE=InnoDB,AUTO_INCREMENT=10032,DEFAULTCHASET=utf8分别是什么意思?

http://coding.imooc.com/learn/questiondetail/9665.html

我不太明白最后那三项是干嘛的?
ENGINE=InnoDB不是默认就是这个引擎吗?
AUTO_INCREMENT=10032,它不是自增的吗?为什么还要设数字?
utf8不是已经在my.ini里设置过了?
hi同学你好
ENGINE=InnoDB不是默认就是这个引擎吗?
---是的,如果不写这个也ok,就会走默认的,这里面我们是用navicat生成的的表,所以在生成的sql语句是非常全面的,也让大家能看到这个建表语句里用了哪些。另外在创建的时候,都写上也是一个良好的习惯。

AUTO_INCREMENT=10032,它不是自增的吗?为什么还要设数字?
---这个问题思考的很赞,这个问题原因是,我们初始化的时候,把分类从100000开始的,当时设置的时候是100000。所以自增呢,就会从100000开始自增,那么这里为什么是100032呢,是因为当时我们这个表里面已经有100000-100031的数据存在,所以navicat出现的sql语句呢,就是代表在查看的当时如果建表的话,会从100032开始自增

utf8不是已经在my.ini里设置过了?
---这个虽然在myini里设置过了,但是我们在创建表的时候这里也要设置,如果不设置,就会出现乱码问题,他们的作用域是不一样的,我们在创建表的时候,这个charset会作用到我们这个表上的,它代表mysql建立数据库数据表时设定字符集为utf-8。
PageHelper中字段含义,问题详见图片

http://coding.imooc.com/learn/questiondetail/9576.html

关于image.imooc.com.conf域名解析的问题

http://coding.imooc.com/learn/questiondetail/9562.html

老师,IDEA的terminal怎么设置成是和Linux的终端一样,用Linux的命令?我的是Windows的环境

http://coding.imooc.com/learn/questiondetail/9899.html

该接口set_category_name.do 测试更新乱码

http://coding.imooc.com/learn/questiondetail/9862.html
图片描述

nginx.exe -s reload命令

使用nginx.exe -s reload命令出现错误:
nginx: [error] OpenEvent("Global\ngx_reload_640") failed (2: The system cannot find the file specified)

http://coding.imooc.com/learn/questiondetail/10107.html

老师我就在windows下开发,linux那部分操作跳过,没事吧
就一期课程而言是没有问题的,但是后续我们部署云服务器的时候都是用的linux~~
非常建议linux不要跳过,可以装个虚拟机在里面玩耍哈~而且以后我们的课程都是基于linux的,例如redis的分布式缓存等哈
配置来配置去,还配置不成功。啊我的热情都快凉了

http://coding.imooc.com/learn/questiondetail/10284.html

db.driverLocation

http://coding.imooc.com/learn/questiondetail/10191.html

window不能连到linux的ftp,而linux自己可以

http://coding.imooc.com/learn/questiondetail/10167.html

老师,我的MavenProjects只有Lifecycle

http://coding.imooc.com/learn/questiondetail/10611.html

项目的代码会提供吗

http://coding.imooc.com/learn/questiondetail/10426.html

老师能说的详细点 idea配置tomcat太难了 搞了一天了 还是没明白artifacts没有显示是什么原因

http://coding.imooc.com/learn/questiondetail/10559.html

实现序列化接口有什么作用

http://coding.imooc.com/learn/questiondetail/10969.html

http://learning.happymmall.com 中tar.gz的url打开时乱码 怎么下载

http://coding.imooc.com/learn/questiondetail/11036.html

老师为什么不把productListVoList直接给到PageInfo?

http://coding.imooc.com/learn/questiondetail/10968.html

我在数据库表中添加一个字段,然后在idea中使用mybatis-generator 插件重新生成类,resource下mapper文件会报错!怎么解决

http://coding.imooc.com/learn/questiondetail/11451.html

在哪里下载这个课程的代码?

http://coding.imooc.com/learn/questiondetail/11390.html

我的项目中没有target目录 老师的有 这是什么情况呢??

http://coding.imooc.com/learn/questiondetail/12169.html

tomcat远程调用

http://coding.imooc.com/learn/questiondetail/11973.html

db数据库配置相关

http://coding.imooc.com/learn/questiondetail/21265.html

1.请问mmall@%这么设置是为了让主机以外的机器可以登录服务器的数据库吗?
-------是的,这个是设置远程权限,%代表地址,前面是库
2.mmall@%和mmall@localhost代表同一个用户不同的登录权限是吧,该用户下的db们都是同一个吧。
-------是的,不同权限,localhost就是mysql的本机登录哟~登录的都是同一个db的
3.但是为什么我在服务端看到新建的db和表都在root用户下,用mmall用户登录里面却没有创建好的表。。
-------是不是之前用root创建过呢?可以删除掉,重新用mmall创建,另外记得给mmall这个用户的create table等各种权限哟
对TokenCache类中CacheLoader返回"null"的疑惑

http://coding.imooc.com/learn/questiondetail/12953.html

老师,List什么时候用new ArrayList定义,什么时候用Lists.newArrayList()定义?

http://coding.imooc.com/learn/questiondetail/13453.html

500求解读!来位大神帮忙看下问题 谢谢!

http://coding.imooc.com/learn/questiondetail/14895.html

hi同学,可以再认真一点,再耐心一点看看你的 报错

说的很明白,这个sql有问题,我看了看,发现from之后没有表名,希望下次这种简单的问题自己能搞定哟

### SQL: select           id, username, password, email, phone, question, answer, role, create_time, update_time         FROM     where username = ?     and password = ?
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where username = 'admin'
老师 这里我创建了一个新的的用户后 执行命令出现以下问题 。后来用root才能正常运行,这是咋回事? 如果以后的课程都是用root可以不?

http://coding.imooc.com/learn/questiondetail/13607.html

ftp连接上阿里云服务器,但是无法看到文件及目录,也无法上传下载和创建文件夹等...vsftpd

http://coding.imooc.com/learn/questiondetail/14276.html

hi 同学你好
1.检查vsftpd配置,http://learning.happymmall.com/vsftpdconfig/ 右键另存为一个vsftpd的配置,对比检查一下
2.检查ftp账号赋值的是否有问题,可以尝试重新创建账号
3.不在阿里云,在linux下是否ok?
4.检查vsftpd的其他配置,例如chrootlist等文件配置
5.检查ftp开放的目录的权限,是否已经赋予权限
6.阿里云的安全组,端口开放
7.防火墙的端口开放,如果关闭了的话,应该可以暂时不考虑。
8.通过ftp客户端连接试试,看看报错什么?把报错提示信息发出来。
git命令是怎么在IDEA中调出来的

http://coding.imooc.com/learn/questiondetail/16276.html

远程debug问题

http://coding.imooc.com/learn/questiondetail/17317.html

老师 这个代码里面为什么要用token啊?token在这里的作用是什么啊

http://coding.imooc.com/learn/questiondetail/18169.html

为什么不直接用new pageInfo(productListVolList)

http://coding.imooc.com/learn/questiondetail/19765.html

图片上传,点击上传,直接报404,没有走后台服务,路径上都是对的啊,也是用的注解中的名字upload_file

http://coding.imooc.com/learn/questiondetail/19625.html

求解,是不是将支付宝提供的案例集成到自己的业务逻辑代码中?SDK具体到底是啥,是支付宝扫码支付的源码吗?

http://coding.imooc.com/learn/questiondetail/20329.html

支付宝回调,我已经学完了课程。再看这里的时候发现一个问题:如果支付宝支付成功后的返回超时了怎么处理? 但是钱已经扣了啊

http://coding.imooc.com/learn/questiondetail/20694.html

PPT

http://coding.imooc.com/learn/questiondetail/21014.html

Mybatis 中constructor 的好处

1、下面返回的ResultMap可以直接写com.mmall.pojo.Category,为什么还要在这个弄个构造器呢,希望老师解答,可能中间有说过没看仔细
2、然后我目前在做的一个是国家 -》省份-》城市-》-》地区的树形结构 ,已经从老师的代码中找到了灵感,但是前台的显示不知道怎么展示,需求里有搜索的功能,希望老师能够指点迷津,感谢感谢

http://coding.imooc.com/learn/questiondetail/21108.html

你好同学
1.这个问题是通过这个构造器的配置,和我们pojo生成的类进行对应哟~~按照这个类型和顺序 嘻嘻 希望你能理解
2.赞!就用我们的分类这种结构即可。搜索的话可以按照不同的type搜索,展示很简单,你去京东下单,看看地址怎么填写的?
老师,mapper.xml里的useGeneratedKeys和keyProperty是什么作用啊?没看明白

http://coding.imooc.com/learn/questiondetail/21354.html

tomcat部署应用问题

http://coding.imooc.com/learn/questiondetail/21981.html

图片描述
图片描述

图片描述
图片描述

linux网卡配置不对

http://coding.imooc.com/learn/questiondetail/21532.html

centos下载不下来

http://coding.imooc.com/learn/questiondetail/24353.html
阿里云的下载已经失效,请前往官网下载地址下载。
https://wiki.centos.org/Download
http://vault.centos.org/6.8/isos/x86_64/

idea中terminal无法识别git命令行命令解决办法

http://blog.csdn.net/matchlesshreo/article/details/77933662

老师为什么nginx登录可以显示欢迎登录但是去不了tomcat界面,这个问题赞下同学的韧性,进行了几个回合给同学清晰的解答了

http://coding.imooc.com/learn/questiondetail/22434.html

Artifact mmall:war: Server is not connected. Deploy is not available. tomcat访问404

http://coding.imooc.com/learn/questiondetail/23094.html

同学,你好
1.首先检查tomcat  webapps下面的目录,是否已经把项目发布到ROOT下
2.在pom.xml显示引入教程源码当中的servlet的包
3.在idea部署的时候,记得选择war的那个选项。
4.不部署项目,只启动tomcat,看看是否tomcat正常服务
5.通过以上进行排查,进一步的截图和日志请再发上来,让我们一起来解决。
不想部署到ROOT下,想部署到项目文件夹下。

http://coding.imooc.com/learn/questiondetail/24275.html

图片描述
图片描述
图片描述

POJO VO BO 模式中的BO是做什么用的,可以举个例子吗?

http://coding.imooc.com/learn/questiondetail/22871.html

部署404

http://coding.imooc.com/learn/questiondetail/23094.html

老师我在部署的时候只有war exploded没有war,我看了您的文档也没有解决

http://coding.imooc.com/learn/questiondetail/27251.html

泛型的疑问

http://coding.imooc.com/learn/questiondetail/27281.html

上传文件服务器失败的解决方案

http://coding.imooc.com/learn/questiondetail/28771.html

同学阿里云上的3个疑问,详细解答

http://coding.imooc.com/learn/questiondetail/22719.html

主图和子图

关于main_image和sub_images的问题
http://coding.imooc.com/learn/questiondetail/44676.html

git操作

http://coding.imooc.com/learn/questiondetail/45970.html

中文Encode

http://coding.imooc.com/learn/questiondetail/47560.html

经常有同学问tomcat8080端口和nginx80端口,我们的线上为何没有开放8080端口却能访问,这里分享一下

http://coding.imooc.com/learn/questiondetail/47548.html

大家一定要仔细看异常信息,锻炼自己捕捉关键异常,排查问题的能力。这里分享一个问答

http://coding.imooc.com/learn/questiondetail/47543.html

多表查询只能建vo么,能不能返回泛型?

http://coding.imooc.com/learn/questiondetail/48258.html

http://coding.imooc.com/learn/questiondetail/46673.html

分享一下有的学员对于前后端分离接口定义的一些疑问

mybatis-generator配置

http://coding.imooc.com/learn/questiondetail/47691.html
http://coding.imooc.com/learn/questiondetail/47381.html

quartz-spring schedule

http://coding.imooc.com/learn/questiondetail/47630.html

offer喜讯
offer_get

图片描述

海康offer_get

图片描述
图片描述
图片描述

小米offer_get

图片描述
图片描述
图片描述

offer_get

图片描述

alibaba_offer_get

图片描述

金山

图片描述
图片描述

test1
test2
点击查看更多内容
42人点赞

若觉得本文不错,就分享一下吧!

评论

作者其他优质文章

正在加载中
JAVA开发工程师
手记
粉丝
1.6万
获赞与收藏
3000

关注作者,订阅最新文章

阅读免费教程

感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦
今天注册有机会得

100积分直接送

付费专栏免费学

大额优惠券免费领

立即参与 放弃机会
意见反馈 帮助中心 APP下载
官方微信

举报

0/150
提交
取消