|
From: <bro...@ya...> - 2004-05-31 21:58:39
|
Hi,
Just tried with SimpleNativeJdbcExtractor using the
latest spring.jar from cvs :-) I am including my
context-jdbc.xml, it may shed some light as to what i
am doing wrong..
<bean id="dataSource"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property
name="jndiName"><value>jdbc/TSDS</value></property>
</bean>
<bean id="jdbcTemplate"
class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource"><ref
local="dataSource"/></property>
<property name="exceptionTranslator"><ref
bean="oracleSqlExceptionTranslator"/></property>
</bean>
<bean id="nativeJdbcExtractor"
class="org.springframework.jdbc.support.nativejdbc.SimpleNativeJdbcExtractor"
lazy-init="true"/>
<bean id="oracleLobHandler"
class="org.springframework.jdbc.support.lob.OracleLobHandler">
<property name="nativeJdbcExtractor"><ref
local="nativeJdbcExtractor"/></property>
</bean>
the error (after a complete clean, uninstall delete
all previous version)
org.springframework.dao.DataAccessResourceFailureException:
Could not create Oracle LOB; nested exception is
java.lang.ClassCastExcepti
on: null
java.lang.ClassCastException
at
oracle.jdbc.driver.OracleConnection.unwrapCompletely(OracleConnection.java:5090)
at
oracle.jdbc.driver.OracleConnection.physicalConnectionWithin(OracleConnection.java:5141)
at
oracle.sql.CLOB.createTemporary(CLOB.java:1009)
at
oracle.sql.CLOB.createTemporary(CLOB.java:956)
at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at
java.lang.reflect.Method.invoke(Method.java:324)
at
org.springframework.jdbc.support.lob.OracleLobHandler$OracleLobCreator.prepareLob(OracleLobHandler.java:383)
at
org.springframework.jdbc.support.lob.OracleLobHandler$OracleLobCreator.createLob(OracleLobHandler.java:336)
at
org.springframework.jdbc.support.lob.OracleLobHandler$OracleLobCreator.setClobAsString(OracleLobHandler.java:264)
Bronwen
--- tho...@tr... wrote: >
> I was finally able to reproduce the error in my own
> environment using Spring
> 1.0.1. I will try 1.0.2 (current CVS) and see what
> happens.
>
> Thomas
>
>
> Here is my stack trace:
>
>
org.springframework.dao.DataAccessResourceFailureException:
> Could not create
> Oracle LOB; nested exception is
> java.lang.ClassCastException: null
> java.lang.ClassCastException
> at
>
oracle.jdbc.driver.OracleConnection.unwrapCompletely(OracleConnection.java:5090)
> at
>
oracle.jdbc.driver.OracleConnection.physicalConnectionWithin(OracleConnection.java:5141)
> at
> oracle.sql.CLOB.createTemporary(CLOB.java:1009)
> at
> oracle.sql.CLOB.createTemporary(CLOB.java:956)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> at
>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at
> java.lang.reflect.Method.invoke(Method.java:324)
> at
>
org.springframework.jdbc.support.lob.OracleLobHandler$OracleLobCreator.prepareLob(OracleLobHandler.java:375)
> at
>
org.springframework.jdbc.support.lob.OracleLobHandler$OracleLobCreator.createLob(OracleLobHandler.java:327)
> at
>
org.springframework.jdbc.support.lob.OracleLobHandler$OracleLobCreator.setClobAsString(OracleLobHandler.java:255)
> at
>
org.buggybean.web.TestServlet.doGet(TestServlet.java:94)
> at
>
javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> at
>
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
>
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
> at
>
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
> at
>
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
> at
>
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350)
> at
>
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
> at
>
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
> at
>
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
> at
>
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
> at
>
weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
> at
>
weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
>
>
>
>
> Quoting "jürgen höller [werk3AT]"
> <jue...@we...>:
>
> > Changing the pool should just affect the
> NativeJdbcExtractor choice, =
> > i.e. a different bean wired to OracleLobHandler's
> "nativeJdbcExtractor" =
> > property.
> > =20
> > Give SimpleNativeJdbcExtractor a try with a
> Weblogic pool; there's a =
> > good chance that it will work, avoiding the need
> for a specific Weblogic =
> > implementation of the NativeJdbcExtractor
> interface.
> > =20
> > As of Spring 1.0.2, SimpleNativeJdbcExtractor will
> even work with =
> > Commons DBCP too, avoiding the need for a
> different NativeJdbcExtractor =
> > configuration when switching between Commons DBCP
> and another pool.
> > =20
> > Side note: The new version of
> SimpleNativeJdbcExtractor will also work =
> > with C3P0. This allows the use of C3P0's
> ComboPooledDataSource as direct =
> > replacement of Commons DBCP's BasicDataSource.
> > =20
> > Juergen
> > =20
> >
> > ________________________________
> >
> > Von:
>
spr...@li...
> im Auftrag =
> > von Bronwen Cassidy
> > Gesendet: Mo 31.05.2004 22:25
> > An:
> spr...@li...
> > Betreff: Re: [Springframework-developer] re:
> OracleLobCreator
> >
> >
> >
> > Hi
> > I have no concern as to the pool i use, i am
> actually
> > completely ignorant and have been blindly feeling
> my
> > way using the spring test cases, samples, docs and
> > some googling, until 4 months ago i had never used
> > oracle and until a week ago i did not need to do
> more
> > than work out db agnostic sql queries :-)
> >
> > so please i am more than happy to use weblogic
> pool,
> > which i am using when the app is deployed, hence
> the
> > test time passes and deploy time failures most
> > likely!! I am guessing the changes are needed in
> the
> > nativeJdbcExtractor class in the spring.xml needs
> to
> > point to a weblogic equivalent??
> >
> > --- Thomas Risberg <tho...@tr...>
> wrote:
> > > Since you are using the Commons DBCP rather than
> a
> > > WebLogic pool the
> > > issue is slightly different. We have to figure
> out
> > > why the connection
> > > returned from the DBCP pool is not unwrapped
> > > properly.
> > >
> > > Thomas
> > >
> > >
> > > Bronwen Cassidy wrote:
> > >
> > > >Thank-you Jurgen
> > > >This was the approach i had come to conclude as
> the
> > > >only difference between passing test case and
> > > failing
> > > >deployed app is the connection pool handled by
> > > >weblogic , ahh well another trip into the
> unknown,
> > > the
> > > >best part of being a developer ;-)
> > > >
> > > >regards
> > > >Bronwen
> > > >
> > > >--- j=FCrgen_h=F6ller_[werk3AT]
> > > ><jue...@we...> wrote: >
> > > >OracleLobHandler needs to work on a native
> > > >=20
> > > >
> > > >>OracleConnection as it comes from the driver.
> The
> > > >>usual problem in that respect is not the
> driver
> > > but
> > > >>the connection pool: Every connection pool
> needs
> > > to
> > > >>wrap native connections with pooled
> connections
> > > that
> > > >>at least have different closing behavior.
> > > >>
> > > >>To address this, OracleLobHandler has the
> > > >>"nativeJdbcExtractor" property, taking an
> > > >>implementation of Spring's NativeJdbcExtractor
> > > >>interface. Spring includes out-of-the-box
> > > >>implementations for Commons DBCP, XAPool, and
> > > JBoss.
> > > >>I guess what you need to do is write such an
> > > >>extractor for Weblogic.
> > > >>
> > > >>What's odd about your exception is that
> > > >>OracleLobCreator does not complain that it
> doesn't
> > > >>receive an OracleConnection (there's an
> explicit
> > > >>check in there). It seems to get a wrapped
> > > >>connection that is still assignable to
>
=== message truncated ===
____________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping"
your friends today! Download Messenger Now
http://uk.messenger.yahoo.com/download/index.html
|