I am getting java.io.NotSerializableException: oracle.jdbc.driver.OracleConnection exception while binding connection obj to JNDI. I was not getting this error in apache-tomcat-6.0.20.
Here is a guess: you actually do not have an OracleConnection object, but rather a JBoss-specific wrapper around the OracleConnection object, and that wrapper is not serializable. You can verify the object type by logging the result of calling the getClass() method on the connection object.
I guess that OracleConnection is not a serializable class. I have no idea why JBoss wants to serialize it. You might have to dig through the JBoss source code (in the classes mentioned in the stack trace) to find out what is going on.