windows查看ip ipconfig
linux查看ip ifconfig
ping 目标ip地址:查看与对方电脑是否相通
固定ip地址:
1.找到文件:/etc/sysconfig/network-scripts/ifcfg-ens33并打开:
部分参数意义
BOOTPROTO="dhcp" 网络配置参数 dhcp动态 ip static 静态ip none 无
UUID="bcfce90f-d68d-43d2-a82d-1a06bea42ebc" 随机id
DEVICE="ens33" 接口名
onBOOT="yes" 系统启动时网络接口是否有效
2.修改/添加相关配置
将BOOTPROTO改为static
添加IPADDR= 指定的ip地址
GATEWAY =网关
DNS1 = 域名解析器
域名解析器不要与母机设置相同,否则会失效
3.reboot使设置生效。
设置主机名: 修改/etc/hostname文件
设置主机名与映射:
window:CWindowsSystem32driversetchosts
Linux:etc/hosts
浏览器解析域名的过程:1.检查浏览器缓存,若存在则解析
2.检查DNS解析器缓存,若存在则解析
3.检查本地hosts文件,若存在则解析
4.查询本地DNS服务器,若存在则解析
5.都没有查询到,则域名解析失败
2.报错总结这两天整合ssm报了不少错误,现在想来确实是基本功不扎实的缘故。有些问题也确实头疼的好久,故记录一下。
1.依赖版本冲突
这两天遇到的好多错误的根源,之前添加依赖总是一股脑的乱加。maven会把依赖关系的包自动添加上,我总是乱加:比如导入了spring-webmvc的依赖,仍导入了spring-bean等Ioc核心的依赖。导入了也就算了,版本还不对应,这是好多错误的根源!!!
2. Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: Access denied for user '86156'@'localhost' (using password: YES)
这个错误是由于解析username时把root解析为了主机名,只需把jdbc配置文件中的username改为jdbc.username即可。
3. Error creating bean with name 'sessionFactory' defined in class path resource [Spring/application.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.core.io.Resource[]' for property 'mapperLocations'; nested exception is java.lang.IllegalArgumentException: Could not resolve resource location pattern [Mapper/*Mapper.xml]: ServletContext resource [/Mapper/] cannot be resolved to URL because it does not exist
这个错误是说找不到*Mapper.xml文件
解决方案:在xml文件前加上classpath:(只在启动tomcat服务器时遇到了这个问题,在测试类中未遇到)。



