Thursday, November 20, 2008
2G Memory is not enough for RSA Profile
JVMDUMP013I Processed Dump Event "systhrow", detail "java/lang/OutOfMemoryError".
Friday, November 14, 2008
RSS - Really Simple Syndication
History 1997, now RSS 2.0 in 2003. 50% sites still use RSS 0.91, 25% RSS 1.0, 12.5% 0.9x and 12.5% 2.0.
With RSS,
- you create a RSS document and save it with a xml extension
- upload the file to your website
- register it with a RSS aggregator
Java RSS programming - ROME
Render RSS on web pages - RSS2HTML
Include rss2html output in a html page - Server Side Include (xyz.shtml)
Thursday, October 23, 2008
Start Tomcat in Eclipse
Solution: Window -> Preferences -> Server -> Server timeout delay
set it to Unlimited.
Monday, October 20, 2008
Enabling PostgreSQL on Linux System Startup
To enable PostgreSQL at startup
#chkconfig --all postgresql
#chkconfig postgresql on --level 2
#chkconfig postgresql on --level 3
#chkconfig postgresql on --level 5
Thursday, October 02, 2008
RUP Notes
RUP provides the software developer with a DISCIPLINED approach to the development process.
The aim of RUP is to ensure a high-quality result that satisfies user requirements within a predictable budget and schedule. It was designed to be fully compatible with object-oriented technology and the UML. It supports component-based software development.
RUP is a configurable process. It uses use cases to drive the development activities. Use cases facilitate the development from the beginning of the development process through to testing. And they give you a means to trace the process flow through the development of the system and the delivered product.
RUP is the opposite of sequential approaches. It is an iterative and incremental approach to the software life cycle. RUP encourages continuous integration. (Note, here it is "encourage", which means you still need to implemente your own continuous integration, or also called continuous build. Since RUP as a process to focus the final executible deliverables, continuous build servics as compliment to build the deliverables automatically. Sometime the build can also include regression tests which is even better.)
RUP deals errors and flaws in the system over successive iterations, thus makes the system more robust and stable.
Coming behind RUP are requirements management and change control. RM ensures the system better meets the customer's expectations, also limits the size of the project to acceptable levels(scope). Change control helps keep track of defects, misunderstandings, and project commitments and to associate them with specific artifacts.
RUP is architecture-centric, its early iterations has a main thrust to produce and validate a software architecture.
In RUP, quality control has been incorporated into the process. This quality assessment uses objective measurements and criteria for all activities and participants in the process.
RUP has four phases and each phase has iterations. At the end of each phase, comes a milestone, which is a predefined point in time by which certain goals must be achieved and certain decisions made. During the inception phase, the original vision of the product is transformed into a project(my understanding, a well defined plan, definition of deliveriables, iterations, etc.). Formulate the vision, establish business cases and specify the project scope, make decisions on what to invest time and money on. Business cases include success criteria, risk assessment, estimation of resources, phase plan indicating the dates of milestones, prototyping.
The goal of the elaboration phase is more thorough analysis of the problem domain, to establish and define the architecture, to address and eliminate high-rish elements of the project, to determine how the work should be divided into iterations(I think it is difficult but critical. It needs strategic thinking, knowledge and experience. But it is also where the value of a good architect lies.) At the end of the elaboration phase, the decision must be made to build or not the system.
The third phase is the construction. In its final iteration the construction delivers a constructed software system.
RUP defines a transition phase, where the product is supplied to its end-users. Plan the packaging, pricing, roll out, support, training, transition strategy, production details.
It's recommended to have a "postmortem" analysis of the project, addressing how well the original and revised success criteria have been met.
There are nine core workflows in the RUP, either engineering process workflows or supporting process workflows. Business modeling, requirements capture, application/system analysis and design, implementation, testing, deployment
Thursday, September 11, 2008
JDBC ResultSet Column Name with Multiple Tables
Incorrect - a.col1, b.col2.
Correct - col1, col2.
What if same column names in both tables, like a.col3 and b.col3?
Write SQL like "select a.col3 as acol3, b.col3 as bcol3 ...", then name the column in getXXX method as acol3 and bcol3.
Thursday, August 28, 2008
Customize 401 Error Page with HTTP Basic Authentication
After adding an error-page element in web.xml to customize 401 error page, HTTP auth will not work.
So far with Tomcat 6.0, I have found no way to make them work.
Monday, August 25, 2008
Tomcat DataSourceRealm
userTable="schema1.users" works and the schema name should be lower case too in the database.
Schema1 or SCHEMA1 won't work.
Wednesday, August 06, 2008
External JACC Provider in WebSphere 6.1
- Internal accepts "welcome.do" but external TAM provider doesn't, it accepts "/welcome.do"
- I switched from Default to External but failed to switch it back. Even from the admin console it looked fine, but the server kept using TAM as authorization provider. What I had to do was to reinstall RSA.
Friday, August 01, 2008
TAM Error AWXJC0050E
com.tivoli.pd.as.jacc.cfg.TAMConfigException: AWXJC0048E An error occurred during the configuration. The details are:
com.tivoli.pd.as.jacc.cfg.ConfigActionFailedException: AWXJC0050E The Tivoli Access Manager user, sec_master, failed to add the Tivoli Access Manager user, JACC_-264539269/cledt-123691.agna.amgreetings.com, to the Tivoli
Access Manager group, iv-admin. The details are: Wrappered Exception:java.net.BindException: Address already in use:
NET_Bind[HPDCO1050E Socket could not be created (8920).].. at
com.tivoli.pd.as.jacc.cfg.TAMConfigController.execute(TAMConfigController.java:156)
For this error, note the port 8920 in the message, then change the client listener port from default 8900:8999 to 8921:8999.
Have a $ in your password?
What you need to enter is "abc$$$$cba".
Wednesday, May 14, 2008
Struts InvalidCancelException
2.1. Bug 38374 - Validation always skipped with Globals.CANCEL_KEY
2.1.1. Issue: Cancel Processing
The Struts <html:cancel> tag sets a request parameter (org.apache.struts.taglib.html.Constants.CANCEL) which causes validation to be skipped.
Spoofing this request parameter however, could be used maliciously in order to circumvent an applications validation and proceed with the request processing with erroneous and potentially damaging data.
See Bug 38374 for full details.
2.1.2. Resolution: Cancellable Property
A new cancellable property has been introduced which indicates whether an action is allowed to be cancelled or not. In Struts 1.2.9 this is set to true or false for an action in the struts-config.xml using the <set-property> notation. From Struts 1.3.x a new cancellable attribute has been added to the <action> element.
Now any action where the cancellable property is not set to true will throw an InvalidCancelException.
2.1.3. Upgrade Implications
Any existing applications that use the Cancel processing will need to modify their struts-config.xml to set the cancellable property for actions which require it.
In Struts 1.2.9 the <set-property> is used to set the cancellable property for an action....
<action path="/fooAction"
input="/foo.jsp"
validate="true">
<set-property property="cancellable" value="true"/>
<forward name="success" path="/bar.jsp"/>
</action>
From Struts 1.3.x a new cancellable attribute can be used....
<action path="/fooAction"
input="/foo.jsp"
validate="true"
cancellable="true">
<forward name="success" path="/bar.jsp"/>
</action>
In both Struts 1.2.9 and Struts 1.3.x an exception handler can be configured to handle the InvalidCancelException
<action path="/fooAction"
input="/foo.jsp"
validate="true"
cancellable="true">
<forward name="success" path="/bar.jsp"/>
<exception key="errors.cancel"
type="org.apache.struts.action.InvalidCancelException"
path="/foo.jsp"/>
</action>
2.1.4. Test Cases
This bug was tested using the struts-examples webapp (see struts-examples.war in the binary distribution). If you fire up the examples webapp, select the Taglib Test Pages link, then select the <html:cancel> link you will be presented with a page where you can try the Cancel button for four different configurations.
Tuesday, April 29, 2008
Cancel Button for CancellableFormController
where by default "_cancel" is the cancelParamKey. You can use setCancelParamKey() to override it.
Thursday, April 24, 2008
Form Validation Error Message
When the date input doesn't match the specified format, it will report an error message. The message is very much in Java developer's language, not user oriented.
To replace the message with your own, just put a line like that in your messages.properties,
typeMismatch=Invalid or incomplete input.
Spring Framework - Date Field in a SimpleFormController
- Override the initBinder method.
- Create a SimpleDateFormat, e.g. MM/dd/yyyy HH:mm:ss where M is month, d is day, y is year, H is hour(0-23), m is minute, and s is second.
- Set the date format lenient false, which means inputs do not have to match the format exactly
- Create a CustomDateEditor(dateFormat, true), where true means empty allowed.
- Register the editor to Date.class.
Thursday, April 10, 2008
Postgresql - Generate Primary Key before Insert
Second in your program, use select nextval('schema.april_april_id_seq') to obtain the next value for primary key. You don't need to plus 1 since Postgresql does it for you. If using Spring JDBC template, just call getJdbcTemplate().queryForInt(the sql).
Third, use the value just obtained as parameter in the insert sql.
Done.
Monday, April 07, 2008
Velocity Layout in Spring
In web.xml, define org.springframework.web.servlet.DispatcherServlet as spring. Mapping *.xhtml to spring. I leave html for real html files.
In spring-servlet.xml, define
viewResolver class=org.springframework.web.servlet.view.velocity.VelocityLayoutViewResolver
- viewClass = org.springframework.web.servlet.view.velocity.VelocityLayoutView
- layoutUrl = layouts/mainlayout.vm
- cache = true
- suffix = .vm
- exposeRequestAttributes = true
- exposeSessionAttributes = true
- exposeSpringMacroHelpers = true
- dateToolAttribute = dateTool
- numberToolAttribute = numberTool
velocityConfigurer class = org.springframework.web.servlet.view.velocity.VelocityConfigurer
- resourceLoaderPath = WEB-INF/views
- velocityProperties directive.foreach.counter.name = loopCounter
- directive.foreach.counter.initial.value=0
Create a layout file, mainlayout.vm under WEB-INF/views/layouts. Put html, body, stylesheet stuff in. Note the stylesheet file shall sit outside WEB-INF. e.g. stylesheet href = "includes/main.css" means the main.css file sits at [web-root]/includes forlder.
Put $screen_content whereever you want.
In spring controller, return the ModelAndView name "dashboard", create a dashboard.vm file under WEB-INF/views.
In the dashboard.vm file, put any content in.
Monday, March 31, 2008
Books for JMS
- Paperback: 352 pages
- Publisher: IBM Press (February 25, 2004)
- Language: English
- ISBN-10: 0131468634
- ISBN-13: 978-0131468634
This book offers start-to-finish guidance for building reliable, high-performance JMS-based messaging infrastructure with IBM WebSphere technologies.
IBM expert Kareem Yusuf systematically introduces the latest versions of JMS—both 1.1 and 1.02b. Once you've thoroughly mastered JMS development on any platform, Yusuf turns to the exceptional JMS support found in IBM's WebSphere products. Using extensive code examples, he walks you step-by-step through WebSphere JMS development, configuration, deployment, and administration in several real-world scenarios.
Coverage includes:
- Roles and goals of messaging infrastructure in the enterprise
- Key JMS concepts: messaging domains, messages, and Application Server Facilities
- Defining/structuring content, choosing message types, and manipulating messages
- The JMS API, explained through detailed code examples
- Using JMS with EJB, message-driven beans, servlets, and portlets
- Working with IBM WebSphere JMS providers, administered objects, and tools
- Hands-on tutorials: EJB message exchange, integration with non-JMS applications, and SSL security
- Resource location and physical topologies for maximizing availability and efficiency
Whether you're developing enterprise messaging infrastructure, architecting it, or managing it, this bookdelivers indispensable guidance-straight from the frontlines.
HTTP Request Headers
Its only problem is the header need to applied for every request. It doesn't remember or recall.
I also tested another add-on on Firefox called Modify Headers. It only worked the very first try but failed ever after.
Neither Tamper Data nor Modify Headers works on Internet Explorer.
It is said that IBM Page Details can work on IE.