gary's blog
gary0416 · 共 74 篇文章
解决activiti生成的PNG乱码
使用的版本为activiti5.8 修改org.activiti.engine.impl.bpmn.diagram.ProcessDiagramCanvas的123行,由 Font font = new Font("Arial", Font.BOLD, 11); 改为一种中文字体 Font font = new Font(" 宋体", Font.BOLD, 11); 附件有我改好的java文件,直接扔到项目中即可,现有项目可以使用classes文件 PS:如果嫌更改麻烦,可使用ZIP方式部署,不会出现乱码
2012-02-01 11:26 · javaee · 评论(0)
文件夹备份工具
package com.gary.file; import java.io.File; import java.io.IOException; import org.apache.commons.io.FileUtils; /** * 文件夹备份 * @author gary * */ public class FileSync { //要备份的目录 static final String targetDir = "F:\\myTemp\\test\\target"; //备份到 static final String bakDir = "F:\\myTemp\\test\\bakdir";…
2011-12-29 13:53 · java综合 · 评论(0)
Spring+CXF开发WebService
准备工作: 下载spring,apache-cxf,soapUI 新建Web项目 接口 package com.gary.test.ws.service; import javax.jws.WebService; @WebService public interface GreetingService { public String greeting(String userName); } 实现 package com.gary.test.ws.service.impl; import java.util.Calendar; import javax.jws.WebService; impo…
2011-10-30 14:09 · spring · 评论(15)
apache+多tomcat集群配置过程记录
1.下载所需的文件 apache http://labs.renren.com/apache-mirror/httpd/binaries/win32/httpd-2.2.20-win32-x86-no_ssl.msi tomcat http://labs.renren.com/apache-mirror/tomcat/tomcat-6/v6.0.33/bin/apache-tomcat-6.0.33.zip connectors http://labs.renren.com/apache-mirror/tomcat/tomcat-connectors/jk/binaries/windows/…
2011-09-09 15:02 · server · 评论(0)
FastDFS的安装,配置与使用(java)
先引用一下FastDFS的介绍: FastDFS is an open source high performance distributed file system. It's major functions include: file storing, file syncing and file accessing (file uploading and file downloading), and it can resolve the high capacity and load balancing problem. FastDFS should meet the requiremen…
2011-08-14 15:40 · javaee · 评论(8)
tomcat启动报错Socket accept failed
tomcat启动时,报错如下: 2011-8-11 21:09:31 org.apache.tomcat.util.net.JIoEndpoint$Acceptor run 严重: Socket accept failed java.net.SocketException: select failed at java.net.PlainSocketImpl.socketAccept(Native Method) at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384) at java.net.ServerSocket.implA…
2011-08-11 21:11 · javaee · 评论(0)
按目录递归清理文件每行开头结尾的空白
package com.gary.util; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * 清理指定目录下,符合扩展名条件的文件,删除每行开头结尾的空白(空格,制表符,换页符…
2011-07-17 21:52 · java综合 · 评论(0)
修复jquery图片裁剪插件CropZoom的BUG
插件地址http://www.helloweba.com/view-blog-51.html BUG: 参数x,y设置后无效 修正方法: 源码154行和155行,原为 $($image).attr('x', 0); $($image).attr('y', 0); 这里写死了...所以参数传不进来,修改为 $($image).attr('x', $options.x); $($image).attr('y', $options.y); OK搞定
2011-07-15 12:41 · javascript · 评论(1)
xheditor文件上传java版
基于http://www.iteye.com/topic/692396 修正了项目路径自动获取,解决了在windows环境下的路径问题 package com.xheditor.servlet; import java.io.File; import java.io.IOException; import java.io.PrintWriter; import java.io.Serializable; import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashMap; import java…
2011-07-01 15:41 · javascript · 评论(4)
linux下安装memcache
1.下载 http://www.monkey.org/~provos/libevent-2.0.12-stable.tar.gz http://memcached.googlecode.com/files/memcached-1.4.5.tar.gz 2.安装 安装libevent tar xvf libevent-2.0.12-stable.tar.gz cd libevent-2.0.12-stable ./configure -prefix=/usr make make install 查看安装是否成功 ls -all /usr/lib | grep libevent 安装memcac…
2011-06-28 07:51 · server · 评论(0)
linux下安装tomcat
1.下载 http://labs.renren.com/apache-mirror/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.tar.gz 2.解压 tar -zxvf apache-tomcat-6.0.32.tar.gz 3.移动到安装目录,例如 cp -R apache-tomcat-6.0.32 /usr/local/tomcat 4.开防火墙 vi /etc/sysconfig/iptables 添加 -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dpo…
2011-06-26 18:04 · server · 评论(0)
linux下安装nginx
1.下载 nginx http://nginx.org/download/nginx-1.0.4.tar.gz Perl Compatible Regular Expressions(用来rewrite,否则会提示error: the HTTP rewrite module requires the PCRE library.) ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.12.tar.gz 2.解压缩 tar -zxvf pcre-8.12.tar.gz tar -zxvf nginx-1.0.4.tar.gz …
2011-06-26 17:42 · server · 评论(0)
linux下安装mysql
1.从 http://mysql.saudi.net.sa/Downloads/MySQL-5.1/MySQL-server-community-5.1.57-1.rhel5.i386.rpm 下载mysql server http://mysql.cs.pu.edu.tw/Downloads/MySQL-5.1/MySQL-client-community-5.1.57-1.rhel5.i386.rpm 下载mysql client 2.运行 rpm -ivh MySQL-server-community-5.1.57-1.rhel5.i386.rpm [root@localhost te…
2011-06-26 14:10 · server · 评论(0)
linux下安装jdk
1.从 http://download.oracle.com/auth/otn-pub/java/jdk/6u26-b03/jdk-6u26-linux-i586-rpm.bin?e=1309006712&h=b2c67cc1270074c03795ebb174231140 下载JDK 2.修改文件,添加执行的权限 chmod -x jdk-6u26-linux-i586-rpm.bin 3.运行 ./jdk-6u26-linux-i586-rpm.bin 可以看到解压信息 Unpacking... Checksumming... Extracting... UnZipSFX 5.50 of…
2011-06-26 10:16 · server · 评论(0)
org.apache.catalina.connector.RequestFacade cannot be cast to org.springframewor
spring mvc 上传时 org.apache.catalina.connector.RequestFacade cannot be cast to org.springframework.web.multipart.MultipartHttpServletRequest 解决方法 添加配置: <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"> <!-- set the max upload size100MB --> <prope…
2011-06-21 00:48 · spring · 评论(2)