Change is constant...
joeblow · 共 37 篇文章
解决eclipse下运行junit测试抛出NoSuchMethodError异常的问题
异常如下: Caused by: java.lang.NoSuchMethodError: net.sf.ehcache.Cache.<init>(Ljava/lang/String;ILnet/sf/ehcache/store/MemoryStoreEvictionPolicy;ZLjava/lang/String;ZJJZJLnet/sf/ehcache/event/RegisteredEventListeners;Lnet/sf/ehcache/bootstrap/BootstrapCacheLoader;II)V at org.springframework.cache.ehcach…
JAVA图片验证码
import java.awt.Color; import java.awt.Font; import java.awt.Graphics2D; import java.awt.RenderingHints; import java.awt.image.BufferedImage; import java.util.Random; import org.apache.commons.lang3.StringUtils; /** * 图片验证码类 */ public class Captcha { private int width = 100; private int height = 30…
2013-01-10 10:41 · Java · 评论(1)
Thunderbird + lightning + ganttview 修改源代码个性化订制
以下修改都是针对ganttview的样式修改,由于UI提供的属性配置有限,所以干脆直接修改源代码,供有需要的同学参考。 lightning-1.8: 1. 去掉任务前面的图标 C:\Users***\AppData\Roaming\Thunderbird\Profiles\q6bxvxzw.default\extensions{e2fda1a4-762b-4020-b5ad-a41df1933103}\chrome\calendar\skin\calendar\common\calendar-views.css 第24行到32行 .calendar-item-image { -moz-ima…
2012-11-13 16:32 · 评论(0)
解决mvn install问题Failure to find ** was cached in the local repository
项目是eclipse+maven管理的多模块项目,有两个子模块,myproject-common和myproject-web。工程结构如下: myproject |__myproject-common | |__src... | |__pom.xml |__myproject-web | |__src... | |__pom.xml |__pom.xml 在myproject-web上点击右键,选择Run As -> Maven install 报错: Failed to execute goal on project myproject-web: Could not resolve dep…
2012-11-08 12:16 · Other · 评论(0)
解决subclipse报错:svn: Can't open file 'D:\project\Xxx.java.svn-base': 系统找不到指定的文件
环境为:XP, eclipse, subclipse。 我想把xxx.java重命名为Xxx.java后再提交到svn服务器上,由于xp上文件名大小写不敏感,因此采用如下操作: 先使用eclipse的重命名功能将xxx.java重命名为xxx1.java,再重命名为Xxx.java,但是使用subclipse提交的时候失败,报错如下: org.tigris.subversion.javahl.ClientException: Working copy text base is corrupt svn: Commit failed (details follow): svn: Checksum…
2012-10-17 10:55 · Eclipse · 评论(1)
DIV实现的BorderLayout布局
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html style="height:100%;border:0;"> <head> <title>DIV BorderLayout Test</title> </head> <style type="text/css"> .layout-north{height:10%;} .layout-middle{height:70%;background:yellow;} .layout-we…
2012-02-23 00:07 · AJAX · 评论(0)
HTML特殊字符
保留字符 ISO 8859-1字符 数学字符 希腊字符 其他字符 ref http://www.w3schools.com/tags/ref_entities.asp http://www.w3schools.com/tags/ref_symbols.asp
2011-04-24 20:44 · JEE · 评论(0)
List非线程安全的代码示例
public class TreadSafeTest { // Vector<Integer> data = new Vector<Integer>(); // List<Integer> data = new ArrayList<Integer>(1); { data.add(99); } public static void main(String[] args) throws Exception { new TreadSafeTest().test(); } public void test() throws Exception { new Thread() { int count =…
2010-12-23 21:50 · 评论(0)
一次郁闷的查错经历
今天想测试一下3.7版的POI(之前一直用的3.0版,蛮长时间了~) 有如下一段代码: public static HSSFCell getCellFromSheetByCell(HSSFSheet sheet, int row, int col) { HSSFRow r = getRowFromSheetByRow(sheet, row); return r.getCell(col, Row.CREATE_NULL_AS_BLANK); } 总是在调用getCell的时候报错: Exception in thread "main" java.lang.NoSuchMethodError: …
2010-12-16 16:53 · 评论(1)
apache2.2的modules下载(redhat5,linux64位平台,kernel版本2.6.18)
包含以下模块: mod_actions.so mod_alias.so mod_asis.so mod_auth_basic.so mod_auth_digest.so mod_authn_alias.so mod_authn_anon.so mod_authn_dbd.so mod_authn_dbm.so mod_authn_default.so mod_authn_file.so mod_authnz_ldap.so mod_authz_dbm.so mod_authz_default.so mod_authz_groupfile.so mod_authz_host.so mod_au…
2010-12-09 11:00 · 评论(0)
在控制台中显示Hibernate打印的SQL中的参数
默认情况下,hibernate的sql中都是以问号代表参数,并没有显示参数的真实值,但是也不是做不到,只需要两步配置就可以显示出参数的真实值了: 1.spring的配置文件中增加: <prop key="hibernate.show_sql">true</prop> 或者在hibernate的配置文件中增加: <property name="show_sql">true</property> 2.在log4j.properties中做如下配置: log4j.appender.STDOUT.Threshold=trace log4j.category.org.hibernate.SQL=tra…
2010-11-29 14:31 · JEE · 评论(1)
Java日期类型的解析
从字符串解析出JAVA日期类型java.util.Date是一件相当痛苦的事情,下面就列出了一些被大量使用了的格式,可谓大观: |标准/说明|示例| |valid RFC 822 (2-digit year)|Thu, 01 Jan 04 19:48:21 GMT| |valid RFC 822 (4-digit year)|Thu, 01 Jan 2004 19:48:21 GMT| |invalid RFC 822 (no time)|01 Jan 2004| |invalid RFC 822 (no seconds)|01 Jan 2004 00:00 GMT| |valid W3CD…
2010-11-10 23:51 · Java · 评论(0)
tomcat的一些设置
linux:tomcat/bin/catalina.sh JAVA_OPTS='-server -Xms512m -Xmx2048m' CATALINA_OPTS='-server -Xms512m -Xmx800m -XX:PermSize=128m' Windows:tomcat/bin/catalina.sh set "JAVA_OPTS=-server -Xms512m -Xmx512m -XX:PermSize=50M -XX:MaxNewSize=256m -XX:MaxPermSize=50m" tomcat/bin/startup.sh tomcat/bin/shutdown…
2010-09-14 17:05 · JEE · 评论(0)
JavaMail通过Exchange发送邮件
使用Exchange Server邮件服务器发送邮件的特殊之处在于用户名username必须添加所在域的前缀,比如要使用域domain中的用户demo@sample.com来发送邮件,那么登录名要改成domain\demo,而不是普通stmp服务器中的demo@sample.com。 下面贴出演示代码: import java.util.Date; import java.util.Properties; import javax.mail.BodyPart; import javax.mail.Message; import javax.mail.MessagingException; i…
2010-09-06 10:22 · Java · 评论(3)