Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JBoss/WildFly and the fly likes NotSerializableException: oracle.jdbc.driver.OracleConnection while binding connection obj to JNDI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "NotSerializableException: oracle.jdbc.driver.OracleConnection while binding connection obj to JNDI" Watch "NotSerializableException: oracle.jdbc.driver.OracleConnection while binding connection obj to JNDI" New topic
Author

NotSerializableException: oracle.jdbc.driver.OracleConnection while binding connection obj to JNDI

Gireesh Mulage
Ranch Hand

Joined: Mar 08, 2010
Posts: 44
Hi All ,

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.

Why error is coming only in Jboss ?

Please help me on this.

Thanks
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

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.


JBoss In Action
Gireesh Mulage
Ranch Hand

Joined: Mar 08, 2010
Posts: 44
Thank you for your reply.

Exactly , the con.getClass() is giving OracleConnection . How can I solve this issue? any other options ?

Thanks.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

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.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9956
    
163

So you are trying to bind a database connection to JNDI? Why are you doing that?

[My Blog] [JavaRanch Journal]
 
 
subject: NotSerializableException: oracle.jdbc.driver.OracleConnection while binding connection obj to JNDI
 
Similar Threads
No JNDI name found in EJB
NotSerializableException: oracle.jdbc.driver.OracleConnection while binding connection obj to JNDI
Error on WSADServer startup
JNDI - CMP Factory Connection Binding
setAttribute method not found