Recent Notes
Displaying keyword search results 1 - 10
Created by Fang on February 08, 2012 21:15:00
Last update: February 08, 2012 21:15:00
This was the error message:
[ERROR] sun.security.validator.ValidatorExceptio...
The certificate was actually signed by Verisign, but somehow failed to pass Java cert validation.
To resolve the problem:
Download the cert from the server (with RetrieveSSLCert , for example)
Import the certificate into the keystore:
$ keytool -import -trustcacerts -alias myserver -f...
Define MAVEN_OPTS :
$ export MAVEN_OPTS='-Djavax.net.ssl.trustStore=/h...
The quotes must exist for the value of MAVEN_OPTS , and the path must be absolute ( ~/etc/mavenKeyStore.jks does not work).
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 Fang on October 22, 2011 19:51:05
Last update: October 22, 2011 20:31:48
I built a very basic JSF application and deployed to Tomcat 7.0.22, but it failed with this error:
Caused by: java.lang.ClassFormatError: Absent Code... That looks weird and I wasn't able to find a sensible explanation! So I copied the jsf-api-2.1.jar , which was downloaded from the java.net Maven repository by Maven, into a temp folder. And tested it with this simple program: public class ClassFormatErrorTest { public ... I also copied servlet-api.jar from Tomcat's lib folder to the temp folder. Sure enough it failed with the same error: C:\tmp>java -cp .;jsf-api-2.1.jar;servlet-api.jar ... But when I replaced the javax.faces.webapp.FacesServlet class with one I compiled from source, the error disappears! Conclusions: The jar file jsf-api-2.1.jar from java.net Maven repository is good for compilation only (cannot be used...
Created by freyo on July 27, 2010 21:18:24
Last update: June 29, 2011 13:49:36
Use android list targets to find valid targets:
C:\android-sdk-windows\tools>android list targets
...
Created by freyo on May 06, 2011 14:28:21
Last update: May 06, 2011 14:29:03
I got this error while building Android. It meant that I was missing the libhistory.a static library.
# yum whatprovides */libhistory.a
Loaded plugin...
# yum install readline-static-6.1-2.fc14.i386
...
Created by magnum on May 06, 2011 12:26:14
Last update: May 06, 2011 12:26:14
The bash environment variable PROMPT_COMMAND contains a regular bash command that is executed just before the command prompt is displayed.
For example:
$ export PROMPT_COMMAND=a
bash: a: command not ...
The command a is not valid so you get the error message every time you hit enter.
Echo something before $PS1 :
$ export PROMPT_COMMAND='echo -n Hi!'
Hi!$
...
PROMPT_COMMAND is regularly used to change the xterm window title. You may find this in /etc/bashrc :
case $TERM in
xterm*)
if [ -...
Created by Dr. Xi on March 28, 2011 11:11:33
Last update: March 28, 2011 11:13:21
grep is a versatile command with many variations (grep, egrep, fgrep, then various implementations). It uses a regula expression (regex) pattern to filter input. But then there are basic and extended flavors of regex - leading to even more confusion. And, beware that there are lots of bad examples of regex in the wild... There are two critical questions to ask when you use grep: which grep implementation are you using? what is the flavor of the regex? Here are some examples for gnu grep v2.7:
# Find all numbers (no decimal point), basic regex... Use the -o flag to show only the matching part instead of the whole matching line: grep -o -E '\b[0-9]{2}\b' The good thing about the gnu grep is that it...
Created by voodoo on February 25, 2011 14:00:41
Last update: February 25, 2011 14:03:46
Suddenly my Windows XP failed to boot with this error message on a blank screen:
missing or corrupt <windows root>\system32\hal.dll I took out the hard drive, put it in a USB enclosure and attached it to another PC. Then I ran CHKDSK and it fixed some file system errors. But I did find that hal.dll was intact, so hal.dll was not missing or corrupt . It turned out that the file that was really missing was C:\boot.ini . It is a hidden file, so you have to use attrib boot.ini to see it. The file is missing if attrib boot.ini returns nothing (run in the root folder C:\). In my case I reconstructed the boot.ini file: [boot loader] timeout=30 default=multi(0)dis... and changed the attributes back...
Created by Dr. Xi on January 31, 2011 16:14:06
Last update: January 31, 2011 16:14:06
Sometimes ClassCastException happens when apprently a class is casted to the same class or a parent class. The exception looks like this:
java.lang.ClassCastException: X cannot be cast to ... where Y may be the same as X , or a parent class of X . The cause of this error is that X and Y are loaded by different class loaders. You can use the FindClass utility to find all occurances of X and Y in the deployment tree. If there's no duplication of X and Y in the deployment tree, JNDI lookups may be the culprit. Suppose X is loaded by class loader LX and registered under name jndi/Resource . In the context of another loader LY , your code may be looking up...
Created by Dr. Xi on June 01, 2010 16:44:12
Last update: June 01, 2010 16:45:52
I installed JDK 1.6 under C:\jdk1.6.0_20 and unpacked Eclipse GALILEO in C:\local\eclipse . When I launched Eclipse with eclipse.exe , it simply displayed a splash page and shutdown.
Running eclipsec.exe displayed some vague errors:
C:\local\eclipse>eclipsec
Error occurred during...
Turning on debug:
C:\local\eclipse>eclipsec -debug
Start VM: -Dos...
The Solution: add -vm option to eclipse.ini :
-startup
plugins/org.eclipse.equinox.launcher_1...