Recent Notes

Displaying keyword search results 1 - 10
Created by zhidao on April 06, 2012 13:03:20    Last update: April 06, 2012 13:03:20
1. pom.xml <plugin> <groupId>org.jvnet.jax-ws-commons<... 2. To ignore SSL cert errors: <configuration> <args> <arg>... 3. To resolve class name conflict ("Use a class customization to resolve this conflict" error): <configuration> <args> <arg>-B-Xaut...
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 zhidao on January 23, 2012 15:00:19    Last update: January 23, 2012 15:00:19
The domain object is annotated @Entity , but Java runtime complains that it's not an entity class. Cause: : class not listed in persistence.xml , or persistence.xml misplaced, or multiple persistence.xml files existed.
Created by zhidao on January 23, 2012 14:58:58    Last update: January 23, 2012 14:58:58
This exception occurs when the Java object attribute is of type String, while the database column is of type CHAR(n), and hibernate.hbm2ddl.auto is validate in persistence.xml . There are two solutions: Add columnDefinition to the @Column annotation: @Column(name = “STATE_CODE”, columnDefinition = “c... Remove hibernate.hbm2ddl.auto from persistence.xml .
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 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 freyo on September 07, 2011 16:46:14    Last update: September 07, 2011 19:23:00
The Android unit test framework is based on JUnit 3 , not JUnit 4. Test cases have to extend junit.framework.TestCase or a subclass (such as android.test.InstrumentationTestCase ). Tests are identified by public methods whose name starts with test , not methods annotated with @Test (as in JUnit 4). An Android test suite is packaged as an APK, just like the application being tested. To create a test package, first you need to identify the application package it is testing. Google suggests to put the test package source in a directory named tests/ alongside the src/ directory of the main application. At runtime, Android instrumentation loads both the test package and the application under test into the same process. Therefore, the tests can invoke methods on...
Created by freyo on August 31, 2011 15:49:54    Last update: August 31, 2011 15:49:54
Got this error while trying to build Android app: [apkbuilder] Creating AppInfo-debug-unaligned.ap... Solution: Delete the Android debug keystore: $ rm ~/.android/debug.keystore Build again: $ ant debug The new key is valid for 30 years (keystore password is 'android'): $ keytool -list -v -keystore ~/.android/debug.keys...
Created by freyo on May 17, 2011 11:13:17    Last update: May 17, 2011 11:13:17
This is an odd-ball content provider in that it doesn't provide database records, but provides a resource as a stream. It can be used to provide media files or XML resources. Start the project with: tools/android create project --package com.android... Create assets directory and add an XML file ( assets/demo.xml ): <? xml version="1.0" encoding="UTF-8"?> <people... Edit the layout ( res/layout/main.xml ): <?xml version="1.0" encoding="utf-8"?> <LinearL... Edit src/com/android/cptest/Dummy.java : package com.android.cptest; import java.io.... Add content provider ( src/com/android/cptest/XmlResource.java ): package com.android.cptest; import java.io.... Update AndroidManifest.xml : <?xml version="1.0" encoding="utf-8"?> <manifes... Add this section to the end of build.xml : <target name="-package-resources"> <ech... Build and install: ant install Screenshot: Remove the Dummy activity ( AndroidManifest.xml ): <?xml version="1.0" encoding="utf-8"?> <manifes... Create a new project for...
Previous  1 2 3 Next