Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Gireesh Mulage
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Gireesh Mulage
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you are trying to bind a database connection to JNDI? Why are you doing that?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic