Bug in apache beanutils – BeanUtils.copyProperties – unintended null to 0 conversion for Wrapper classes

BeanUtils.copyProperties(dest,source);

In the above code if the dest has null values for ‘Long’ fields, and source has null values too, during copying of properties, it dumps the value ‘ new Long(0)’ into the dest bean. This has serious issues when that bean is used to persist the values in database as null is different from 0.

JDBC Datasource issues with Tomcat 6.0.18 after reload – Cannot create JDBC driver of class

I started receiving this weird connection pool issues with Tomcat after I did a reload of a webapp using the Reload ant task.

Caused by: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class ‘oracle.jdbc.OracleDriver’ for connect URL ‘jdbc:oracle:thin:@witte-xp.biperf.com:1521:XE’
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)

Looks like there are some issues with Tomcat classloader after a reload. So I put in the ojdbc14.jar under WEB-INF/lib directory of the webapp and it fixed the issue.

JTA with Tomcat – don’t include jta.jar in web-inf/lib

When you use the objectweb JTA implimentation in tomcat, don’t include any jta.jar file under web-inf/lib directory as that will take precedence over the ObjectWeb implimentation and will cause issues when you try to obtain a TransactionManager.