Posts

Showing posts from September, 2010

java.lang.AbstractMethodError: org.apache.xerces.dom.DocumentImpl.getXmlStandalone()Z

If you are facing this issue than most probably have a wrong version of XercesImpl.jar file I had a 2.0.2 version, which causing conflict. Replacing it with 2.8.1 resolved the issue.

com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value:

This error may crop up if you are doing any DML operation through IN clause. Example String sql = 'update table set status = true where id in (?)' If you are using the above statement as part of the prepared statement and the 'id' column is of long type. Following would give this error. String str = "1,2,3,4"; PreparedStatement stmt = connection.prepareStatement(sql); stmt.setString(1, str); stmt.executeUpdate(); The last line would give the error. Reason being that the column is of Long(BIGINT) type and value is passed as string. You cannot say stmt.setLong(1, str); as the 'str' contains comma separated values. One of the solution in this case is to create separate place holders for each input value String sql = 'update table set status = true where id in (?,?,?,?)' in this case and pass individual long values to the statement object. Other options are welcome.

Core Dump and Stack Tace on Linux of a Java process

Steps for taking the Core Dump Run the command # ps -ef | grep java get the process id of the java process you want to get the core dump. Next run the command # gdb --pid= Next gdb>gcore This should create a file core. in the /var/tmp location Remember its a binary file. If I find some other better way to take the dump, I would update. If you know other ways please let me know. Steps fr taking the stack Trace jstack [-l] pid (simple) Difference between core dump and Stack Trace Core dump prints the complete memory map of a process and stack trace prints the state of threads of a processs.