参考了http://www.weste.net/2013/4-16/90468.html
解决:
use database_name
set names utf8;
2016年11月10日星期四
重新安装mysql后failed to start
rm -fr /var/lib/mysql/*
rm /var/lock/subsys/mysqld
killall mysqld
然后再重新service mysqld start,解决
rm /var/lock/subsys/mysqld
killall mysqld
然后再重新service mysqld start,解决
2016年11月9日星期三
配置Charles和Fiddle支持https
mac下配置Charles:参考http://www.jianshu.com/p/9822e3f28f0a
只需要手机上安装证书即可。
windows中配置fiddle:参考http://www.jianshu.com/p/54dd21c50f21
只需要手机上安装证书即可。
windows中配置fiddle:参考http://www.jianshu.com/p/54dd21c50f21
2016年11月3日星期四
eclipse中导入java web项目问题汇总
1、import javax.servlet.http错误
参考http://yl-fighting.iteye.com/blog/1409468
在这之前需要已经有安装tomcat,下载解压好tomcat后参考http://www.cnblogs.com/marineoxy/p/5084382.html
2、查看markers发现Target runtime Apache Tomcat 7.0 is not defined
我配置的是tomcat 8.0,修改了项目文件夹中.settings/org.eclipse.wst.common.project.facet.core.xml
3、Build path specifies execution environment JavaSE-1.7. There are no JREs installed in the workspace that are strictly compatible with this environment.
参考http://stackoverflow.com/questions/3138384/warning-build-path-specifies-execution-environment-j2se-1-4
4、Implementation of project facet jst.web.jstl could not be found. Functionality will be limited.
由于MyEclipse里的用到了jstl,导入到Eclipse里也带过来了,修改.settings/org.eclipse.wst.common.project.facet.core.xml,删除jst.web.jstl这行
5、运行时Context initialization failed
[ERROR] - org.springframework.web.context.ContextLoader -ContextLoader.java(307) -Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [/Users/chenxiaoyu/Documents/Toolkit/apache-tomcat-8.0.38/webapps/meathub_data/WEB-INF/classes/com/zhaorou/action/ProductController.class]; nested exception is java.lang.IllegalArgumentException
我导入的项目是用spring 3,但我用的是java 1.8,版本不兼容,要么升级为spring 4,要么降级为java 1.7
参考http://yl-fighting.iteye.com/blog/1409468
在这之前需要已经有安装tomcat,下载解压好tomcat后参考http://www.cnblogs.com/marineoxy/p/5084382.html
2、查看markers发现Target runtime Apache Tomcat 7.0 is not defined
我配置的是tomcat 8.0,修改了项目文件夹中.settings/org.eclipse.wst.common.project.facet.core.xml
3、Build path specifies execution environment JavaSE-1.7. There are no JREs installed in the workspace that are strictly compatible with this environment.
参考http://stackoverflow.com/questions/3138384/warning-build-path-specifies-execution-environment-j2se-1-4
4、Implementation of project facet jst.web.jstl could not be found. Functionality will be limited.
由于MyEclipse里的用到了jstl,导入到Eclipse里也带过来了,修改.settings/org.eclipse.wst.common.project.facet.core.xml,删除jst.web.jstl这行
5、运行时Context initialization failed
[ERROR] - org.springframework.web.context.ContextLoader -ContextLoader.java(307) -Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [/Users/chenxiaoyu/Documents/Toolkit/apache-tomcat-8.0.38/webapps/meathub_data/WEB-INF/classes/com/zhaorou/action/ProductController.class]; nested exception is java.lang.IllegalArgumentException
我导入的项目是用spring 3,但我用的是java 1.8,版本不兼容,要么升级为spring 4,要么降级为java 1.7
2016年10月26日星期三
maven 为测试环境、生产环境等不同环境打包
参考http://www.blogjava.net/fancydeepin/archive/2015/06/27/maven-p.html
在pom中添加:
<profiles>
<profile> <!-- 可以通过 -P ID 来激活 -->
<id>PROD</id> <!-- ID 标识符 -->
<properties>
<env>PROD</env> <!-- properties 定义 key-value, 这里 key 是 env, value 是 PROD -->
</properties>
<activation>
<activeByDefault>true</activeByDefault> <!-- 默认激活 -->
</activation>
</profile>
<profile> <!-- 可以通过 -P ID 来激活 -->
<id>TEST</id> <!-- ID 标识符 -->
<properties>
<env>TEST</env> <!-- properties 定义 key-value, 这里 key 是 env, value 是 TEST -->
</properties>
</profile>
</profiles>
编译时使用mvn install -P ID即可。
在pom中添加:
<profiles>
<profile> <!-- 可以通过 -P ID 来激活 -->
<id>PROD</id> <!-- ID 标识符 -->
<properties>
<env>PROD</env> <!-- properties 定义 key-value, 这里 key 是 env, value 是 PROD -->
</properties>
<activation>
<activeByDefault>true</activeByDefault> <!-- 默认激活 -->
</activation>
</profile>
<profile> <!-- 可以通过 -P ID 来激活 -->
<id>TEST</id> <!-- ID 标识符 -->
<properties>
<env>TEST</env> <!-- properties 定义 key-value, 这里 key 是 env, value 是 TEST -->
</properties>
</profile>
</profiles>
编译时使用mvn install -P ID即可。
2016年10月17日星期一
pom中引入本地jar包
将jar包放入工程目录下,增加dependency:
<dependency>
<groupId>xxx.xxx.xxx</groupId>
<artifactId>xxx</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/xxx.jar</systemPath>
</dependency>
<dependency>
<groupId>xxx.xxx.xxx</groupId>
<artifactId>xxx</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/xxx.jar</systemPath>
</dependency>
2016年10月14日星期五
订阅:
博文 (Atom)