- 浏览: 83228 次
- 性别:
- 来自: 武汉
最新评论
文章列表
nginx502超时错误
- 博客分类:
- nginx
问题:一个复杂逻辑的请求,请求处理时间较长,做了session共享,session会丢失(报ngnix502 bad gateway) 问题。
解决:location节点增加相关参数
proxy_connect_timeout 300; #默认60秒
Linux Command: source
- 博客分类:
- linux
NAME
source - Evaluate a file or resource as a Tcl script
SYNOPSIS
source fileName
source -rsrc resourceName ?fileName?
source -rsrcid resourceId ?fileName?
DESCRIPTION
Shallow and retained sizes
YourKit Java Profiler is capable of measuring shallow and retained sizes of objects.
Shallow size of an object is the amount of memory allocated to store the object itself, not taking into account the referenced objects. Shallow size of a regular (non-array) object depend ...
spring mvc redirect
- 博客分类:
- 随手记
public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter implements BeanFactoryAware,
InitializingBean {
.....
protected final ModelAndView handleInternal(HttpServletRequest request,
HttpServletResponse response,
HandlerMethod handlerMethod) t ...
spring 多工程加载多属性集配置问题
- 博客分类:
- 随手记
<bean id="propertyConfigurerJdbc" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="order" value="1" />
<property name="ignoreUnresolvablePlaceholders" value="true&quo ...
struts2配置文件路径
- 博客分类:
- 随手记
请求时报以下异常:
com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No mapping found for dependency [type=com.opensymphony.xwork2.ObjectFactory, name='default'] in public void com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.setObjectFactory(com.opensymphony.xwork2.Ob ...
spring web配置
- 博客分类:
- 随手记
比较诡异的一个问题,最近将项目移植到maven上管理,打包后发布到服务器上竟然报业务类没有定义:
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'xxx' is defined
在移植之前一切正常,移植后只是将依赖交由maven来管理,配置文件什么的都没有内容上的变更。最后找出的原因很狗血。
将原来配置:
<context-param>
<param-name>contextConfigLocation</param-na ...
maven组合项目中,运行mvn clean,报以下错误:
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------[ERROR] BUILD FAILURE[INFO] ------------------------------------------------------------------------[INFO] Project 'xx' is duplicated in the reactor
...
之前通过qq管家优化了系统服务之后,VM怎么也连不上网络,后来把相关关闭的服务都开启,还是无法联网。无意中在VM的message log中看到这个日志:
The network bridge on device VMnet0 is temporarily down because the bridged Ethernet interface is down
在VMWARE的Virtual Network Editor发现VMnet0设置中Bridge to默认联接的是笔记本有线网卡,设为Automatic即可。(我以桥接方式联网)
原:hibernate延迟加载延伸的一个问题
- 博客分类:
- 随手记
hibernate配置延迟加载报:failed to lazily initialize a collection of role: com.ln.jtf.biz.dal.dao.pojos.Customer.cusaccounts, no session or session was closed。原因是web上get子表时session已经关闭。针对这个问题spring提供了解决方案,有两种方式:
一种是过滤器:OpenSessionInViewFilter,在web.xml文件中增加配置如下:
<filter>
<filter-name>hi ...
oracle:rank
- 博客分类:
- 随手记
Term: RANK
Definition:In Oracle PL/SQL, RANK function is a built in analytic function which is used to rank a record within a group of rows. Its return type is number and serves for both aggregate and analytic purpose in SQL.Example Syntax:Used as an Aggregate function:
RANK (expression) WITHIN ...
freemarker中文乱码
- 博客分类:
- 随手记
<!-- 设置 ViewResolver -->
<bean id="freemarkerConfiguration"
class="org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean">
<property name="templateLoaderPath"
value="file://${ln.jtf.template.templatePath}" />
& ...
$args, 请求中的参数;
$content_length, HTTP请求信息里的"Content-Length";
$content_type, 请求信息里的"Content-Type";
$document_root, 针对当前请求的根路径设置值;
$document_uri, 与$uri相同;
$host, 请求信息中的"Host",如果请求中没有Host行,则等于设置的服务器名;
$limit_rate, 对连接速率的限制;
$request_method, 请求的方法,比如"GET"、 ...
转自:http://blog.prosight.me/index.php/2012/02/889
Nginx是一个非常出色的静态资源web服务器。如果你嫌它还不够快,可以把放在磁盘中的文件,映射到内存中,减少高并发下的磁盘IO。
先做几个假设。nginx.conf中所配置站点的路径是/home/wwwroot/res,站点所对应文件原始存储路径:/opt/web/res
shell脚本非常简单,思路就是拷贝资源文件到内存中,然后在把网站的静态文件链接指向到内存中即可。具体如下:
#! /bin/bash
res_path="/opt/web/ ...