Recent Notes
Displaying keyword search results 81 - 90
Created by Dr. Xi on June 11, 2010 23:11:59
Last update: June 11, 2010 23:14:02
Given a simple XML file like this:
<?xml version="1.0"?> <root id="1"> ... Calling Document.getElementById returns null (surprisingly!): import java.io.*; import org.w3c.dom.*; impo... In fact the JavaDoc says something along the lines that getElementById returns the Element that has an ID attribute with the given value. An attribute with the name "ID" or "id" is not of type ID unless it is so defined. How is an attribute defined as an ID attribute ? With a DTD or schema. If you are not validating the XML, then the API is useless. So, what to do if you want to find an element for which the attribute named "id" has a given value? Several options were offered in GetElementById Pitfalls . One of them is to...
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...
Created by voodoo on April 01, 2010 04:28:04
Last update: April 01, 2010 04:37:32
You were tempted by "my fun cards" and installed "my web search" on your computer. Although some people say "my web search" is harmless, but still it behaved scary. So you want to uninstall it. You click the "Add/Remove Programs" and removed the "my web search" toolbar. But then when you type in things in the Firefox address bar you find that it still brings up "my web search"! Here's how to get rid of it: Enter "about:config" in the address bar (and promise that you'll be careful). Enter "myweb" in the filter box Reset browser.search.selectedEngine and keyword.URL , extensions.mywebsearch.openSearchURL , extensions.mywebsearch.prevKwdEnabled , and extensions.mywebsearch.prevKwdURL . The extensions.mywebsearch.* settings will be removed after Firefox restart. The parameter that affects the address bar search is keyword.URL...
Created by Dr. Xi on March 31, 2010 19:32:42
Last update: March 31, 2010 19:41:14
The dev database keeps locking up because of failed login attempts. For a dev database, we really don't need such security measure. This is how to remove the limit.
Log in as sysdba
sqlplus sys@xe as sysdba
Find out the profile for the user.
SQL> select profile from dba_users where username ...
Look at the current limits
SQL> select resource_name, limit from dba_profiles...
Increase the value for failed login attempts
SQL> alter profile default limit failed_login_atte...
Created by Dr. Xi on March 31, 2010 19:18:33
Last update: March 31, 2010 19:18:33
Query the dba_users view to find locked accounts.
SQL> select username, account_status, lock_dat...
Created by Dr. Xi on March 31, 2010 15:35:53
Last update: March 31, 2010 15:35:53
DBA_BLOCKERS displays a session if it is not waiting for a locked object but is holding a lock on an object for which another session is waiting.
Column Datatype Description
HOLDING_SESSION NUMBER Session holding a lock
SQL> select * from dba_blockers;
HOLDIN...
Created by Dr. Xi on March 31, 2010 15:14:39
Last update: March 31, 2010 15:17:46
DBA_WAITERS shows all the sessions that are waiting for a lock.
Column Datatype Description
WAITING_SESSION NUMBER The waiting session
HOLDING_SESSION NUMBER The holding session
LOCK_TYPE VARCHAR2(26) The lock type
MODE_HELD VARCHAR2(40) The mode held
MODE_REQUESTED VARCHAR2(40) The mode requested
LOCK_ID1 VARCHAR2(40) Lock ID 1
LOCK_ID2 VARCHAR2(40) Lock ID 2
SQL> set lin 120
SQL> select * from dba_wai...
Or join the v$session view to find out who it is:
select w.waiting_session, w.mode_requested, s.user...
Created by Fang on March 22, 2010 02:55:04
Last update: March 22, 2010 03:48:55
If you followed the steps in Start a Java EE application with Maven , you'll arrive at an EAR file that's ready to be deployed. However, if you look carefully, you'll find that the ejb-1.0.jar file is included in the EAR file twice : once as the ejb module of the EAR, another time under the WEB-INF/lib folder of webapp-1.0.war . The second is brought about by specifying the ejb project as a dependency in the webapp POM. Actually, the webapp project is dependent on the ejb project as an EJB client. So we should have been more accurate by specifying the type of dependency as ejb-client , not ejb : Edit webapp/pom.xml , change the ejb dependency to ejb-client :
<project> <modelVersion>4.0.0</modelVersion... Update ejb/pom.xml...
Created by Dr. Xi on March 22, 2010 01:50:49
Last update: March 22, 2010 01:50:49
The class org.apache.xerces.jaxp.SAXParserFactoryImpl extends javax.xml.parsers.SAXParserFactory , so casting the former to the latter should not be a problem. This error occurs when there are two copies of javax.xml.parsers.SAXParserFactory loaded by two different class loaders, and you are trying to cast one to the other.
Normally, you'll be able to find xml-apis.jar under WEB-INF/lib of the WAR file. Deleting the jar will resolve the problem.
java.lang.ClassCastException: org.apache.xerces.ja...
Created by Dr. Xi on March 18, 2010 21:37:41
Last update: March 18, 2010 21:37:41
You run an update and it hangs. Use this query to find out who's locking the table.
select
o.object_type,
o.object_nam...