Quantcast

ClassCastException jdbc:embedded-database w/ mybatis 3.1/ mybatis-spring 1.1 ?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

ClassCastException jdbc:embedded-database w/ mybatis 3.1/ mybatis-spring 1.1 ?

Rick R
This isn't too big of a deal, since in real life I'm obviously not
using an embedded DB, but for mocking out an example I was going to
use jdbc:embedded-database (which worked just find in 3.0 and 1.0.2),
yet I'm now getting this root cause of an error on startup:

Caused by: java.lang.ClassCastException:
org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactoryBean$$EnhancerByCGLIB$$e02b816f
cannot be cast to javax.sql.DataSource

Any ideas why upgrading to the latest snapshots would cause the
jdbc:embedded-database config to bomb out? I'm using the following
cglib dependency:

<dependency>
        <groupId>cglib</groupId>
        <artifactId>cglib-nodep</artifactId>
        <version>2.2.2</version>
</dependency>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: ClassCastException jdbc:embedded-database w/ mybatis 3.1/ mybatis-spring 1.1 ?

Eduardo Macarron
EmbeddedDatabaseFactoryBean is not a DataSource but a datasource
factory so the error looks reasonable but.. Are you sure this is just
caused by the version upgrade? Could you post the full stacktrace?

2012/3/5 Rick R <[hidden email]>:

> This isn't too big of a deal, since in real life I'm obviously not
> using an embedded DB, but for mocking out an example I was going to
> use jdbc:embedded-database (which worked just find in 3.0 and 1.0.2),
> yet I'm now getting this root cause of an error on startup:
>
> Caused by: java.lang.ClassCastException:
> org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactoryBean$$EnhancerByCGLIB$$e02b816f
> cannot be cast to javax.sql.DataSource
>
> Any ideas why upgrading to the latest snapshots would cause the
> jdbc:embedded-database config to bomb out? I'm using the following
> cglib dependency:
>
> <dependency>
>        <groupId>cglib</groupId>
>        <artifactId>cglib-nodep</artifactId>
>        <version>2.2.2</version>
> </dependency>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[closed] Re: ClassCastException jdbc:embedded-database w/ mybatis 3.1/ mybatis-spring 1.1 ?

Rick R
On Mon, Mar 5, 2012 at 12:43 AM, Eduardo Macarron
<[hidden email]> wrote:
> EmbeddedDatabaseFactoryBean is not a DataSource but a datasource
> factory so the error looks reasonable but.. Are you sure this is just
> caused by the version upgrade? Could you post the full stacktrace?

Of course today I started doing more work and it's working just fine.
Sadly, not sure what changes I put in place since then to make it
work, but no issues now so ignore this post. Thanks.


> 2012/3/5 Rick R <[hidden email]>:
>> This isn't too big of a deal, since in real life I'm obviously not
>> using an embedded DB, but for mocking out an example I was going to
>> use jdbc:embedded-database (which worked just find in 3.0 and 1.0.2),
>> yet I'm now getting this root cause of an error on startup:
>>
>> Caused by: java.lang.ClassCastException:
>> org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactoryBean$$EnhancerByCGLIB$$e02b816f
>> cannot be cast to javax.sql.DataSource
>>
>> Any ideas why upgrading to the latest snapshots would cause the
>> jdbc:embedded-database config to bomb out? I'm using the following
>> cglib dependency:
>>
>> <dependency>
>>        <groupId>cglib</groupId>
>>        <artifactId>cglib-nodep</artifactId>
>>        <version>2.2.2</version>
>> </dependency>



--
Rick R
Loading...