You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Joshua Daniel <jo...@gmail.com> on 2009/10/09 11:24:05 UTC

Not supported by BasicDataSource

Hi,

I am trying to unit test a simple JBoss Seam component exposed as a
stateless session bean. I get this error on object lookup. Not sure what
additional configuration is needed to get this running (Note: I have tried
this with openejb-core 3.1.1 as well as with 3.1.2-SNAPSHOT with the same
error output).
Any pointers to resolve this issue is deeply appreciated.


Caused by: org.apache.openejb.OpenEJBException: java.lang.UnsupportedOperat
ionException: Not supported by BasicDataSource: Not supported by BasicDataS
ource
        at org.apache.openejb.assembler.classic.Assembler.createApplication
(Assembler.java:487)
        ... 37 more
Caused by: java.lang.UnsupportedOperationException: Not supported by BasicD
ataSource
        at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataS
ource.java:902)
        at org.hibernate.ejb.connection.InjectedDataSourceConnectionProvide
r.getConnection(InjectedDataSourceConnectionProvider.java:43)
        at org.hibernate.tool.hbm2ddl.SuppliedConnectionProviderConnectionH
elper.prepare(SuppliedConnectionProviderConnectionHelper.java:51)
        at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValida
tor.java:130)
        at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.
java:349)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuratio
n.java:1327)
        at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(An
notationConfiguration.java:867)
        at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ej
b3Configuration.java:669)
        at org.hibernate.ejb.HibernatePersistence.createContainerEntityMana
gerFactory(HibernatePersistence.java:132)
        at org.apache.openejb.assembler.classic.PersistenceBuilder.createEn
tityManagerFactory(PersistenceBuilder.java:183)
        at org.apache.openejb.assembler.classic.Assembler.createApplication
(Assembler.java:482)

Re: Not supported by BasicDataSource

Posted by Joshua Daniel <jo...@gmail.com>.
Thanks David & John for the inputs. For the time being, I made the
hbm2ddl.auto variable to "none" to get past this issue.

On Sat, Oct 10, 2009 at 6:17 AM, John D. Ament <my...@gmail.com> wrote:

> It's actually the hbm2ddl tool that's doing this.  Is it possible to use
> hibernate's c3po inside of openejb?
>
> -----Original Message-----
> From: David Blevins [mailto:david.blevins@visi.com]
> Sent: Friday, October 09, 2009 8:39 PM
> To: users@openejb.apache.org
> Subject: Re: Not supported by BasicDataSource
>
>
> On Oct 9, 2009, at 2:24 AM, Joshua Daniel wrote:
>
> > Hi,
> >
> > I am trying to unit test a simple JBoss Seam component exposed as a
> > stateless session bean. I get this error on object lookup. Not sure
> > what
> > additional configuration is needed to get this running (Note: I have
> > tried
> > this with openejb-core 3.1.1 as well as with 3.1.2-SNAPSHOT with the
> > same
> > error output).
> > Any pointers to resolve this issue is deeply appreciated.
> >
> >
> > Caused by: org.apache.openejb.OpenEJBException:
> > java.lang.UnsupportedOperat
> > ionException: Not supported by BasicDataSource: Not supported by
> > BasicDataS
> > ource
> >        at
> > org.apache.openejb.assembler.classic.Assembler.createApplication
> > (Assembler.java:487)
> >        ... 37 more
> > Caused by: java.lang.UnsupportedOperationException: Not supported by
> > BasicD
> > ataSource
> >        at
> > org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataS
> > ource.java:902)
>
> Seems like the Seam code is calling the 'getConnection(String
> username, String password)' method on the DataSource, which isn't
> supported as the DataSource isn't a real datasource but a reference to
> a database connection pool.  I.e. calling getConnection doesn't create
> any connections, it just gets you a handle to a connection from the
> pool or a reference the connection that's already being used in the
> transaction (if one exists).  The username and password are configured
> with the pool itself.
>
> Do you know if it's possible to get Seam to use the regular
> DataSource.getConnection() method?
>
> -David
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.5.421 / Virus Database: 270.14.9/2426 - Release Date: 10/09/09
> 18:43:00
>
>

RE: Not supported by BasicDataSource

Posted by "John D. Ament" <my...@gmail.com>.
It's actually the hbm2ddl tool that's doing this.  Is it possible to use
hibernate's c3po inside of openejb?

-----Original Message-----
From: David Blevins [mailto:david.blevins@visi.com] 
Sent: Friday, October 09, 2009 8:39 PM
To: users@openejb.apache.org
Subject: Re: Not supported by BasicDataSource


On Oct 9, 2009, at 2:24 AM, Joshua Daniel wrote:

> Hi,
>
> I am trying to unit test a simple JBoss Seam component exposed as a
> stateless session bean. I get this error on object lookup. Not sure  
> what
> additional configuration is needed to get this running (Note: I have  
> tried
> this with openejb-core 3.1.1 as well as with 3.1.2-SNAPSHOT with the  
> same
> error output).
> Any pointers to resolve this issue is deeply appreciated.
>
>
> Caused by: org.apache.openejb.OpenEJBException:  
> java.lang.UnsupportedOperat
> ionException: Not supported by BasicDataSource: Not supported by  
> BasicDataS
> ource
>        at  
> org.apache.openejb.assembler.classic.Assembler.createApplication
> (Assembler.java:487)
>        ... 37 more
> Caused by: java.lang.UnsupportedOperationException: Not supported by  
> BasicD
> ataSource
>        at  
> org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataS
> ource.java:902)

Seems like the Seam code is calling the 'getConnection(String  
username, String password)' method on the DataSource, which isn't  
supported as the DataSource isn't a real datasource but a reference to  
a database connection pool.  I.e. calling getConnection doesn't create  
any connections, it just gets you a handle to a connection from the  
pool or a reference the connection that's already being used in the  
transaction (if one exists).  The username and password are configured  
with the pool itself.

Do you know if it's possible to get Seam to use the regular  
DataSource.getConnection() method?

-David


No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 8.5.421 / Virus Database: 270.14.9/2426 - Release Date: 10/09/09
18:43:00


Re: Not supported by BasicDataSource

Posted by David Blevins <da...@visi.com>.
On Oct 9, 2009, at 2:24 AM, Joshua Daniel wrote:

> Hi,
>
> I am trying to unit test a simple JBoss Seam component exposed as a
> stateless session bean. I get this error on object lookup. Not sure  
> what
> additional configuration is needed to get this running (Note: I have  
> tried
> this with openejb-core 3.1.1 as well as with 3.1.2-SNAPSHOT with the  
> same
> error output).
> Any pointers to resolve this issue is deeply appreciated.
>
>
> Caused by: org.apache.openejb.OpenEJBException:  
> java.lang.UnsupportedOperat
> ionException: Not supported by BasicDataSource: Not supported by  
> BasicDataS
> ource
>        at  
> org.apache.openejb.assembler.classic.Assembler.createApplication
> (Assembler.java:487)
>        ... 37 more
> Caused by: java.lang.UnsupportedOperationException: Not supported by  
> BasicD
> ataSource
>        at  
> org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataS
> ource.java:902)

Seems like the Seam code is calling the 'getConnection(String  
username, String password)' method on the DataSource, which isn't  
supported as the DataSource isn't a real datasource but a reference to  
a database connection pool.  I.e. calling getConnection doesn't create  
any connections, it just gets you a handle to a connection from the  
pool or a reference the connection that's already being used in the  
transaction (if one exists).  The username and password are configured  
with the pool itself.

Do you know if it's possible to get Seam to use the regular  
DataSource.getConnection() method?

-David