Pitfalls of Handling Large String Objects in Java

Most Java developers know to be careful about String concatenation. But some argue that it is less important nowadays with improved JVM garbage collection efficiency. That might be true for small objects, but for large String objects, which is common when dealing with web services and xmls, developers need to be even more careful with String operations in general, and not just concatenation.

OOM in Production, Why?


I recently looked into an OutOfMemory exception in production and the culprit turned out to be the following code.


Log4j Behaviour in Tomcat and WebSphere

Logging is the interface between developers and system admin. Developers need to know how their logging code behave in a server envrionment. Admins need to know how to configure and turn on/off logging. This series inspects how two most common logging methods, Java Util Logging and Log4j, behave in Tomcat and WebSphere.

Java Util Logging Behaviour in WebSphere

Logging is the interface between developers and system admin. Developers need to know how their logging code behave in a server envrionment. Admins need to know how to configure and turn on/off logging. This series inspects how two most common logging methods, Java Util Logging and Log4j, behave in Tomcat and WebSphere.

Java Util Logging Behaviour in Tomcat

Logging is the interface between developers and system admin. Developers need to know how their logging code behave in a server envrionment. Admins need to know how to configure and turn on/off logging. This series inspects how two most common logging methods, Java Util Logging and Log4j, behave in Tomcat and WebSphere.

Java Util Logging and Log4j Behaviour in Tomcat and WebSphere

Logging is the interface between developers and system admin. Developers need to know how their logging code behave in a server envrionment. Admins need to know how to read logging.properties and log4j.properties, configure them and turn on/off logging. This series inspects how two most common logging methods, Java Util Logging and Log4j, behave in Tomcat and WebSphere.

Step-by-Step : How logging caused big performance problem for a JAX-WS web service

This article is about how a small piece of code can cause big performance trouble and how hard it is to figure out the root cause.


What's the Number 1 Java Coding Best Practice?

There are some common known Java coding best practices: use StringBuffer for string concatenation, don't create large objects, cache expensive objects such as DateFormatter, etc.. How important are they? How much performance can you improve by following these practices? 5%, 10%, or 20%?

Then, even the most dilligent developers can not claim that they follow all the best practices all the time, especially with so many 'new' frameworks and standards being adopted. Could you have missed anything?

Tutorial : Building EJB3 Stateless Session Bean and JAX-WS web service In One Class Using RAD 7.5 - Developing JAX-WS Client

This series is about building an empty shell application that contains an EJB3 stateless session bean, a JAX-WS web service, and a web application that acts as the EJB and web service clients. I personally built it for performance testing purpose; so I can plug-in "in-doubt" java code to oberve how they handle concurrency in a server environment. But this will serve as a tutorial for those who are interested.

Part 1 : Project Setup
Part 2 : EJB3 and JAX-WS Implementation
Part 3 : Develop EJB3 client
Part 4 : Develop JAX-WS client

Tutorial : Building EJB3 Stateless Session Bean and JAX-WS web service In One Class Using RAD 7.5 - Developing EJB3 Client

This series is about building an empty shell application that contains an EJB3 stateless session bean, a JAX-WS web service, and a web application that acts as the EJB and web service clients. I personally built it for performance testing purpose; so I can plug-in "in-doubt" java code to oberve how they handle concurrency in a server environment. But this will serve as a tutorial for those who are interested.

Part 1 : Project Setup
Part 2 : EJB3 and JAX-WS Implementation
Part 3 : Develop EJB3 client
Part 4 : Develop JAX-WS client


Client Web Project Setup

I will create a web project to host servlets that will call the EJB3 Stateless Session Bean and the JAX-WS web service.

From Java EE perspective, Click New -> Dynamic Web Project.

Tutorial : Building EJB3 Stateless Session Bean and JAX-WS web service In One Class Using RAD 7.5 - Implementation

This series is about building an empty shell application that contains an EJB3 stateless session bean, a JAX-WS web service, and a web application that acts as the EJB and web service clients. I personally built it for performance testing purpose; so I can plug-in "in-doubt" java code to oberve how they handle concurrency in a server environment. But this will serve as a tutorial for those who are interested.

Part 1 : Project Setup
Part 2 : EJB3 and JAX-WS Implementation
Part 3 : Develop EJB3 client
Part 4 : Develop JAX-WS client


Implement the Interface. 

Before we make changes to it, here is the generated class.

package
com.appinf;

import javax.ejb.Remote;
@Remote
public
        interface TestHarnessRemote {
}

Tutorial : Building EJB3 Stateless Session Bean and JAX-WS web service In One Class Using RAD 7.5 - Project Setup

This series is about building an empty shell application that contains an EJB3 stateless session bean, a JAX-WS web service, and a web application that acts as the EJB and web service clients. I personally built it for performance testing purpose; so I can plug-in "in-doubt" java code to oberve how they handle concurrency in a server environment. But this will serve as a tutorial for those who are interested.

Part 1 : Project Setup
Part 2 : EJB3 and JAX-WS Implementation
Part 3 : Develop EJB3 client
Part 4 : Develop JAX-WS client