2006/08/09
2006/08/08
2006/06/30
The Five Variables of Project Management
Update: Picked up on a thread on TheServerSide, so there may be some more discussion over there.
In my experience (and more so that of my more experienced colleagues) there are five variables over which you can exert control to decide when – and with what functionality – you can deliver your software.
In simple terms, if you deliver less functionality, it will take you less time. The problem is that often the decision as to what not to deliver happens during the development process itself. This means that prioritisation of functionality from the outset is important. if half way through you need to cut scope, but the only stuff you have left is the stuff your users simply must have, and you spent the last three months delivering things they’d only like to have, your options are limited. Priorities can change, but core functionality tends not too – concentrate on delivering that and you’ll make it easier for yourself in the long run.
Typically the thing over which technical people have the least control (anecdotally it seems as though the go-live date for software is defined more by sales and marketing than by need), but you can decide to deliver later to get what you want.
Adding more people to a project can make it faster – to a point. However in software adding people very rarely tends to result in a linear increase in productivity. Hiring the right people can be more efficient, but is far from easy.
Some organisations take the ‘lots of dumb people being told what to do by one or two smart people’ route, others the ‘a few smart people all knowing what to do’. I’m sure most of us (myself included) believe we hope for the later. I’ve certainly seen examples in the consultancy world where an organisation with a lower charge rate but lots of people ends up costing much more deliver than a small number of people with higher charge rates.
Reworking one’s process in order to be more efficient is an obvious thing to do, but hard to achieve. Depending on the flexibility of your organisation changing your process might not be easy, even if you know what it is to change. Changes mid-project – for example in order to deliver faster – tend to be limited, small changes. Retrospecitves can be a good tool for identifying what the team thinks is required, but don’t discount seeking outside help – someone from another team might have a different take on things.
A far more common type of process change occurs when people make what is often claimed to be short-term sacrifices in terms of software quality to deliver on time. Changes could involve writing less developer tests, spending less time performing manual tests, stop pairing, or spend less time ensuring consistent technical vision. When these changes really are short-term, and time is set aside afterwards to repair the damage done, this may be a viable technique. However those organisations which tend to drop quality in order to deliver faster tend to use this technique more than any other, and frequently never spend time playing catch up – leading to a team spending most of their time running from one disaster to another.
Risk Management is something I’m personally becoming aware of. Making sure you have situations in which potential risks can be raised is important (a daily stand-up might be one). Periodically risks should be assessed, in terms of how likely they are to occur, and also in terms of how much damage they can create.
Some risks can be mitigated, some eliminated entirely, and others cannot be addressed by you. In any case once prioritised in terms of likelihood and potential damage, they can be mitigated or communicated to your business sponsor accordingly.
Ten things programmers might want to know about marketers
The ten things are:
- Marketing is not rational. Programming is. Works the same way every time. Marketing doesn't, almost in a Heisenbergian way. If it worked before, it probably won't work again.
- Marketing is even more difficult to schedule than bug fixes. Marketing expenses are easily timed, of course, but the results are not. That's because there's a human at each end of the equation.
- Most marketers have no clue whatsoever what to do. So we do unoriginal things, or stall, or make promises we can't keep.
- Just because Sergey is both a brilliant programmer and a brilliant marketer doesn't mean that all brilliant programmers are good at marketing.
- People often prefer things that are inelegant, arcane or even broken. Except when they don't.
- Truly brilliant coding is hard to quantify, demand or predict. Same is true with marketing.
- There is no number seven.
- Unlike mediocre programmers, mediocre marketers occasionally get lucky. When they do, they end up with a success they can brag about for a generation. But that doesn't mean they know how to do it again.
- Just because some marketers are dorks doesn't mean your marketer is a dork. Some programmers aren't so great either. Be patient.
- Without marketing, all your great coding is worthless. Push your marketer to be brave and bold and remarkable. Do it every day. Your code is worth it.
2006/05/23
[Problem] Cannot Start OracleOraHome92Agent
As we wanna start OracleOraHome92Agent service, it always cannot be initialized normally.
Root Cause
It's service internal error or windows internal
Solution
delete the *.q files which locate at %oracle_home%\network\agent
2006/05/05
SP2-0678: 資料欄或屬性類型無法經由 SQL*Plus 顯示
SP2-0678: 資料欄或屬性類型無法經由 SQL*Plus 顯示
The sql statement is select * from projec2;
Owing to the column in this table include BLOB data, sqlplus cannot show the BLOB data so it will return this kind of error message.
2006/04/12
2006/04/10
log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.ConvertUtils)
log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.ConvertUtils).
log4j:WARN Please initialize the log4j system properly.
No worries, its just a message from one of the libraries (Hibernate maybe) that you are using letting you know that Commons Logging will not use Log4J because it couldn't find aconfig file for it, so it will just log to the console or use the JDK's logger found in JDK 1.4+
If you do include a log4j config file in your classpath, Hibernate can optionally spit out more logging messages than any human may want, for example, if you are debugging complex code.
reference
2006/04/04
Dina Programming Font
I made this font after having tried all the free programming fonts I could find. Somehow there was some detail in each of them that meant I couldn't work with them in the long run.
http://www.donationcoder.com/Software/Jibz/Dina/
2006/03/28
Simplify XML processing with VTD-XML
As the enabling technology for next-generation Web-based applications, XML is both easy and straightforward to learn and use. Unfortunately, the same thing cannot be said about the current state of XML processing: the Document Object Model and the Simple API for XML are both too slow, inefficient, and difficult to use. Providing a broadly useful and advanced option that goes beyond DOM and SAX, VTD-XML is the next-generation XML processing model that simplifies both XML programming and selection of an XML processing model. By highlighting some of the key technical strengths of VTD-XML using the latest performance benchmark numbers and code examples, this article demonstrates that VTD-XML has the potential to finally take the "monkey" off the back of enterprise architects constantly struggling with the decision of whether to use DOM or SAX.
http://www.javaworld.com/javaworld/jw-03-2006/jw-0327-simplify.html
2006/03/24
Log4j example
the core of log4j is log4j.properties, we can do some configuration in this property files, including log message format, output file name, appender
setting and so on.
1. com.ptc.demo.log4j.module1.Module1Test: write log information to console
2. com.ptc.demo.log4j.module2.Module2Test: write log information to log files and rotate the log file by day
3. com.ptc.demo.log4j.module3.Module3Test: write log information to log files and rotate the log file by file size
4. com.ptc.demo.log4j.module4.Module4Test: write log information to log file (in HTML format)
---------------------
output message
---------------------
2006-03-24 13:50:03,015 DEBUG com.ptc.demo.log4j.module1.Module1Test.sortByAsc(Module1Test.java:26) - [ant, cat, dog, dophin, tiger, zebra]
2006-03-24 13:50:03,015 DEBUG com.ptc.demo.log4j.module1.Module1Test.sortByDesc(Module1Test.java:41) - [zebra, tiger, dophin, dog, cat, ant]
log4j.properties
=========================================================================
#module1 -- output to console
log4j.category.com.ptc.demo.log4j.module1=DEBUG,module1
log4j.appender.module1=org.apache.log4j.ConsoleAppender
log4j.appender.module1.layout=org.apache.log4j.PatternLayout
log4j.appender.module1.layout.ConversionPattern=%d %5p %l - %m%n
#module2 -- output to log and rotate by day
log4j.category.com.ptc.demo.log4j.module2=DEBUG,module2
log4j.appender.module2=org.apache.log4j.DailyRollingFileAppender
log4j.appender.module2.threshold=debug
log4j.appender.module2.File=C:\module2.log
log4j.appender.module2.DatePattern='.'yyyyMMdd
log4j.appender.module2.Append=true
log4j.appender.module2.layout=org.apache.log4j.PatternLayout
log4j.appender.module2.layout.ConversionPattern=%d %5p %l - %m%n
#module3 -- output to log and rotate by file size
log4j.category.com.ptc.demo.log4j.module3=DEBUG,module3
log4j.appender.module3=org.apache.log4j.RollingFileAppender
log4j.appender.module3.threshold=debug
log4j.appender.module3.File=C:\module3.log
#rotate size = 500 KB
log4j.appender.module3.MaxFileSize=500KB
#keep three backup files
log4j.appender.module3.MaxBackupIndex=3
log4j.appender.module3.layout=org.apache.log4j.PatternLayout
log4j.appender.module3.layout.ConversionPattern=%d %5p %l - %m%n
#module4 -- output to log and by HTML format
log4j.category.com.ptc.demo.log4j.module4=DEBUG,module4
log4j.appender.module4=org.apache.log4j.FileAppender
log4j.appender.module4.File=C:\module4.html
log4j.appender.module4.Append=true
log4j.appender.module4.layout=org.apache.log4j.HTMLLayout
=========================================================================
class file (each class file has the same content and only has different class name)
=========================================================================
package com.ptc.demo.log4j.module1;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.Collections;
import org.apache.log4j.Logger;
/**
*
* @author Albert
*
*/
public class Module1Test {
private static Logger logger = Logger.getLogger(Module1Test.class.getName());
/**
* sorting by ascending
* @param str
*/
public void sortByAsc(String str[]){
List list = Arrays.asList(str);
Collections.sort(list);
logger.debug(list);
}
/**
* sorting by descending
* @param str
*/
public void sortByDesc(String str[]){
List list = Arrays.asList(str);
Collections.sort(list, new Comparator(){
public int compare(Object obj1, Object obj2){
return ((String)obj2).compareTo((String)obj1);
}
}
);
logger.debug(list);
}
/**
* @param args
*/
public static void main(String[] args) {
Module1Test module1Test = new Module1Test();
String str[] = new String[]{"dog","ant","zebra","cat","tiger","dophin"};
module1Test.sortByAsc(str);
module1Test.sortByDesc(str);
}
}
=========================================================================
2006/03/23
Exception Handling
1. If you can’t handle an exception, don’t catch it.
2. If you catch an exception, don’t swallow it.
3. Catch an exception as close as possible to its source.
4. Log an exception where you catch it, unless you plan to rethrow it.
5. Structure your methods according to how fine-grained your exception handling must be.
6. Use as many typed exceptions as you need, particularly for application exceptions.
"Best Practices in EJB Exception Handling"
http://www-106.ibm.com/developerworks/java/library/j-ejbexcept.html
"Best Practices for Exception Handling"
http://www.onjava.com/pub/a/onjava/2003/11/19/exceptions.html
"Designing with Exceptions"
http://www.javaworld.com/jw-07-1998/jw-07-techniques.html
"Exceptions in Java"
http://www.javaworld.com/jw-07-1998/jw-07-exceptions.html
"Exceptional Practices, Part 1"
http://www.javaworld.com/javaworld/jw-08-2001/jw-0803-exceptions.html
"Exceptional Practices, Part 2"
http://www.javaworld.com/javaworld/jw-09-2001/jw-0914-exceptions.html
"When catching exceptions, don't cast your net too wide"
http://www.javaworld.com/javaworld/javatips/jw-javatip134.html
"Use nested exceptions"
http://www.javaworld.com/javaworld/javatips/jw-javatip91.html
"Beware the dangers of generic exceptions"
http://www.javaworld.com/javaworld/jw-10-2003/jw-1003-generics.html
[Info] Abator: code generator for iBATIS
http://ibatis.apache.org/abator.html
2006/03/14
Plug memory leaks in enterprise Java applications
Summary
Because Java uses automatic garbage collection, developers think Java programs are free from possible memory leaks. Although automatic garbage collection solves the main cause of memory leaks, they can remain in a Java program. Specifically, such memory leaks in complex multitiered applications can be extremely daunting to detect and plug. This article analyzes the main causes of memory leaks in Java Enterprise Edition (Java EE) applications, and suggests strategies for detecting them. (3,200 words; March 13, 2006)
By Ambily Pankajakshan
http://www.javaworld.com/javaworld/jw-03-2006/jw-0313-leak.html
2006/02/03
2006/01/13
[Troubleshooting] The deployment framework was unable to register with the Data Replication Service
Deployer:149204]The deployment framework was unable to register with the Data Replication Service.
Resolution
確認一下,在/etc/hosts裡頭是否有127.0.0.1 localhost
若無,請加上127.0.0.1 localhost
並且需重開機才能生效
2005/12/28
[Troubleshooting] MailSendException: Could not send mails: 501 illegal character(s) in domain string
As I wrote a Java code, and used JavaMail to send email. But it threw this kind of exception message:
org.springframework.mail.MailSendException: Could not send mails: 501
[Solution]
Because the computer's host name is Big5, so it will throw this kind of exception. This problem had been resolved, as I change my host name to English, and restart my computer.
2005/12/22
[Info] MaxPermSize and how it relates to the overall heap
Many people have asked if the MaxPermSize value is a part of the overall -Xmx heap setting or additional to it. There is a GC document on the Sun website which is causing some confusion due to a somewhat vague explanation and an errant diagram. The more I look at this document, the more I think the original author has made a subtle mistake in describing -Xmx as it relates to the PermSize and MaxPermSize.
First, a quick definition of the "permanent generation".
"The permanent generation is used to hold reflective data of the VM itself such as class objects and method objects. These reflective objects are allocated directly into the permanent generation, and it is sized independently from the other generations." [ref]
Yes, PermSize is additional to the -Xmx value set by the user on the JVM options. But MaxPermSize allows for the JVM to be able to grow the PermSize to the amount specified. Initially when the VM is loaded, the MaxPermSize will still be the default value (32mb for -client and 64mb for -server) but will not actually take up that amount until it is needed. On the other hand, if you were to set BOTH PermSize and MaxPermSize to 256mb, you would notice that the overall heap has increased by 256mb additional to the -Xmx setting.
So for example, if you set your -Xmx to 256m and your -MaxPermSize to 256m, you could check with the Solaris 'pmap' command how much memory the resulting process is taking up.
i.e.,
$ uname -a
SunOS devnull 5.8 Generic_108528-27 sun4u sparc
SUNW,UltraSPARC-IIi-cEngine
$ java -version
java version "1.3.1_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_02-b02)
Java HotSpot(TM) Client VM (build 1.3.1_02-b02, mixed mode)
---------------------------------------------
$ java -Xms256m -Xmx256m -XX:MaxPermSize=256m Hello &
$ pmap 6432
6432: /usr/java1.3.1/bin/../bin/sparc/native_threads/java -Xms256m -Xmx256m
total 288416K
---------------------------------------------
Notice above that the overall heap is not 256m+256m yet? Why? We did not specify PermSize yet, only MaxPermSize.
---------------------------------------------
$ java -Xms256m -Xmx256m -XX:PermSize=256m -XX:MaxPermSize=256m Hello &
$ pmap 6472
6472: /usr/java1.3.1/bin/../bin/sparc/native_threads/java -Xms256m -Xmx256m
total 550544K
---------------------------------------------
Now we see the overall heap grow, -Xmx+PermSize. This shows conclusive proof that PermSize and MaxPermSize are additional to the -Xmx setting.
Link
2005/12/13
[Troubleshooting] Managed Server cannot boot after password of admin user has been changed from admin console
If you change the password of the admin user from the admin console without running managed servers, the managed servers cannnot boot because of an authentication error of the admin user.
Resolution:
Security data e.g., password) is stored in the Embedded LDAP by default and it is replicated from the admin server to the managed servers. If there is an inconsistency of the security data between the admin and managed servers, the error will occur.
In order to refresh all replicated data at boot time, you need to set 'Refresh Replica At Startup' from the Admin Console. You can set this property by following the following steps in the Admin console:
Domain --> Security --> Embedded LDAP Server.
2005/12/04
[Info] Spring PropertyPlaceholderConfigurer
Do I use some constants? What about a config file (XML, properties, etc)?
Sometimes it isn't easy to know what to do, and you sometimes end up with duplicate information.
For example, what if you want to share database information between your code, your ant build, and anything else?
With Spring, you can use their really nice PropertyPlaceholderConfigurer, and easily share a properties file. You can simply share one properties file for all of your build info as well as Spring sharing, or you can of course seperate things out, and have multiple
So, the steps for sharing the data:......
http://www.almaer.com/blog/archives/000449.html
2005/11/29
[novelty] lipstick indicator & Lipstick Theory
An indicator based on the theory that a consumer turns to less-expensive indulgences, such as lipstick, when she (or he) feels less than confident about the future. Therefore, lipstick sales tend to increase during times of economic uncertainty or a recession.
Lipstick Theory
This theory is also applied in medical industry.
"The Lipstick Theory: When a woman who is battling cancer starts to put on lipstick, she is on the road to recovery."
- William Cahan, M.D., Memorial Sloan Kettering Cancer Center
2005/11/23
Is Ajax gonna kill the web frameworks?
However if the world really does go Ajax or some kinda client technology very Ajax like - will that cause these traditional HTML/HTTP web frameworks to become legacy?
Web frameworks spend most of their time doing things like, dealing with HTTP and HTML, maintaining client side state on the server - handing intermediate form submissions & validation, templating/rendering issues and binding business objects to HTML form controls etc.
These days Ajax has template engines, XPath/XSLT engines, SOAP stacks, XForms implementations and so forth all done on the client side. You can do clever things like hide the JavaScript from your HTML page and use CSS to bind the JavaScript to the markup.
There's even a JavaScript version of Ruby on Rails that runs in the browser! :)
So is the web application of the future going to be static HTML & JavaScript, served up by Apache with Ajax interacting with a bunch of XML based web services (maybe using SOAP, maybe just REST etc)? If so, do we really need a web framework thats focussed on HTTP and HTML, or are we just gonna end up developing a bunch of XML based web services and letting Ajax do all the templating, editing and viewing?
Is this the end of web frameworks as we know it?
http://radio.weblogs.com/0112098/2005/11/16.html
2005/11/12
[Info] Linux 常用指令
rm -rf
解開tar檔到特定folder下
tar xvf project.tar -C
看目前的process
ps -ef
重開機
init 6
檢視Log
tail -f
解開gz檔
tar -zxvf jrockit-70sp5-j2se131-linux32.tar.gz
[Troubleshooting] java.lang.SecurityException: Unable to locate a login configuration
RedHet Enterprise Linux 2.1
WLS 6.1
Service Pack 7
JRocket 1.4
Problem
As I would like to startup weblogic, it will show this kind of error message
java.lang.SecurityException: Unable to locate a login configuration
at com.ibm.security.auth.login.ConfigFile.getAppConfigurationEntry(ConfigFile.java:221)
at javax.security.auth.login.LoginContext.init(LoginContext.java:171)
at javax.security.auth.login.LoginContext.(LoginContext.java:318)
at weblogic.security.internal.ServerAuthenticate.main(ServerAuthenticate.java:81)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:200)
at weblogic.Server.main(Server.java:35)
Solution
You can check this file http://www.genuitec.com/products/JDK14_WLS61.pdf
Owing to the certified JDK version in WLS 6.1 is 1.3, the JDK version is 1.4
2005/11/11
[Info] WebLogic Server End-of-Life Calendar
WebLogic Server End-of-Life Calendar
If it was retired, BEA do not provide technical support any more.
[Info] Hardware Capacity Management How-To
Before continuing with this section, you may want to review the Standard Performance Evaluation Corporation which provides a set of standardized benchmarks and metrics for evaluating computer system performance.
2005/11/07
[Troubleshooting] Apache HTTP Server cannot start
有些時候,可能因為改了某些設定,如修改httpd.conf之後無法正常啟動
[Solution]
此時你可以執行Test Configuration來看錯誤訊息
開始→程式集→Apache HTTP Server→Configure Apache Server→Test Configuration
2005/11/03
2005/11/01
[Info] Two Approaches to Open New Window
這裡有一個link: from JavaWorld
除此之外, 用icon, 與用File/New/Window, 後者可能會有一些問題, 可參考此link:experts-exchange
2005/10/31
[Troubleshooting] SQLException: IO 異常: The Network Adapter could not establish the connection
SQLException: IO 異常: The Network Adapter could not establish the connection
成因
1. 資料庫沒有開啟, 所以無法連接上
2. 因為防火牆的原因, 該台連不上DBMS Server, 可先ping看看可否ping的到, ex. ping xxx.xxx.xxx.xxx 1521
2005/10/30
[Troubleshooting] 530 Sorry, no ANONYMOUS access allowed
用Server-U架起一個FTP Server,建立username=ftp, password=ftptest
此時用其他的ftp連線工具連線的時候,會出現此錯誤訊息: 530 Sorry, no ANONYMOUS access allowed
原因
因為ftp是保留字,不可以將其當成username,要將username改成其他名字即可
2005/10/28
[Info] JavaMail
Here has a reference link:
Sending Email with Spring mail abstraction layer
Here has sample code which write by me:
package albert.guo.util;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import javax.mail.MessagingException;
import javax.mail.internet.MimeMessage;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSenderImpl;
import org.springframework.mail.javamail.MimeMessageHelper;
/**
*
* @author Albert
*
*/
public class MailUtil {
private String addr[];
private String subject;
private String text;
private String host;
private String filepath;
private String filename;
private ArrayList fileList;
public MailUtil(String iAddr[], String iSubject, String iText, String iHost){
this.addr = iAddr;
this.subject = iSubject;
this.text = iText;
this.host = iHost;
}
public MailUtil(String iAddr[], String iSubject, String iText, String iHost,
ArrayList iFileList){
this.addr = iAddr;
this.subject = iSubject;
this.text = iText;
this.host = iHost;
this.fileList = iFileList;
}
/*
* 發送mail(不含附加檔案)
*/
public void sendMsg(){
SimpleMailMessage msg = new SimpleMailMessage();
msg.setTo(this.addr);
msg.setSubject(this.subject);
msg.setText(this.text);
JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
mailSender.setHost(this.host);
mailSender.send(msg);
}
/*
* 發送mail(含附加檔案)
*/
public void sendMsgAndAttachment(){
JavaMailSenderImpl sender = new JavaMailSenderImpl();
sender.setHost(this.host);
MimeMessage message = sender.createMimeMessage();
try {
//use the true flag to indicate you need a multipart message
MimeMessageHelper helper = new MimeMessageHelper(message, true);
helper.setTo(this.addr);
helper.setSubject(this.subject);
helper.setText(this.text);
for(int i=0; i<this.fileList.size(); i++){
HashMap attachment = (HashMap)fileList.get(i);
String filepath = (String)attachment.get("filepath");
String filename = (String)attachment.get("filename");
helper.addAttachment(filename, new File(filepath+filename));
}
sender.send(message);
} catch (MessagingException e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
String addr[] = new String [] {"albertg@systex.com.tw"};
//MailUtil mailUtil = new MailUtil(addr, "標題", "內容\n啦啦啦", "mail.systex.com.tw");
//mailUtil.sendMsg();
ArrayList list = new ArrayList();
HashMap hm1 = new HashMap();
hm1.put("filepath", "C:/");
hm1.put("filename","test.doc");
HashMap hm2 = new HashMap();
hm2.put("filepath", "C:/");
hm2.put("filename", "LiveABC.Log");
list.add(hm1);
list.add(hm2);
MailUtil mailUtil = new MailUtil(addr, "標題", "內容\n啦啦啦", "mail.systex.com.tw",
list);
mailUtil.sendMsgAndAttachment();
}
}
2005/10/24
2005/10/20
[Troubleshoot] JDBC Connection Leak
在JSP中設定ErrorPage時,發生跳轉,來不及關閉連線
程式的錯誤處理非在finally區塊關閉連線
緩解方式
設定InactiveConnectionTimeoutSeconds時間
最終一定要修復程式中的問題
2005/10/07
[Info] 如何在IE中直接打開WORD等文件
如何在一个WEB APPLICATION中打開WORD,EXCEL等類型的文件?
ans.
為了讓能在IE流覽器中自動打開的設置:需要在WEB.XML中進行如下的設置:在WEB.XML中添加<mime-mapping>,其中:
<extension>:
文件的副檔名
<mime-type>:
除了該類型檔的可執行檔,同WINDOW註冊表中的
/HKEY_CLASSES_ROOT下該類檔的Content
Type 的值一樣.
如能在IE中自動打開DOC,XLS,PDF檔的配置如下:
<?xml version="1.0" ?>
<!DOCTYPE web-app PUBLIC "-//Sun
Microsystems, Inc.//DTD Web Application 1.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<mime-mapping>
<extension>doc</extension>
<mime-type>application/msword</mime-type>
</mime-mapping>
<mime-mapping>
<extension>xls</extension>
<mime-type>application/msexcel</mime-type>
</mime-mapping>
<mime-mapping>
<extension>pdf</extension>
<mime-type>application/pdf</mime-type>
</mime-mapping>
</web-app>
2005/09/28
[Troubleshooting] Too many open files
<2005/9/27 上午09時32分13秒 GMT+08:00> <Critical> <WebLogicServer> <BEA-000204>
<Failed to listen on port 7001, failure count: 2,204, failing for 31,398
seconds, java.net.SocketException: Too many open files>
A.
大致上來說,這個問題有可能導因於OS的設定、應用程式在處理IO的時候,沒有正確關閉stream,以致於這些讀取檔案系統的stream一直處於開啟的狀態,最後就把系統所允許的file數給耗盡了。另外,如果在應用程式中開啟了一些socket,沒有正確關閉,也會發生相同的狀況 。這些關閉IO、socket的指令,一定要放在finally的區塊裡面,以確保即使發生exception,還是會被執行到。
We may increase the rlimit for a process by increasing the rlim_fd_max value (e.g. set rlim_fd_max = 4096) on /etc/system and enlarge the default open file number with ulimit -n 4096.
However, if we still find the open file limit for the java process that hosts WebLogic Server cannot excceed 1024,
please edit '${WL_HOME}/common/bin/commEnv.sh'.
COMMENT OUT the last line and add an ulimit statement (e.g. ulimit -n 8192)in the startup scripts.//resetFd
[Troubleshooting] Cannot Find WebappContextListener
Ans.此成因在於工程師可能採用workshop IDE tool來進行ap的開發,然後要部署到basic weblogic server此template,所以會有找不到此class的情形
此時,你只要把web.xml裡頭的此段拿掉即可,此為Workshop IDE Tool自行加上的
<listener>
<listener-class>
com.bea.wlw.runtime.core.servlet.WebappContextListener
</listener-class>
</listener>
2005/09/23
[Info] JDK vs. J2SDK
JDK 1.0 版於 1996 年初release,JDK 1.1 版於 1997 年初release,JDK 1.2 版於 1998 年底release。基於市場行銷的考量,Sun 在 JDK 1.2 版release後將 Java 改名為「Java 2」,將 JDK 改名為「Java 2 Software Development Kit(以下簡稱 J2SDK)」。
然而,雖然改了名字,但是其內在還是沒有變化,其仍舊包含了Java Development kit(JDK)、Java Runtime Environment(JRE),這兩者的差異是:JDK是for programmer所使用,JRE則是提供Java程式運行的環境。
2005/09/13
[Troubleshooing] BEA-101083
####<2005/9/12 下午07時52分46秒 GMT+08:00> <Error> <HTTP> <rx2620e1> <uat01>
<ExecuteThread: '1' for queue: 'weblogic.socket.Muxer'> <<WLS Kernel>> <> <BEA-101083> <Connection failure.
java.lang.Throwable: Error in poll for fd=328, revents=8
at weblogic.socket.PosixSocketMuxer.processSockets(PosixSocketMuxer.java:128)
at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:32)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
>
reference link
DESCRIPTION:
Enhancement Request.
Running WLS 8.1 SP2 on HPUX11i.
Customer has requested an enhancement.
The customer wants to suppress (not print) the following error:
<May 25, 2004 10:05:11 PM GMT> <Error> <HTTP> <BEA-101083>
<Connection failure.java.net.SocketException: Error in poll for fd=81, revents=8
at weblogic.socket.PosixSocketMuxer.processSockets(PosixSocketMuxer.java:128)
at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:32)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
This message unnecessarily fills up their log.
This exception can be thrown if their client / browser initiated multiple requests (sockets were opened) and the client connections were closed before WLS could process the requests (and could not write to the stream any more).
This is a harmless message (unnecessary message).
2005/09/08
2005/09/07
[troubleshooting] [EJB:010207]License validation not passed for 2.0
Module Name: QueueTransportEJB, Error: Exception preparing module: EJBModule(QueueTransportEJB,status=NEW)
Unable to deploy EJB: /bea/weblogic81/server/lib/QueueTransportEJB.jar from QueueTransportEJB.jar:
java.lang.Exception: [EJB:010207]License validation not passed for 2.0.'
因為客戶的版本是express的版本(不含EJB Container),但是其在create domain的時候,使用sample此template(有EJB的code),改採server此temaplte來create即可
[How-To] memory allocation for WLS
%JAVA_HOME%\bin\java %JAVA_VM% %MEM_ARGS% %JAVA_OPTIONS% -ms512m -mx512m -Dweblogic.Name=%SERVER_NAME% -Dweblogic.ProductionModeEnabled=%PRODUCTION_MODE% -Djava.security.policy="%WL_HOME%\server\lib\weblogic.policy" weblogic.Server
512的地方可以replace成你想要的memory的量
[troubleshooting] admin console密碼更改的問題
[troubleshooting] how to retrieve client's IP if WLS had plugin apache
把server instance的這個值enable起來,然後server要restart
reference: domain_cluster_config_general.html
[troubleshooting] Connection has already been created in this tx context for pool
database:mysql
They had two mysql database connections. The first one is used to read data, and the second one is used to write data into another database. And they also check "Emulate Two-Phase Commit for non-XA driver" this option, but it still does not work.
Exception in context_onAcquire
java.sql.SQLException: Connection has already been created in this tx context for pool named dbsvr1_mysql. Illegal attempt to create connection from another pool: wssvr1_wsclub
According to the exception message, it means you can't use more than one non-XA connection pool in distributed transaction.
If you want to implement one user control calling two DB controls, you will have one transaction using two connections at the same time.
Only an XA transaction with 2PC support can do the job. You need to use XA driver.
I searched for the doc MYSQL, and find MYSQL 5.1 will support XA. But unfortunately, now the latest version of MYSQL is 5.0.
I think there's no good method on weblogic side which can handle the two connection pools with two non-xa drivers condition.
http://e-docs.bea.com/wls/docs81/faq/JTA.html#738373
2005/09/02
2005/08/30
2005/08/25
[troubleshooting] Resolve Too Many Open Files
Troubleshooting Guidance Support Diagnostic Patterns
之前一直發現rlim_fd_max這個值始終都是預設的1024這個值,並不是user設定後的值,原來是在啟動的時候,他會去跑commEvn.sh裡頭的resetFd()這個function,裡頭會把值還原成1024,把它comment掉就好了。
[troubleshooting] WLS 8.1 亂碼解決方法
in web.xml add:
<context-param>
<param-name>weblogic.httpd.inputCharset./*</param-name>
<param-value>BIG5</param-value>
</context-param>
in weblogic.xml add:
<jsp-descriptor>
<jsp-param>
<param-name>compileCommand</param-name>
<param-value>javac</param-value>
</jsp-param>
<jsp-param>
<param-name>compilerSupportsEncoding</param-name>
<param-value>true</param-value>
</jsp-param>
<jsp-param>
<param-name>encoding</param-name>
<param-value>BIG5</param-value>
</jsp-param>
</jsp-descriptor>
2005/08/15
Smartly load your properties
Example
Assume I have a property file which named config, and this file locate at src/albert.
This file contains two values:
name=albert
email=junyuo@gmail.com
Then you can utilize this approach to read this property file
InputStream is = ClassLoader.getSystemClassLoader().getResourceAsStream("albert/config.properties");
PropertyResourceBundle rb = new PropertyResourceBundle(is);
System.out.println("name="+rb.getString("name"));
System.out.println("email="+rb.getString("email"));
2005/08/02
2005/07/02
0B0-104(BEA 8.1 Certified Administrator)考試心得
此項考試的全名是:BEA 8.1 Certified Administrator : System Administration,考試代號是0B0-104。考試題數共69題,時間120分鐘,通過比率66%,報名費5000元。考試的詳細資訊請參考此網址:http://www.bea.com.tw/07services/techdoc/07services_03_04.htm
0B0-104考試報名
如果你之前參加透過Prometric舉辦的考試,考試ID仍舊可以沿用,無須重新申請。報名的話,可以打電話去報名(08001611141),告訴對方你的考試ID、要報名的考試科目名稱、考試時間、考試地點即可。
0B0-104 Study Guide
http://certification.bea.com/certification/study_guide
/System_Administration_11_12_04.htm,此link有告訴你此考試的準備方向,參考書籍以及模擬考題。JavaRanch此論壇的此thread也有針對此考試有一些在準備上的討論:http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=61&t=001195
0B0-104考試心得
考試的題型只有兩種:單選題與拖拉題。就整個考試內容來說,著重於幾個部份:Cluster, Performance Tuning, JMS, LDAP與Security, Application Deployment, JMS, Node Manager及Network Channel。拖拉題只有三題:Sever Life-Cycle、Heuristic Transaction、JMS File Store Synchronization Write Policy解釋 : Disabled, Cache-Flush, Direct-Write
2005/04/12
SimpleFTP Java FTP Client Package
2005/04/11
2005/03/18
java.util.MissingResourceException
I have a config.properties file. In this property file, it provides some information, such as jdbc driver url, user name, password, and so forth.
But as I wanna read this property file, it always throws this kind of exception message: java.util.MissingResourceException: Can't find bundle for base name config
How to resolve:
This root cause is not cannot find this property file. It does find this file, but the content in this file has something wrong.
This line is the snippet of the property file
ftp.type4.path=D:\batch\FTP_FILES\user_group
the problem is the slash direction, it should be
ftp.type4.path=D:/batch/FTP_FILES/user_group
or
ftp.type4.path=D:\\batch\\FTP_FILES\\user_group
2005/03/15
Example for Struts+DisplayTag+Spring Framework
Environment:Win XP Pro
App Server: Oracle 9i AS
DataBase: Oracle 9i
IDE Tool: JDeveloper 10g
Struts: http://jakarta.apache.org/struts
DisplayTag: http://displaytag.sourceforge.net
Spring Framework: http://www.springframework.org
Page Flow:
Sample Code: download
2005/01/26
An example to modify xml file by JDOM
input: TaiwanTopTen20050121073726.xml
source code:
1.ModifyXMLByJDOM
2.XMLUtil
2005/01/25
2005/01/24
An example to modify xml file by DOM
input file: TaiwanTopTen20050121074140.xml
source code:
1. ModifyXMLByDOM.htm
2. XMLUtil.htm
2005/01/23
An example to append a node to xml file by DOM
Input:
1. TaiwanTopTen20050121073726.xml
Source Code:
1. AppendTimeToXMLByDom.htm
2. XMLUtil.htm
2005/01/21
An example to write xml file by JDOM
input file: TopTen.csv
source code:
1. WriteXMLByJDOM.htm
2. TimeUtil.htm
3. IOUtil.htm
2005/01/20
An example to write xml file by DOM
input file: TopTen.csv
source code:
1.WriteXMLByDOM.htm
2.IOUtil.htm
2005/01/16
2005/01/15
2005/01/11
2005/01/09
IBM WebSphere and XML Certification Free Testing Promotion (January - June 2005)
1. There are 2000 vouchers, each valued up to $175 USD, and applicable to the appended WebSphere and XML certification tests. Each voucher is valid worldwide and can be used as payment for an applicable test.
Each participating candidate can qualify up to 3 vouchers, each voucher applicable to a different test.
2. To qualify for a voucher, a candidate is required to be one of the first people to pass the aligning Pre-assessment/Sample Test between January 1, 2005 (12:00 a.m. Eastern Time) and April 30, 2005 (11:59 p.m. Eastern Time).
http://www-03.ibm.com/certify/news/20041220g.shtml
2004/12/29
Oracle JDeveloper 10g (10.1.3) Developer Preview now available
This is the most substantial and ground-breaking JDeveloper release in years. Some improvements, such as the enhanced user interface and the new Refactor menu, you will note right away. Others, like the new project structure for seamless team development and the way that refactoring integrates with source control, may take more time to discover. These and other improvements will become apparent as you work with this innovative release of JDeveloper.
http://www.oracle.com/technology/products/jdev/101/index.html
2004/12/27
2004/12/21
2004/12/08
A Java library for reading/writing Excel
JExcelApi is a java library which provides the ability to read, write, and modify Microsoft Excel spreadsheets. This project mirrors the files on http://www.jexcelapi.org, which has been known to go down on occasion.
2004/11/30
c3p0:JDBC DataSources/Resource Pools
http://sourceforge.net/projects/c3p0
Introducing Spring Framework
You may have heard the buzz this summer around the Spring Framework. In this article, I'll try to explain what Spring sets out to achieve, and how I believe it can help you to develop J2EE applications.
Introducing Spring Framework
2004/11/28
What Management Is: How It Works and Why It's Everyone's Business
Whether you're new to the field or a seasoned executive, this book will give you a firm grasp on what it takes to make an organization perform. It presents the basic principles of management simply, but not simplistically. Why did an eBay succeed where a Webvan did not? Why do you need both a business model and a strategy? Why is it impossible to manage without the right performance measures, and do yours pass the test?
What Management Is is both a beginner's guide and a bible for one of the greatest social innovations of modern times: the discipline of management. Joan Magretta, a former top editor at the Harvard Business Review, distills the wisdom of a bewildering sea of books and articles into one simple, clear volume, explaining both the logic of successful organizations and how that logic is embodied in practice.
Magretta makes rich use of examples -- contemporary and historical -- to bring to life management's High Concepts: value creation, business models, competitive strategy, and organizational design. She devotes equal attention to the often unwritten rules of execution that characterize the best-performing organizations. Throughout she shows how the principles of management that work in for-profit businesses can -- and must -- be applied to nonprofits as well.
Most management books preach a single formula or a single fad. This one roams knowledgeably over the best that has been thought and written with a practical eye for what matters in real organizations. Not since Peter Drucker's great work of the 1950s and 1960s has there been a comparable effort to present the work of management as a coherent whole, to take stock of the current state of play, and to write about it thoughtfully for readers of all backgrounds. Newcomers will find the basics demystified. More experienced readers will recognize a store of useful wisdom and a framework for improving their own performance.
This is the big-picture management book for our times. It defines a common standard of managerial literacy that will help all of us lead more productive lives, whether we aspire to be managers or not.
Confronting Reality : Doing What Matters to Get Things Right
Amazon.com
In their 2002 bestseller, Execution: The Discipline of Getting Things Done Larry Bossidy and Ram Charan identify why people don’t get results: they don’t execute. Bossidy and Charan are back with another stellar study on organizational behavior that shows how companies can succeed if they return to reality and examine every part of their business. Confronting Reality is based on a simple concept, but many companies approach strategy and execution in a surprisingly unreal manner and even the simplest of measurement methods, like the business model, are not applied correctly.
Cisco, 3M, KLM, Home Depot, and the Thomson Corporation are just a few of the companies that Bossidy and Charan examine. To demonstrate how to examine a business using the business model, Bossidy and Charan map out external variables, financial targets, internal activities, and an iteration stage (defined as a time to "make tradeoffs, apply and develop business savvy") to prove how a dynamically evolving business model will help improve performance.
"The version of the business model we have developed is a robust, reality-based process for thinking about the specifics of your business in a holistic way. It shows you how to tie together the financial targets you must meet, the external realities of your business and internal activities such as strategy development, operating tactics, and selection and development of people."
Larry Bossidy, retired chairman and CEO of Honeywell International and Ram Charan, author of What the CEO Wants You to Know and Profitable Growth Is Everyone's Business, have once again shed industrial-strength light on how to run a successful business. --E. Brooke Gilbert
link
Struts vs. JavaServer Faces
Introduction
It should come as no surprise that the most frequent questions I get asked center around the issue of which of these two web tier technologies an organization or individual developer should consider using. It makes sense to ask me, because I was the original creator of the Struts Framework, and was the co-specification lead for JavaServer Faces 1.0 (JSF).
Usually, the question is framed as an or issue, based on an understanding that the two technologies are mutually exclusive. That turns out not to be the case, but it can still be difficult to determine what to do. This blog entry provides my current advice on the subject -- but, to understand it better, it's worth briefly reviewing the development and focus of the two technologies.
The story is a little long compared to typical blog entries; if you want to cut to the chase and see my advice, scroll down to the section entitled The Bottom Line, below.
http://blogs.sun.com/roller/page/craigmcc/20040927
2004/11/24
display tag library
http://displaytag.sourceforge.net/
You can directly study the displaytag.war, it must can shorten your learning curve.
Making Java Objects Comparable
03/12/2003
In real life, objects are often comparable. For example, Dad's car is more expensive than Mom's, this dictionary is thicker than those books, Granny is older than Auntie Mollie (well, yeah, living objects, too, are comparable), and so forth. In writing object-oriented programs, there are often needs to compare instances of the same class. And once instances are comparable, they can be sorted. As an example, given two Employees, you may want to know which one has stayed in the organization longer. Or, in a search method for Person instances with a first name of Larry, you may want to display search results sorted by age. This article teaches you how to design your class to make its instances comparable by using the java.lang.Comparable and java.util.Comparator interfaces and presents three examples that illustrate both interfaces.
http://www.onjava.com/lpt/a/3286
2004/11/11
Book Recommendation: Profitable Growth Is Everyone's Business : 10 Tools You Can Use Monday Morning
Book Description
The coauthor of the international bestseller Execution has created the how-to guide for solving today’s toughest business challenge: creating profitable growth that is organic, differentiated, and sustainable.
For many, growth is about “home runs”—the big bold idea, the next new thing, the product that will revolutionize the marketplace. While obviously attractive and lucrative, home runs don’t happen every day and frequently come in cycles.
Products like Kevlar, Teflon, and the Dell business model for selling personal computers may be once-in-a-decade phenomena. A surer and more consistent path to pro?table revenue growth is through “singles and doubles”—small day-to-day wins and adaptation to changes in the marketplace that build the foundation for substantially increasing revenues. The impact of singles and doubles can be huge. They are not only the basis for sustained revenue growth but, in fact, the foundation for home runs. Singles and doubles provide the discipline of execution, an absolute necessity for successfully bringing a breakthrough technology to market or implementing a new business model.
Inherent in this way of thinking is the revolutionary idea that growth is everyone’s business—not solely the concern of the sales force or top management. Just as everyone participates in cost reduction, so must everyone be engaged in the growth agenda of the business. Every contact of each employee with a customer is an opportunity for revenue growth. That includes everyone from the people working in a company’s call center handling customer inquiries and complaints to the CEO.
In this trailblazing book, Ram Charan provides the building blocks and tools that can put a business on the path to sustained, pro?table growth. For more than twenty-?ve years, Ram Charan has been working day in and day out with companies around the world. The ideas he has developed for solving the profitable revenue growth dilemma facing many businesses are based on personally seeing what works in real time. These are ideas that have been tested across industries and that deliver results, and they can be put to use starting Monday morning.
Book Recommendation: The Wal-Mart Decade: How a New Generation of Leaders Turned Sam Walton's Legacy into the World's #1 Company
Book Description
Inside one of America's most remarkable success stories, from the bestselling author of Jack Welch and the G.E. Way.
Two of the toughest challenges for any company are leadership transitions and rapid growth. How do you replace an enormously popular and beloved CEO-especially one who started from scratch to create a national icon? And how do you maintain a rapid growth rate without losing the culture and focus of a small company?
Over the past ten years, since the death of the legendary Sam Walton, Wal-Mart has passed both challenges with flying colors. In 1992, it had revenues of $43.9 billion; now it's number one on the Fortune 500 list of America's largest companies, with revenues of $218 billion. Sam Walton's successors have taken the company into far-flung new markets and new directions yet without losing the down-to-earth retailing culture that made Wal-Mart thrive in its early years, when its business model was truly revolutionary.
Robert Slater, a highly respected business journalist and author, was granted unprecedented access to the company while writing The Wal-Mart Decade. He takes readers deep into the inner circle, where the big decisions are made about strategy and operations. And he weaves a fascinating, accessible story about the many challenges of the past decade and how Wal-Mart built on its founder's legacy to overcome them.
2004/10/17
[Book Recommendation] Game Theory and Economic Modelling
by David M. Kreps
Product Description:
This book examines why game theory has become such a popular tool of analysis. It investigates the deficiencies in this methodology and goes on to consider whether its popularity will fade or remain an important tool for economists. The book provides the reader with some basic concepts from noncooperative theory, and then goes on to explore the strengths, weaknesses, and future of the theory as a tool of economic modelling and analysis. All those interested in the applications of game theory to economics, from undergraduates to academics will find this study of particular value.
2004/10/10
[Book Recommendation] Reengineering the Corporation: A Manifesto for Business Revolution
by Michael Hammer (Author), James Champy (Author)
Book Description
No business concept was more important to America's economic revival in the 1990s than reengineering -- introduced to the world in Michael Hammer and James Champy's Reengineering the Corporation. Already a classic, this international bestseller describes how the radical redesign of a company's processes, organization, and culture can achieve a quantum leap in performance.
But if you think that reengineering once was enough, think again. More changes, more challenges are coming in the twenty-first century. Now Hammer and Champy have updated and revised their milestone work for the New Economy they helped to create -- promising to help corporations save hundreds of millions of dollars more, raise their customer satisfaction still higher, and grow ever more nimble in the years to come.
2004/10/06
[Book Recommendation] When Economics Mean Business
by Sultan Kermally
Editorial Reviews
The core of traditional management thinking is based on the foundations of traditional economic thinking. As economies shift from the industrial age to the informative age, the rules of economic engagement are undergoing radical change.