• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

[SPRING] problem with oracle LOB

 
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I'm using Spring with Hibernate to do the DB-handling. Everything works fine except when I try to store a LOB object in the oracle DB.
I get the following DataAccessResourceFailureException which is in fact a wrapper for a [java.rmi.MarshalException] :


First of all I am using : Spring 1.1.1, Weblogic 8.1sp3, oracle 9i, oracle driver = oracle.jdbc.xa.client.OracleXADataSource

Here's what I have in the applicationContext concerning hibernate and transactions :


Is the problem the driver [oracle.jdbc.xa.client.OracleXADataSource] I'm using or the fact that I'm testing this via Junit which extend AbstractSpringContextTests ?

Any help is highly appreciated and if you need more info let me know !

Thanks.

Kristof
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Kristoff,

Did you check that you have the correct oracle drivers for oracle 9 in your classpath? I believe this is classes12.zip for jdk1.2 and jdk1.3 and ojdbc14.jar for jdk1.4.

And do you really need an XADataSource? Because (maybe you already know this) this is only necessary when your transaction have to deal with multiple databases. Otherwise you should just use the non XA datasource.

Hope this helps you in someway,
Lars
 
Kristof Camelbeke
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi lars,

Thanks for the info.
I'm using JDK1.4 and the oracle driver used in the client application is :
odjbc14_g.jar. If I use the odjbc14.jar I get an 'java.lang.ArrayIndexOutOfBoundsException' so it's still not working.

Kristof
 
Lars Vonk
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does the stacktrace of the ArrayIndexOutOfBounds gives you more information about where this exception occurs?
Maybe you can try to insert a LOB with the driver jar in a standalone application to verify it works without WebLogic, Hibernate and Spring.

What i find strange is that in your first post the cause of the Exception was


Caused by: weblogic.rmi.extensions.RemoteRuntimeException: Unexpected Exception - with nested exception:[java.rmi.MarshalException: error marshalling return; nested exception is: java.io.NotSerializableException: oracle.jdbc.driver.LogicalConnection]



I cannot find this class (oracle.jdbc.driver.LogicalConnection) in the jdbc driver jars, also a google search came up with nothing. Is this a generated class or so?

Regards,
Lars
 
Kristof Camelbeke
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello...

I don't know, I'm just using the ojdbc14_g.jar and it's not in there like you said...

I've tried something else instead of working with WebLogicNativeJdbcExtractor


I now work with the SimpleNativeJdbcExtractor :

and this gives me another error :


and in my Spring logging I see a message of dehydrating entity and then "the Connection [null] for given Connection handle"



BTW thanks for looking into this ! :-)
 
Lars Vonk
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Kristof,

I did some more research and maybe found something interesting information concerning the SimpleNativeJdbcExtractor you use as nativeJdbcExtractor.
In the javadocs of the SimpleNativeJdbcExtractor it says:

This extractor should work with any pool that does not wrap DatabaseMetaData, and will also work with any plain JDBC driver. Note that a pool can still wrap Statements, PreparedStatements, etc: The only requirement of this extractor is that java.sql.DatabaseMetaData does not get wrapped, returning the native Connection of the JDBC driver on metaData.getConnection().


The 'interesting information' here is the fact that it states that if you want to use this class the java.sql.DatabaseMetaData does not get wrapped and returns the native Connection of the JDBC driver on metaData.getConnection().
In your case it apparently doesn't because it is returning null after invoking the getMetaData().getConnection() in the method doGetNativeConnection of the class SimpleNativeJdbcExtractor. If you look into this method you'll see the DEBUG statement 'Returning native Connection [null] for given ....' being called there.
Why the WebLogicNativeJdbcExtractor failes, I do not know (I have never worked with Weblogic). But my guess (and I am just guessing here...) is that it is on the same point (also the method doGetNativeConnection of the class WebLogicNativeJdbcExtractor. What I find strange in the exception trace is that the figure 813 is in the name of the connection implementation class of Weblogic.

Maybe this is refering to an older Oracle version 8.1.3? Maybe there is an older oracle driver jar/zip or something like that in the classpath or libpath, or maybe the jdbc/native drivers of weblogic need to be upgraded?

Good luck!
 
Clowns were never meant to be THAT big! We must destroy it with this tiny ad:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic