Recent Notes

Displaying keyword search results 1 - 4
Created by Dr. Xi on March 02, 2011 11:39:18    Last update: March 09, 2011 12:19:30
Some peculiarities about Java PrintWriter: PrintWriter never throws any exceptions. From JavaDoc : Methods in this class never throw I/O exceptions, although some of its constructors may. The client may inquire as to whether any errors have occurred by invoking checkError(). When error occurs, you'll never know anything more than that it occured, because checkError returns boolean. When a character is out of the range of the character encoding of the PrintWriter, it prints a question mark (?). But this is not an error. Test code: import java.io.*; public class TestPrintWri... Latin1 test result: java TestPrintWriter iso-8859-1 | od -bc 000000... UTF-8 test result: java TestPrintWriter utf-8 | od -bc 0000000 141... Also, the constructor throws a FileNotFoundException when you try to write to a...
Created by Fang on July 17, 2010 03:16:53    Last update: July 17, 2010 03:18:25
This error happens when the ordering of elements in web.xml is not correct. For example, in a <servlet> declaration, <servlet-name> should come before <servlet-class> . If you switch the order of <servlet-name> and <servlet-class> , you'll get this error. This was my stack trace in JBoss when I declared <load-on-startup> before <init-param> for a servlet: DEPLOYMENTS IN ERROR: Deployment "vfszip:/C:/...
Created by Dr. Xi on February 13, 2010 22:52:18    Last update: February 13, 2010 22:52:18
This runtime error happens when the Sun EL implementation is not available. Look for the class com.sun.el.ExpressionFactoryImpl in your deployment package, you probably won't find it, or you'll find a version that can't be loaded in your deployment environment. If you are using Maven to build, you can add the following repository and dependency in pom.xml : <!-- Project dependencies --> <dependencies...
Created by Dr. Xi on August 15, 2007 18:08:34    Last update: November 08, 2007 22:00:01
I had this problem when deploying a J2EE application into Oracle app server. It worked fine with an OC4J container configured in the default group. But it failed to start with an OC4J container I created. Here's a sample stack trace of the initialization exception: 07/08/14 13:32:46.34 10.1.3.3.0 Started 07/08/1... The problem was, the struts ActionServlet loads commons logging LogFactory, the log factory somehow knows that it needs log4j, but it can't load log4j since it's loaded by a different class loader. The solution for Oracle is to omit commons logging from the list of inherited libraries. Add this to META-INF/orion-application.xml solves the problem: <imported-shared-libraries> <remove-inhe... Actually, this is a quite common problem with commons-logging. If you search the web, you'll find that people have...