This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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: 5823
    
    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: 5823
    
    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: 10067
    
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