Recent Notes
Displaying keyword search results 1 - 10
Created by Fang on May 15, 2012 13:04:24
Last update: May 15, 2012 13:04:44
Set the warnLogCategory attribute to log uncaught exception stacktrace:
<bean
class="org.springframework.web.servl...
Created by Fang on February 21, 2012 20:33:58
Last update: February 21, 2012 20:33:58
You can customize Tomcat error page with error code:
<error-page>
<error-code>404</error-code>
...
or Java exception type:
<error-page>
<exception-type>java.lang.Throwab...
Either error-code or exception-type is required, but not both. There's no way to aggregate error codes, such as:
<!-- This does not work! -->
<error-page>
...
Customizing error pages is about the only way to suppress the default stack trace in Tomcat in case of an unhandled exception.
Created by Fang on January 10, 2010 00:19:30
Last update: January 31, 2012 16:28:42
Maven is a powerful yet complex tool. When I started learning Maven, the first obstacle was, of course, its complexity. The second, was the lack of documentation that can get me off the ground quickly. This tutorial is an attempt to create a pragmatic guide that aims to get you familiar with Maven in the quickest way possible. The main theme is to get you on some hands on experience to start out and lead you through the creation of a simple Java EE project as quickly as possible. Instead of trying to give you a good read, I try to get you on the journey right away. The topics are roughly ordered by the logical sequence but you can jump around in any way...
Created by nogeek on December 30, 2011 13:54:04
Last update: December 30, 2011 13:54:04
Tomcat 7.0 failed with a SEVERE error without printing a stack trace:
Dec 30, 2011 1:21:09 PM org.apache.catalina.core.S...
Now it's hard to figure out what's wrong without knowing where things went wrong. Why is Tomcat not logging anything?
Tomcat logging is configured by class loader. Logging behaves differently depending on which class loader loaded the logger. You'll need to look at both $CATALINA_BASE/conf/logging.properties and WEB-INF/classes/logging.properties to figure out why the stack trace is not logged.
In my case, the web app specific WEB-INF/classes/logging.properties overshadowed the system $CATALINA_BASE/conf/logging.properties and suppressed the stack trace.
Created by nogeek on November 03, 2010 20:52:49
Last update: November 23, 2011 08:54:44
My problem is simple: in my XML data, a timestamp is provided as a long integer (number of milliseconds since the "the epoch"). When I do XSLT, I want to display it as a readable string, such as "Mon Nov 01 18:08:48 CDT 2010". After hours of struggle, I found: It's not so easy to get the job done with JDK 1.6 There are tons of garbage on the web in this space (suggestions, code snippets that simply don't work) Simple Xalan extension functions was the only resource that's somewhat informative. Even there some of the examples don't work. Below is a list of what worked and what didn't. This works:
<xsl:stylesheet version="1.0" xmlns:xsl="h... This does not (providing long value to Date constructor): <xsl:stylesheet version="1.0" xmlns:xsl="h......
Created by mee2 on November 20, 2011 20:26:05
Last update: November 20, 2011 20:26:34
Stack trace:
Caused by: org.alfresco.error.AlfrescoRuntimeExcep...
Cause:
Location of Alfresco keystore changed via shared/classes/alfresco-global.properties but keystore files not exist.
Solution : copy keystore files from alfresco.war :
cp -R webapps/alfresco/WEB-INF/classes/alfresco/ke...
Created by Fang on November 08, 2011 14:40:57
Last update: November 08, 2011 14:40:57
This error happened when I loaded a JSF page, using Apache MyFaces. From the stack trace it looked like the XML parser failed, but in reality the runtime was not able to load the class specified in the handler-class element - a typo in the class name! That's the price you pay for wiring together components with XML!
This was the stack trace:
Caused by: org.xml.sax.SAXException: Error Handlin...
Created by Dr. Xi on September 19, 2011 11:56:42
Last update: September 19, 2011 11:57:26
It is well known that with the -D switch you can turn an ssh session into a socks proxy:
ssh -D localhost:8080 remote_user@remote_host
Now configure your browser to use " localhost:8080 " as a socks proxy and your web traffic is routed through remote_host via an ssh tunnel.
But sometimes you encounter an error message like this:
Disconnecting: Bad packet length - 1416586337
This is because sometimes, the ssh session outputs some "welcome" message into the tunnel, polluting the protocol stream between the client and the remote host.
A safer way to establish an ssh socks proxy would be:
ssh -N -D localhost:8080 remote_user@remote_host
Created by Dr. Xi on April 27, 2011 11:57:36
Last update: April 27, 2011 11:58:35
This is a sample struts-config.xml file for Struts 1.x .
<?xml version="1.0" encoding="UTF-8"?>
<!DO...
Created by nogeek on February 03, 2011 13:08:38
Last update: February 03, 2011 13:14:10
The log line was like this:
2011-01-19 15:16:34,842 INFO [STDOUT] (HDScanne... Note that INFO and timestamp were printed twice. Based on my configuration, I was expecting something like this: 2011-01-19 15:16:34,842 INFO [XmlWebApplicationC... i.e., the logger name should have been XmlWebApplicationContext , not STDOUT ! What was the problem? I found this error message in server.log : 2011-01-19 14:34:38,107 ERROR [STDERR] (main) lo... It turned out that org.apache.log4j.Appender was loaded by my web application class loader, whereas org.jboss.logging.appender.FileAppender was loaded by the JBoss bootstrap class loader. Removing the log4j jar from my web application archive fixed the problem (sine log4j is already available in JBoss). Why was the logger changed to STDOUT? JBoss detects that there's a problem with the log4j configuration and routes all...