Recent Notes
Displaying notes 51 - 60
Created by Fang on January 04, 2012 08:56:13
Last update: January 04, 2012 09:01:08
You need both the bean validation API and implementation for JSR303 bean validations to work with Tomcat. Add both as dependencies in Maven pom.xml ( hibernate-validator is the reference impl):
<dependencies>
<dependency>
<groupId>o...
Created by voodoo on January 03, 2012 08:41:21
Last update: January 03, 2012 08:41:21
This is the command to print all regular files in the src folder but excluding all files within the .svn folders:
$ find src -name .svn -prune -o -type f -print
where -o is the or operator.
Created by zhidao on January 02, 2012 15:17:43
Last update: January 03, 2012 07:18:15
SCIM is needed to input Chinese in Ubuntu.
Install the needed packages:
$ sudo apt-get install scim-qtimm im-switch scim-p...
Goto "System Settings": click the "gear" icon at top right corner and select "System Settings..."
Click "Language Support"
Select scim for "Keyboard input method system"
Log out and log back in.
Switch between input methods with CTRL+Space
A list of available input methods is available from: http://www.scim-im.org/projects/imengines
Created by nogeek on December 30, 2011 13:25:28
Last update: December 30, 2011 13:57:37
By default, tomcat uses an enhanced java.util.logging implementation called JULI, which can be configured at two different levels: Globally, with the ${catalina.base}/conf/logging.properties file. Per web application, with WEB-INF/classes/logging.properties . The configuration file is a normal Java properties file: Logging handlers are specified with the handlers property.
handlers = 1catalina.org.apache.juli.FileHandler, ... The root logger can define its set of handlers using the .handlers property. .handlers = 1catalina.org.apache.juli.FileHandler,... A prefix may be added to handler names. The prefix starts with a digit and ends with a dot ( . ), for example: # 1catalina. is a prefix 1catalina.org.apache.j... System property replacement is performed for property values which contain ${systemPropertyName} . Each handler can have its own specific properties: 3manager.org.apache.juli.FileHandler.level = FINE ... Loggers can define their own...
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 December 29, 2011 13:31:44
Last update: December 29, 2011 14:29:13
Tomcat allows you to create multiple server instances for the same installation. The installation directory is identified as CATALINA_HOME , the instance directory is identified as CATALINA_BASE . Here are the steps: Create a base directory for the new instance, for example: /home/nogeek/tomcat1 . Create the subdirectories:
mkdir -p /home/nogeek/tomcat/{bin,conf,logs,temp,w... Copy web.xml from the installation directory: cp $CATALINA_HOME/conf/web.xml /home/nogeek/tomcat... Copy logging.properties from the installation directory: cp $CATALINA_HOME/conf/logging.properties /home/no... Create server.xml under tomcat1/conf : <?xml version='1.0' encoding='utf-8'?> <Server ... Create script setenv.sh under tomcat1/bin : # Edit this file to set custom options # Tomcat... Copy startup.sh and shutdown.sh from the installation directory. Add the following two lines to the beginning of each: CATALINA_BASE=/home/nogeek/tomcat1 export CATAL... Create a soft link for catalina.sh in tomcat1/bin : $ ln -s ~/apache-tomcat-7.0.22/bin/catalina.sh cat...
Created by woolf on December 29, 2011 11:47:37
Last update: December 29, 2011 11:48:11
My Dell laptop wasn't able to use an external monitor after a week's vacation. The symptoms were:
No response when pressing Fn+F8 to swtich displays.
"No signal" on external monitor.
Bring up "Screen Resolution" dialog, only one monitor is avaiable.
Click "Advanced settings" in "Screen Resolution" dialog, Adapter Type displays "VgaSave".
There's no "Display adapters" section in Device Manager .
Solution: re-install the video display driver. My laptop came with Nvidia GPU so I reinstalled the Nvidia driver. Download the driver pack from Dell. The Windows 7 CAB file is about 1GB, which indludes all kinds of drivers.
Created by woolf on December 29, 2011 11:18:11
Last update: December 29, 2011 11:18:11
Use the expand command to extract files from a .cab file:
expand [-r] source [destination] [-d source.cab ... Option Description [-r] Renames expanded files. [destination] Specifies where files are to be expanded. If source is multiple files and -r is not specified, destination must be a directory. destination can consist of a drive letter and colon, a directory name, a file name, or a combination of any of these. [-d source.cab] Displays a list of files in the source location. Does not expand or extract the files. [-f:files] Specifies the files in a cabinet (.cab) file that you intend to expand. You can use wildcards (* and ?). source.cab Specifies the files to expand. source can consist of a drive letter and colon, a directory...
Created by woolf on December 29, 2011 10:12:53
Last update: December 29, 2011 10:14:17
To identify the display driver info with the DirectX Diagnostic Tool included in Widnows 7 and Vista:
Bring up the "Run" dialog with the Win button
Type dxdiag and press Enter.
Click the Diaplay tab.
Created by woolf on December 11, 2011 13:38:58
Last update: December 11, 2011 13:38:58
Install usb.essentials . Package usbutils is optional.
# opkg update
# opkg install kmod-usb2
# opk...
Install usb printer support:
# opkg install kmod-usb-printer
Install p910nd print server:
# opkg install p910nd
Edit /etc/config/p910nd :
config p910nd
option device /dev...
Configure firewall to allow port 9100 ( /etc/config/firewall ):
# Allow printer
con...
If clients are connecting from wan then the first line should be:
option src wan
Enable automatic start of print server when router boots:
#/etc/init.d/p910nd enable
Restart router:
# reboot