zhushidan100的博客
zhushidan100 · 共 10 篇文章
RMI 调用异常
java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is: java.net.ConnectException: Connection refused 最近在做ehcache的分布式(RMI)缓存的时候发现这个异常,折腾了好一会儿 看官方解释: 写道 Essentially, this java call: InetAddress.getLocalHost();always returns the loopback address, which is 127.0.0.1. Why…
2013-08-15 16:25 · 评论(0)
Ehcache 过期参数说明
Ehcache 缓存过期时间的说明: timeToIdleSeconds="3" timeToLiveSeconds="5" timeToIdleSeconds指缓存元素空闲的时间,如果从最后一次访问这个元素到当前时间差超出这个值则此元素会失效 timeToLiveSeconds指缓存元素的生存时间,从创建到死亡的时间长度 当然上面的参数是在没有设置缓存永不过期的前提下有效;
2013-08-04 00:21 · 评论(0)
nginx 重写Response Header Content-Language
最近做SEO优化,要求返回正确的Content-Language; response.setHeader("Content-Language", "ja");//这个设置没用,这个值跟操作系统有关 于是在nginx重写这个值,简略配置如下; 环境 : http://localhost/french ; http://localhost/japanese ........等; location /{ proxy_hide_header 'Content-Language'; #隐藏掉之前的值 if ($request_uri ~* "/china"){ #根据不同的国家添加不同的值 add_h…
2013-08-03 16:53 · 评论(0)
mysql 用户权限管理
网上很多人的授权都有问题的,特别是因为对于IP那个地方没有用引号.....大部分人COPY的吧..特留此笔记 用root本地账户登录mysql,增加新用户 insert into mysql.user(Host,User,Password) values('%','admin','abc123');--增加admin的账户(密码abc123),此账户可以从任何IP访问,但不包括localhost(version:5.5.9),version:5.7.1 % 也包括localhost的访问 insert into mysql.user(Host,User,Password) values('l…
2013-06-06 09:08 · MySQL · 评论(0)
ehcache search
在用ehcache做搜索的时候,cache不能存放于非内存上(缓存初始化失败),至v 2.5.2,ehcache还没有实现非内存搜索,因此在做缓存的时候不能flush,此方法会将缓存写入硬盘,因此会使缓存丢失. CacheManager cachemanager = CacheManager.getInstance(); Cache cache = cachemanager.getCache("andCache"); Attribute<String> attribute = cache.getSearchAttribute("pilepoint_number"); Query query …
2012-07-05 11:47 · 评论(0)
Access 插入UTF-8数据
Properties prop = new Properties(); prop.setProperty("charSet", "GB2312"); conn = DriverManager.getConnection(url, prop); 应用是UTF-8的编码.
2012-04-16 15:43 · 评论(0)
HSQLDB
package com.hsqldb.dbfilter; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Properties; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; import org.hsqldb.Server; public class DBRunListener imp…
2011-09-14 09:41 · 评论(0)
Openssl + JDK keytool 证书制作
1.创建CA的私钥 **1.** 创建CA的私钥 执行以下命令opensslgenrsa -des3 -out mykey/ca.key 1024 ( mykey/ 当前目录下的mykey目录,事先要建立好) 接下来会提示你输入密码. **2.** 创建CA证书 (根证书) openssl req -new -x509 -key mykey/ca.key -out mykey/ca.crt -days 365 x509是一种加密的标准,-out是指输出的文件路径,-key是指定私钥,也就是上一步生成的那个,-days是指证书有效期。 注:再输入commonname时你可以指定你自己的名字,但…
2011-09-07 16:19 · 评论(0)
CXF SSL HTTPS
SSL:tomcat server.xml配置 <!-- SSL --> <Connector port="8443" maxHttpHeaderSize="8192" SSLEnabled="true" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" disableUploadTimeout="true" acceptCount="100" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" key…
2011-09-07 16:17 · 评论(0)
CXF WS-SECURITY协议对soap消息加密
<!-- 服务端代码: --> <jaxws:endpoint id="userWebService" implementor="#userServiceImpl" address="/userservice"> <jaxws:inInterceptors> <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"></bean> <bean class="org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor" /> <bean class="org.apache.cxf.ws…
2011-09-07 16:10 · 评论(4)