我遇到的各种问题

此贴总结各种错误。总结的多了之后会加以分类。


1、解决Maven项目pom.xml文件报xxx\target\classes\META-INF\MANIFEST.MF (系统找不到指定的路径)问题:(只需简单地clean all projects)

http://www.cnblogs.com/zhfei/p/5286827.html

2、(1)Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean) on project taotao-manager-web: Failed to clean project: Failed to delete \target\tomcat\logs\access_log.2016-06-21 -> [Help 1]

(点击console右上角叉号然后再点击红色小方形terminate)

http://jingyan.baidu.com/article/b24f6c8238cea986bee5da78.html

(2)Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean) on project taotao-manager-web: Failed to clean project: Failed to delete \target\**.jar -> [Help 1]

一般是javaSE platform binary 占用。打开任务管理器,把javaSE platform binary进程结束掉就行。

3、解压时找不到归档的错误。

tar -zxvf /home/centos-lr/jdk-7u80-linux-x64.gz -C /usr/local/java/

4、class path resource [spring/] cannot be resolved to URL because it does not exist

右键项目---->properties--->Java Build Path--->source。可以看到classpath的目录。

5、eclipse中tomcat配置中重要的一步。遇到use tomcat installation 无法选中的时候这么做:

http://www.07net01.com/2015/03/769446.html

记住这里要有-C  (建立压缩档案)

6、Initializing Spring FrameworkServlet 'taotao-manager-web'一直卡着不动有很多原因。我的是因为在采用dubbo时,zookeeper运行后,没有关linux的防火墙。导致它一直卡着。

其实真正发现错误是从这句话得知没有关防火墙的:

Fail to start server(url: dubbo://*.*.*.*:20880/com.*.*....

7、锁定文件失败。打不开磁盘或它所依赖的某个快照磁盘。开启模块DiskEarly的操作失败

删除虚拟机目录下面三个.lck结尾的文件即可

8、SecureCRT的一些修改设置:

每屏显示的行数:http://www.cnblogs.com/wangyuelang0526/archive/2013/03/07/2948044.html

9、 Maven工程中的[找不到方法]错误

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2:compile (default-compile) on project taotao-manager-web: Compilation failure

[ERROR] /E:/CodeEclipse/taotao-manager-web/src/main/java/com/taotao/controller/ContentCateController.java:[43,57]找不到符号

[ERROR] 符号:   方法addNode(java.lang.Long,java.lang.String)

[ERROR] 位置:类型为com.taotao.content.service.ContentCateService的变量contentCateService

错误提示说是找不到com.taotao.content.service.ContentCateService类中的addNode()这个方法,所以,把com.taotao.content.service.ContentCateService这个interface类重新maven install一下就可以了

10、严重: StandardWrapper.Throwable
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'indexController': Injection of autowired dependencies failed; 
nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private int com.taotao.portal.controller.IndexController.AD1_HEIGHT_B; 
nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'AD1_HEIGHT_B' in string value "${AD1_HEIGHT_B}"

错误原因:在resource.properties文件里把AD1_HEIGHT_B=240写成了AD1_HEIGHT_b=240

所以平时一定要仔细。

11、org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'AuthMapper': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSession' defined in class path resource [com/lab/web/config/ApplicationContext.xml]: Cannot resolve reference to bean 'sqlSessionFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [com/lab/web/config/ApplicationContext.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [com/lab/web/mybatis/SqlMapConfig.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class . Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'com.lab.m.customer.vo.customer'.  Cause: java.lang.ClassNotFoundException: Cannot find class: com.lab.m.customer.vo.customer


解决:重新maven install一下。

12、util.NativeCodeLoader: Unable to load native-hadoop library for your platform
问题:hadoop安装完以后,经常会提示一下警告:
WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
原因:这是32位的hadoop,安装在了64位的linux系统上
解决办法:(转自:http://blog.chinaunix.net/uid-30373965-id-5156368.html)
    从下面地址下载相应版本的包 ( hadoop-native-64-2.7.0.tar  我的hadoop为2.7):
     http://dl.bintray.com/sequenceiq/sequenceiq-bin/
    下载完以后,解压到hadoop的native目录下,覆盖原有文件即可。操作如下:
     tar -xvf  hadoop-native-64-2.7.0.tar -C  /home/sky/hadoop/lib/native    (路径是native的全路径)
13、 org.apache.hadoop.yarn.exceptions.YarnException: Unauthorized request to start container

因为namenode和datanode上的时间不一致导致的,解决办法就是同步一下的Hadoop集群上的时间:

1)输入“cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime”
2)输入“ntpdate ntp.api.bz”
中国国家授时中心:210.72.145.44NTP服务器(上海) :ntp.api.bz美国:time.nist.gov复旦:ntp.fudan.edu.cn 
微软公司授时主机(美国) :time.windows.com台警大授时中心(台湾):asia.pool.ntp.org
如果显示 the NTP socket is in use,exiting。则:
1)service ntpd stop然后 2)ntpdate ntp.api.bz

14、  java.sql.SQLException : Access denied for user 'root'@'ncentos' (using password: YES)      SQL Error code: 1045

这种错误是mysql数据库中user表中的有些用户的密码不对。登录进去mysql之后,use mysql; 

然后select host, user,password,password_expired from user 看下密码。

然后再更新成新密码:update user set password=password('your new password') where user = 'root';

(上面那句不行的话就这样:update user set authentication_string=password('123456') where user='root' (and Host = 'localhost';))

然后flush privileges;然后再为了以防万一再验证下select host, user,password,password_expired from user 。(如果发现password_expired的值是Y记得修改为N)

windows下解决方案:

  1. 打开MySQL目录下的my.ini文件,在文件的最后添加一行“skip-grant-tables”,保存并关闭文件。(WIN7默认安装,my.ini在C:\ProgramData\MySQL\MySQL Server 5.6)
  2. 重启MySQL服务。
  3. 通过命令行进入MySQL的BIN目录,输入“mysql -u root -p”(不输入密码),回车即可进入数据库。(WIN7默认安装,BIN目录为:C:\Program Files\MySQL\MySQL Server 5.6\bin)
  4. 执行“use mysql;”,使用mysql数据库。
  5. 执行“update user set password=PASSWORD("123456") where user='root';”(修改root的密码)
  6. 打开MySQL目录下的my.ini文件,删除最后一行的“skip-grant-tables”,保存并关闭文件。
  7. 重启MySQL服务。
  8. 在命令行中输入“mysql -u root -p 123456”,即可成功连接数据库
附:mysql突然连不上,可能是mysql服务没开启。去[管理]—>[服务]那里开启就行。
或者进入mysql的bin目录。然后mysqld --install 。记得要用管理员权限打开cmd,要不然会报错: install/remove denied
然后再net start mysql。

15、Exiting, name server cannot be used: Temporary failure in name resolution (-3)23 Nov 17:40:16 ntp
sed: Temporary failure in name resolution (-3)

原因是没有设置dns服务器的地址。可以 cat /etc/resolve.conf 立马是否有dns的地址。没有的话就加上。echo '"8.8.8.8" > /etc/resolve.conf

16、在运行 hdfs dfs -ls hdfs:// IP(host):50070/ 的时候报错:Operation category READ is not supported in state standby:

错误原因是:在hadoop2.0中通常由两个NameNode组成,一个处于active状态,另一个处于standby状态。Active NameNode对外提供服务,而Standby NameNode则不对外提供服务,仅同步active namenode的状态,以便能够在它失败时快速进行切换。

所以在查看hdfs中的文件目录时,要写active节点的ip(主机名)而不是standby节点的。

17、scalac error: …\target\classes does not exist or is not a directory

错误原因:项目路径中含有中文。

为了避免类似错误,以后无论什么程序,都不要创建含有中文的路径。

18、src refspec does not match any. failed to push some refs
git push origin [localRepoName]:[remoteRepoName]
注:两个仓库之间一定不能有空格。只能是冒号


转自:https://blog.csdn.net/code_lr/article/details/51728624



猜你喜欢

转载自blog.csdn.net/chuyouyinghe/article/details/80747316