You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Felipe Jaekel <fk...@gmail.com> on 2014/09/15 20:43:03 UTC

Test DataSource not working

Hi,

I'm trying to create a MySQL test dataSource in TomEE 1.7.0+ like this:

 @BeforeClass public void setUp() throws Exception { final Properties
properties = new Properties();
properties.setProperty("openejb.embedded.remotable", "true");
properties.put("TissDataSource",
"new://Resource?type=javax.sql.DataSource");
properties.put("TissDataSource.JdbcDriver ", "com.mysql.jdbc.Driver");
properties.put("TissDataSource.JdbcUrl ", "jdbc:mysql://
192.168.1.249:3306/TISS"); properties.put("TissDataSource.JdbcUsername ",
"***"); properties.put("TissDataSource.JdbcPassword ", "***"); container =
EJBContainer.createEJBContainer(properties); }


But in the console I see this:

INFORMAÇÕES - Configuring Service(id=TissDataSource, type=Resource,
provider-id=Default JDBC Database)
INFORMAÇÕES - Creating TransactionManager(id=Default Transaction Manager)
INFORMAÇÕES - Creating SecurityService(id=Default Security Service)
INFORMAÇÕES - Creating Resource(id=TissDataSource)
ADVERTÊNCIA - Property "JdbcUsername " not supported by "TissDataSource"
ADVERTÊNCIA - Property "JdbcPassword " not supported by "TissDataSource"
ADVERTÊNCIA - Property "JdbcUrl " not supported by "TissDataSource"
ADVERTÊNCIA - Property "JdbcDriver " not supported by "TissDataSource"


And I run the test I get this:
java.sql.SQLException: invalid schema name: TISS
at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
at org.hsqldb.jdbc.JDBCPreparedStatement.<init>(Unknown Source)
at org.hsqldb.jdbc.JDBCConnection.prepareStatement(Unknown Source)
at
org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:508)
at
org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:508)
at
org.hibernate.engine.jdbc.internal.StatementPreparerImpl$2.doPrepare(StatementPreparerImpl.java:117)
at
org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:183)
... 98 more

Any ideas?

Thanks

Re: Test DataSource not working

Posted by Felipe Jaekel <fk...@gmail.com>.
There were extra spaces in the property names. They came with the template
I copied to use as base, don't remember where I found it.

Problem solved. Thanks

2014-09-15 17:23 GMT-03:00 Romain Manni-Bucau <rm...@gmail.com>:

> properties.put("TissDataSource", "new://Resource?type=DataSource");
> properties.put("TissDataSource.JdbcDriver", "com.mysql.jdbc.Driver");
> properties.put("TissDataSource.JdbcUrl",
> "jdbc:mysql://192.168.1.249:3306/TISS");
> properties.put("TissDataSource.UserName", "root");
> properties.put("TissDataSource.Password", "mlinuxspd");
>
> I let you find the issue, tip: that's not only the property name ;)
>
>
>
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
> 2014-09-15 22:03 GMT+02:00 Felipe Jaekel <fk...@gmail.com>:
> > https://dl.dropboxusercontent.com/u/66737052/TISSWS.zip
> >
> > I'm trying to run CalculatorTest.java with TestNG
> >
> > Thanks again
> >
> > 2014-09-15 16:15 GMT-03:00 Romain Manni-Bucau <rm...@gmail.com>:
> >
> >> can you reproduce it in a sample you can share?
> >>
> >>
> >> Romain Manni-Bucau
> >> Twitter: @rmannibucau
> >> Blog: http://rmannibucau.wordpress.com/
> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> >> Github: https://github.com/rmannibucau
> >>
> >>
> >> 2014-09-15 21:08 GMT+02:00 Felipe Jaekel <fk...@gmail.com>:
> >> > Made the changes, still getting the hsqldb dataSource =/
> >> >
> >> > properties.put("TissDataSource", "new://Resource?type=DataSource");
> >> > properties.put("TissDataSource.JdbcDriver ", "com.mysql.jdbc.Driver");
> >> > properties.put("TissDataSource.JdbcUrl ", "jdbc:mysql://
> >> > 192.168.1.249:3306/TISS");
> >> > properties.put("TissDataSource.UserName ", "***");
> >> > properties.put("TissDataSource.Password ", "***");
> >> >
> >> > INFORMAÇÕES - Configuring Service(id=TissDataSource, type=Resource,
> >> > provider-id=Default JDBC Database)
> >> > INFORMAÇÕES - Creating TransactionManager(id=Default Transaction
> Manager)
> >> > INFORMAÇÕES - Creating SecurityService(id=Default Security Service)
> >> > INFORMAÇÕES - Creating Resource(id=TissDataSource)
> >> > ADVERTÊNCIA - Property "UserName " not supported by "TissDataSource"
> >> > ADVERTÊNCIA - Property "JdbcUrl " not supported by "TissDataSource"
> >> > ADVERTÊNCIA - Property "JdbcDriver " not supported by "TissDataSource"
> >> > ADVERTÊNCIA - Property "Password " not supported by "TissDataSource"
> >> >
> >> > 2014-09-15 15:54 GMT-03:00 Romain Manni-Bucau <rmannibucau@gmail.com
> >:
> >> >
> >> >> Hi
> >> >>
> >> >> try type=DataSource
> >> >>
> >> >> + JdbcUsername etc are not all supported, That's Username for
> instance
> >> >>
> >> >> see http://tomee.apache.org/common-datasource-configurations.html
> and
> >> >> http://tomee.apache.org/datasource-config.html
> >> >>
> >> >>
> >> >> Romain Manni-Bucau
> >> >> Twitter: @rmannibucau
> >> >> Blog: http://rmannibucau.wordpress.com/
> >> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> >> >> Github: https://github.com/rmannibucau
> >> >>
> >> >>
> >> >> 2014-09-15 20:43 GMT+02:00 Felipe Jaekel <fk...@gmail.com>:
> >> >> > Hi,
> >> >> >
> >> >> > I'm trying to create a MySQL test dataSource in TomEE 1.7.0+ like
> >> this:
> >> >> >
> >> >> >  @BeforeClass public void setUp() throws Exception { final
> Properties
> >> >> > properties = new Properties();
> >> >> > properties.setProperty("openejb.embedded.remotable", "true");
> >> >> > properties.put("TissDataSource",
> >> >> > "new://Resource?type=javax.sql.DataSource");
> >> >> > properties.put("TissDataSource.JdbcDriver ",
> "com.mysql.jdbc.Driver");
> >> >> > properties.put("TissDataSource.JdbcUrl ", "jdbc:mysql://
> >> >> > 192.168.1.249:3306/TISS");
> >> properties.put("TissDataSource.JdbcUsername
> >> >> ",
> >> >> > "***"); properties.put("TissDataSource.JdbcPassword ", "***");
> >> container
> >> >> =
> >> >> > EJBContainer.createEJBContainer(properties); }
> >> >> >
> >> >> >
> >> >> > But in the console I see this:
> >> >> >
> >> >> > INFORMAÇÕES - Configuring Service(id=TissDataSource, type=Resource,
> >> >> > provider-id=Default JDBC Database)
> >> >> > INFORMAÇÕES - Creating TransactionManager(id=Default Transaction
> >> Manager)
> >> >> > INFORMAÇÕES - Creating SecurityService(id=Default Security Service)
> >> >> > INFORMAÇÕES - Creating Resource(id=TissDataSource)
> >> >> > ADVERTÊNCIA - Property "JdbcUsername " not supported by
> >> "TissDataSource"
> >> >> > ADVERTÊNCIA - Property "JdbcPassword " not supported by
> >> "TissDataSource"
> >> >> > ADVERTÊNCIA - Property "JdbcUrl " not supported by "TissDataSource"
> >> >> > ADVERTÊNCIA - Property "JdbcDriver " not supported by
> "TissDataSource"
> >> >> >
> >> >> >
> >> >> > And I run the test I get this:
> >> >> > java.sql.SQLException: invalid schema name: TISS
> >> >> > at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
> >> >> > at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
> >> >> > at org.hsqldb.jdbc.JDBCPreparedStatement.<init>(Unknown Source)
> >> >> > at org.hsqldb.jdbc.JDBCConnection.prepareStatement(Unknown Source)
> >> >> > at
> >> >> >
> >> >>
> >>
> org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:508)
> >> >> > at
> >> >> >
> >> >>
> >>
> org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:508)
> >> >> > at
> >> >> >
> >> >>
> >>
> org.hibernate.engine.jdbc.internal.StatementPreparerImpl$2.doPrepare(StatementPreparerImpl.java:117)
> >> >> > at
> >> >> >
> >> >>
> >>
> org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:183)
> >> >> > ... 98 more
> >> >> >
> >> >> > Any ideas?
> >> >> >
> >> >> > Thanks
> >> >>
> >>
>

Re: Test DataSource not working

Posted by Romain Manni-Bucau <rm...@gmail.com>.
properties.put("TissDataSource", "new://Resource?type=DataSource");
properties.put("TissDataSource.JdbcDriver", "com.mysql.jdbc.Driver");
properties.put("TissDataSource.JdbcUrl",
"jdbc:mysql://192.168.1.249:3306/TISS");
properties.put("TissDataSource.UserName", "root");
properties.put("TissDataSource.Password", "mlinuxspd");

I let you find the issue, tip: that's not only the property name ;)



Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau


2014-09-15 22:03 GMT+02:00 Felipe Jaekel <fk...@gmail.com>:
> https://dl.dropboxusercontent.com/u/66737052/TISSWS.zip
>
> I'm trying to run CalculatorTest.java with TestNG
>
> Thanks again
>
> 2014-09-15 16:15 GMT-03:00 Romain Manni-Bucau <rm...@gmail.com>:
>
>> can you reproduce it in a sample you can share?
>>
>>
>> Romain Manni-Bucau
>> Twitter: @rmannibucau
>> Blog: http://rmannibucau.wordpress.com/
>> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> Github: https://github.com/rmannibucau
>>
>>
>> 2014-09-15 21:08 GMT+02:00 Felipe Jaekel <fk...@gmail.com>:
>> > Made the changes, still getting the hsqldb dataSource =/
>> >
>> > properties.put("TissDataSource", "new://Resource?type=DataSource");
>> > properties.put("TissDataSource.JdbcDriver ", "com.mysql.jdbc.Driver");
>> > properties.put("TissDataSource.JdbcUrl ", "jdbc:mysql://
>> > 192.168.1.249:3306/TISS");
>> > properties.put("TissDataSource.UserName ", "***");
>> > properties.put("TissDataSource.Password ", "***");
>> >
>> > INFORMAÇÕES - Configuring Service(id=TissDataSource, type=Resource,
>> > provider-id=Default JDBC Database)
>> > INFORMAÇÕES - Creating TransactionManager(id=Default Transaction Manager)
>> > INFORMAÇÕES - Creating SecurityService(id=Default Security Service)
>> > INFORMAÇÕES - Creating Resource(id=TissDataSource)
>> > ADVERTÊNCIA - Property "UserName " not supported by "TissDataSource"
>> > ADVERTÊNCIA - Property "JdbcUrl " not supported by "TissDataSource"
>> > ADVERTÊNCIA - Property "JdbcDriver " not supported by "TissDataSource"
>> > ADVERTÊNCIA - Property "Password " not supported by "TissDataSource"
>> >
>> > 2014-09-15 15:54 GMT-03:00 Romain Manni-Bucau <rm...@gmail.com>:
>> >
>> >> Hi
>> >>
>> >> try type=DataSource
>> >>
>> >> + JdbcUsername etc are not all supported, That's Username for instance
>> >>
>> >> see http://tomee.apache.org/common-datasource-configurations.html and
>> >> http://tomee.apache.org/datasource-config.html
>> >>
>> >>
>> >> Romain Manni-Bucau
>> >> Twitter: @rmannibucau
>> >> Blog: http://rmannibucau.wordpress.com/
>> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> >> Github: https://github.com/rmannibucau
>> >>
>> >>
>> >> 2014-09-15 20:43 GMT+02:00 Felipe Jaekel <fk...@gmail.com>:
>> >> > Hi,
>> >> >
>> >> > I'm trying to create a MySQL test dataSource in TomEE 1.7.0+ like
>> this:
>> >> >
>> >> >  @BeforeClass public void setUp() throws Exception { final Properties
>> >> > properties = new Properties();
>> >> > properties.setProperty("openejb.embedded.remotable", "true");
>> >> > properties.put("TissDataSource",
>> >> > "new://Resource?type=javax.sql.DataSource");
>> >> > properties.put("TissDataSource.JdbcDriver ", "com.mysql.jdbc.Driver");
>> >> > properties.put("TissDataSource.JdbcUrl ", "jdbc:mysql://
>> >> > 192.168.1.249:3306/TISS");
>> properties.put("TissDataSource.JdbcUsername
>> >> ",
>> >> > "***"); properties.put("TissDataSource.JdbcPassword ", "***");
>> container
>> >> =
>> >> > EJBContainer.createEJBContainer(properties); }
>> >> >
>> >> >
>> >> > But in the console I see this:
>> >> >
>> >> > INFORMAÇÕES - Configuring Service(id=TissDataSource, type=Resource,
>> >> > provider-id=Default JDBC Database)
>> >> > INFORMAÇÕES - Creating TransactionManager(id=Default Transaction
>> Manager)
>> >> > INFORMAÇÕES - Creating SecurityService(id=Default Security Service)
>> >> > INFORMAÇÕES - Creating Resource(id=TissDataSource)
>> >> > ADVERTÊNCIA - Property "JdbcUsername " not supported by
>> "TissDataSource"
>> >> > ADVERTÊNCIA - Property "JdbcPassword " not supported by
>> "TissDataSource"
>> >> > ADVERTÊNCIA - Property "JdbcUrl " not supported by "TissDataSource"
>> >> > ADVERTÊNCIA - Property "JdbcDriver " not supported by "TissDataSource"
>> >> >
>> >> >
>> >> > And I run the test I get this:
>> >> > java.sql.SQLException: invalid schema name: TISS
>> >> > at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
>> >> > at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
>> >> > at org.hsqldb.jdbc.JDBCPreparedStatement.<init>(Unknown Source)
>> >> > at org.hsqldb.jdbc.JDBCConnection.prepareStatement(Unknown Source)
>> >> > at
>> >> >
>> >>
>> org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:508)
>> >> > at
>> >> >
>> >>
>> org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:508)
>> >> > at
>> >> >
>> >>
>> org.hibernate.engine.jdbc.internal.StatementPreparerImpl$2.doPrepare(StatementPreparerImpl.java:117)
>> >> > at
>> >> >
>> >>
>> org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:183)
>> >> > ... 98 more
>> >> >
>> >> > Any ideas?
>> >> >
>> >> > Thanks
>> >>
>>

Re: Test DataSource not working

Posted by Felipe Jaekel <fk...@gmail.com>.
https://dl.dropboxusercontent.com/u/66737052/TISSWS.zip

I'm trying to run CalculatorTest.java with TestNG

Thanks again

2014-09-15 16:15 GMT-03:00 Romain Manni-Bucau <rm...@gmail.com>:

> can you reproduce it in a sample you can share?
>
>
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
> 2014-09-15 21:08 GMT+02:00 Felipe Jaekel <fk...@gmail.com>:
> > Made the changes, still getting the hsqldb dataSource =/
> >
> > properties.put("TissDataSource", "new://Resource?type=DataSource");
> > properties.put("TissDataSource.JdbcDriver ", "com.mysql.jdbc.Driver");
> > properties.put("TissDataSource.JdbcUrl ", "jdbc:mysql://
> > 192.168.1.249:3306/TISS");
> > properties.put("TissDataSource.UserName ", "***");
> > properties.put("TissDataSource.Password ", "***");
> >
> > INFORMAÇÕES - Configuring Service(id=TissDataSource, type=Resource,
> > provider-id=Default JDBC Database)
> > INFORMAÇÕES - Creating TransactionManager(id=Default Transaction Manager)
> > INFORMAÇÕES - Creating SecurityService(id=Default Security Service)
> > INFORMAÇÕES - Creating Resource(id=TissDataSource)
> > ADVERTÊNCIA - Property "UserName " not supported by "TissDataSource"
> > ADVERTÊNCIA - Property "JdbcUrl " not supported by "TissDataSource"
> > ADVERTÊNCIA - Property "JdbcDriver " not supported by "TissDataSource"
> > ADVERTÊNCIA - Property "Password " not supported by "TissDataSource"
> >
> > 2014-09-15 15:54 GMT-03:00 Romain Manni-Bucau <rm...@gmail.com>:
> >
> >> Hi
> >>
> >> try type=DataSource
> >>
> >> + JdbcUsername etc are not all supported, That's Username for instance
> >>
> >> see http://tomee.apache.org/common-datasource-configurations.html and
> >> http://tomee.apache.org/datasource-config.html
> >>
> >>
> >> Romain Manni-Bucau
> >> Twitter: @rmannibucau
> >> Blog: http://rmannibucau.wordpress.com/
> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> >> Github: https://github.com/rmannibucau
> >>
> >>
> >> 2014-09-15 20:43 GMT+02:00 Felipe Jaekel <fk...@gmail.com>:
> >> > Hi,
> >> >
> >> > I'm trying to create a MySQL test dataSource in TomEE 1.7.0+ like
> this:
> >> >
> >> >  @BeforeClass public void setUp() throws Exception { final Properties
> >> > properties = new Properties();
> >> > properties.setProperty("openejb.embedded.remotable", "true");
> >> > properties.put("TissDataSource",
> >> > "new://Resource?type=javax.sql.DataSource");
> >> > properties.put("TissDataSource.JdbcDriver ", "com.mysql.jdbc.Driver");
> >> > properties.put("TissDataSource.JdbcUrl ", "jdbc:mysql://
> >> > 192.168.1.249:3306/TISS");
> properties.put("TissDataSource.JdbcUsername
> >> ",
> >> > "***"); properties.put("TissDataSource.JdbcPassword ", "***");
> container
> >> =
> >> > EJBContainer.createEJBContainer(properties); }
> >> >
> >> >
> >> > But in the console I see this:
> >> >
> >> > INFORMAÇÕES - Configuring Service(id=TissDataSource, type=Resource,
> >> > provider-id=Default JDBC Database)
> >> > INFORMAÇÕES - Creating TransactionManager(id=Default Transaction
> Manager)
> >> > INFORMAÇÕES - Creating SecurityService(id=Default Security Service)
> >> > INFORMAÇÕES - Creating Resource(id=TissDataSource)
> >> > ADVERTÊNCIA - Property "JdbcUsername " not supported by
> "TissDataSource"
> >> > ADVERTÊNCIA - Property "JdbcPassword " not supported by
> "TissDataSource"
> >> > ADVERTÊNCIA - Property "JdbcUrl " not supported by "TissDataSource"
> >> > ADVERTÊNCIA - Property "JdbcDriver " not supported by "TissDataSource"
> >> >
> >> >
> >> > And I run the test I get this:
> >> > java.sql.SQLException: invalid schema name: TISS
> >> > at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
> >> > at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
> >> > at org.hsqldb.jdbc.JDBCPreparedStatement.<init>(Unknown Source)
> >> > at org.hsqldb.jdbc.JDBCConnection.prepareStatement(Unknown Source)
> >> > at
> >> >
> >>
> org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:508)
> >> > at
> >> >
> >>
> org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:508)
> >> > at
> >> >
> >>
> org.hibernate.engine.jdbc.internal.StatementPreparerImpl$2.doPrepare(StatementPreparerImpl.java:117)
> >> > at
> >> >
> >>
> org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:183)
> >> > ... 98 more
> >> >
> >> > Any ideas?
> >> >
> >> > Thanks
> >>
>

Re: Test DataSource not working

Posted by Romain Manni-Bucau <rm...@gmail.com>.
can you reproduce it in a sample you can share?


Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau


2014-09-15 21:08 GMT+02:00 Felipe Jaekel <fk...@gmail.com>:
> Made the changes, still getting the hsqldb dataSource =/
>
> properties.put("TissDataSource", "new://Resource?type=DataSource");
> properties.put("TissDataSource.JdbcDriver ", "com.mysql.jdbc.Driver");
> properties.put("TissDataSource.JdbcUrl ", "jdbc:mysql://
> 192.168.1.249:3306/TISS");
> properties.put("TissDataSource.UserName ", "***");
> properties.put("TissDataSource.Password ", "***");
>
> INFORMAÇÕES - Configuring Service(id=TissDataSource, type=Resource,
> provider-id=Default JDBC Database)
> INFORMAÇÕES - Creating TransactionManager(id=Default Transaction Manager)
> INFORMAÇÕES - Creating SecurityService(id=Default Security Service)
> INFORMAÇÕES - Creating Resource(id=TissDataSource)
> ADVERTÊNCIA - Property "UserName " not supported by "TissDataSource"
> ADVERTÊNCIA - Property "JdbcUrl " not supported by "TissDataSource"
> ADVERTÊNCIA - Property "JdbcDriver " not supported by "TissDataSource"
> ADVERTÊNCIA - Property "Password " not supported by "TissDataSource"
>
> 2014-09-15 15:54 GMT-03:00 Romain Manni-Bucau <rm...@gmail.com>:
>
>> Hi
>>
>> try type=DataSource
>>
>> + JdbcUsername etc are not all supported, That's Username for instance
>>
>> see http://tomee.apache.org/common-datasource-configurations.html and
>> http://tomee.apache.org/datasource-config.html
>>
>>
>> Romain Manni-Bucau
>> Twitter: @rmannibucau
>> Blog: http://rmannibucau.wordpress.com/
>> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> Github: https://github.com/rmannibucau
>>
>>
>> 2014-09-15 20:43 GMT+02:00 Felipe Jaekel <fk...@gmail.com>:
>> > Hi,
>> >
>> > I'm trying to create a MySQL test dataSource in TomEE 1.7.0+ like this:
>> >
>> >  @BeforeClass public void setUp() throws Exception { final Properties
>> > properties = new Properties();
>> > properties.setProperty("openejb.embedded.remotable", "true");
>> > properties.put("TissDataSource",
>> > "new://Resource?type=javax.sql.DataSource");
>> > properties.put("TissDataSource.JdbcDriver ", "com.mysql.jdbc.Driver");
>> > properties.put("TissDataSource.JdbcUrl ", "jdbc:mysql://
>> > 192.168.1.249:3306/TISS"); properties.put("TissDataSource.JdbcUsername
>> ",
>> > "***"); properties.put("TissDataSource.JdbcPassword ", "***"); container
>> =
>> > EJBContainer.createEJBContainer(properties); }
>> >
>> >
>> > But in the console I see this:
>> >
>> > INFORMAÇÕES - Configuring Service(id=TissDataSource, type=Resource,
>> > provider-id=Default JDBC Database)
>> > INFORMAÇÕES - Creating TransactionManager(id=Default Transaction Manager)
>> > INFORMAÇÕES - Creating SecurityService(id=Default Security Service)
>> > INFORMAÇÕES - Creating Resource(id=TissDataSource)
>> > ADVERTÊNCIA - Property "JdbcUsername " not supported by "TissDataSource"
>> > ADVERTÊNCIA - Property "JdbcPassword " not supported by "TissDataSource"
>> > ADVERTÊNCIA - Property "JdbcUrl " not supported by "TissDataSource"
>> > ADVERTÊNCIA - Property "JdbcDriver " not supported by "TissDataSource"
>> >
>> >
>> > And I run the test I get this:
>> > java.sql.SQLException: invalid schema name: TISS
>> > at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
>> > at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
>> > at org.hsqldb.jdbc.JDBCPreparedStatement.<init>(Unknown Source)
>> > at org.hsqldb.jdbc.JDBCConnection.prepareStatement(Unknown Source)
>> > at
>> >
>> org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:508)
>> > at
>> >
>> org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:508)
>> > at
>> >
>> org.hibernate.engine.jdbc.internal.StatementPreparerImpl$2.doPrepare(StatementPreparerImpl.java:117)
>> > at
>> >
>> org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:183)
>> > ... 98 more
>> >
>> > Any ideas?
>> >
>> > Thanks
>>

Re: Test DataSource not working

Posted by Felipe Jaekel <fk...@gmail.com>.
Made the changes, still getting the hsqldb dataSource =/

properties.put("TissDataSource", "new://Resource?type=DataSource");
properties.put("TissDataSource.JdbcDriver ", "com.mysql.jdbc.Driver");
properties.put("TissDataSource.JdbcUrl ", "jdbc:mysql://
192.168.1.249:3306/TISS");
properties.put("TissDataSource.UserName ", "***");
properties.put("TissDataSource.Password ", "***");

INFORMAÇÕES - Configuring Service(id=TissDataSource, type=Resource,
provider-id=Default JDBC Database)
INFORMAÇÕES - Creating TransactionManager(id=Default Transaction Manager)
INFORMAÇÕES - Creating SecurityService(id=Default Security Service)
INFORMAÇÕES - Creating Resource(id=TissDataSource)
ADVERTÊNCIA - Property "UserName " not supported by "TissDataSource"
ADVERTÊNCIA - Property "JdbcUrl " not supported by "TissDataSource"
ADVERTÊNCIA - Property "JdbcDriver " not supported by "TissDataSource"
ADVERTÊNCIA - Property "Password " not supported by "TissDataSource"

2014-09-15 15:54 GMT-03:00 Romain Manni-Bucau <rm...@gmail.com>:

> Hi
>
> try type=DataSource
>
> + JdbcUsername etc are not all supported, That's Username for instance
>
> see http://tomee.apache.org/common-datasource-configurations.html and
> http://tomee.apache.org/datasource-config.html
>
>
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
> 2014-09-15 20:43 GMT+02:00 Felipe Jaekel <fk...@gmail.com>:
> > Hi,
> >
> > I'm trying to create a MySQL test dataSource in TomEE 1.7.0+ like this:
> >
> >  @BeforeClass public void setUp() throws Exception { final Properties
> > properties = new Properties();
> > properties.setProperty("openejb.embedded.remotable", "true");
> > properties.put("TissDataSource",
> > "new://Resource?type=javax.sql.DataSource");
> > properties.put("TissDataSource.JdbcDriver ", "com.mysql.jdbc.Driver");
> > properties.put("TissDataSource.JdbcUrl ", "jdbc:mysql://
> > 192.168.1.249:3306/TISS"); properties.put("TissDataSource.JdbcUsername
> ",
> > "***"); properties.put("TissDataSource.JdbcPassword ", "***"); container
> =
> > EJBContainer.createEJBContainer(properties); }
> >
> >
> > But in the console I see this:
> >
> > INFORMAÇÕES - Configuring Service(id=TissDataSource, type=Resource,
> > provider-id=Default JDBC Database)
> > INFORMAÇÕES - Creating TransactionManager(id=Default Transaction Manager)
> > INFORMAÇÕES - Creating SecurityService(id=Default Security Service)
> > INFORMAÇÕES - Creating Resource(id=TissDataSource)
> > ADVERTÊNCIA - Property "JdbcUsername " not supported by "TissDataSource"
> > ADVERTÊNCIA - Property "JdbcPassword " not supported by "TissDataSource"
> > ADVERTÊNCIA - Property "JdbcUrl " not supported by "TissDataSource"
> > ADVERTÊNCIA - Property "JdbcDriver " not supported by "TissDataSource"
> >
> >
> > And I run the test I get this:
> > java.sql.SQLException: invalid schema name: TISS
> > at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
> > at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
> > at org.hsqldb.jdbc.JDBCPreparedStatement.<init>(Unknown Source)
> > at org.hsqldb.jdbc.JDBCConnection.prepareStatement(Unknown Source)
> > at
> >
> org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:508)
> > at
> >
> org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:508)
> > at
> >
> org.hibernate.engine.jdbc.internal.StatementPreparerImpl$2.doPrepare(StatementPreparerImpl.java:117)
> > at
> >
> org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:183)
> > ... 98 more
> >
> > Any ideas?
> >
> > Thanks
>

Re: Test DataSource not working

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

try type=DataSource

+ JdbcUsername etc are not all supported, That's Username for instance

see http://tomee.apache.org/common-datasource-configurations.html and
http://tomee.apache.org/datasource-config.html


Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau


2014-09-15 20:43 GMT+02:00 Felipe Jaekel <fk...@gmail.com>:
> Hi,
>
> I'm trying to create a MySQL test dataSource in TomEE 1.7.0+ like this:
>
>  @BeforeClass public void setUp() throws Exception { final Properties
> properties = new Properties();
> properties.setProperty("openejb.embedded.remotable", "true");
> properties.put("TissDataSource",
> "new://Resource?type=javax.sql.DataSource");
> properties.put("TissDataSource.JdbcDriver ", "com.mysql.jdbc.Driver");
> properties.put("TissDataSource.JdbcUrl ", "jdbc:mysql://
> 192.168.1.249:3306/TISS"); properties.put("TissDataSource.JdbcUsername ",
> "***"); properties.put("TissDataSource.JdbcPassword ", "***"); container =
> EJBContainer.createEJBContainer(properties); }
>
>
> But in the console I see this:
>
> INFORMAÇÕES - Configuring Service(id=TissDataSource, type=Resource,
> provider-id=Default JDBC Database)
> INFORMAÇÕES - Creating TransactionManager(id=Default Transaction Manager)
> INFORMAÇÕES - Creating SecurityService(id=Default Security Service)
> INFORMAÇÕES - Creating Resource(id=TissDataSource)
> ADVERTÊNCIA - Property "JdbcUsername " not supported by "TissDataSource"
> ADVERTÊNCIA - Property "JdbcPassword " not supported by "TissDataSource"
> ADVERTÊNCIA - Property "JdbcUrl " not supported by "TissDataSource"
> ADVERTÊNCIA - Property "JdbcDriver " not supported by "TissDataSource"
>
>
> And I run the test I get this:
> java.sql.SQLException: invalid schema name: TISS
> at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
> at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
> at org.hsqldb.jdbc.JDBCPreparedStatement.<init>(Unknown Source)
> at org.hsqldb.jdbc.JDBCConnection.prepareStatement(Unknown Source)
> at
> org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:508)
> at
> org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:508)
> at
> org.hibernate.engine.jdbc.internal.StatementPreparerImpl$2.doPrepare(StatementPreparerImpl.java:117)
> at
> org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:183)
> ... 98 more
>
> Any ideas?
>
> Thanks