maciejka
2018-07-19 13:41:42 UTC
Hello and welcome
I am using 'apache-tomee-plume-7.0.4' with java version '1.8.0_152' on
'Linux debian 3.16.0-4-amd64'
I have basic problem with datasource configuration. My datasource is
configured like (tried various configurations - Password=xxx, Password xxx,
password=xxx, passWord xxx....):
<Resource id="jdbc/xxx" type="DataSource">
jdbcDriver=oracle.jdbc.xa.client.OracleXADataSource
jdbcUrl=jdbc:oracle:thin:@xxx.xxx.xxx.xxx:1521:xxx
UserName=xxx
Password=xxx
</Resource>
I put ojdbc.jar to tomee lib folder. During deployment of my app I have
warning like:
18-Jul-2018 16:35:13.799 INFO [main]
org.apache.openejb.assembler.classic.Assembler.createRecipe Creating
Resource(id=jdbc/xxx)
18-Jul-2018 16:35:13.900 WARNING [main]
org.apache.openejb.assembler.classic.Assembler.unusedProperty unused
property 'JdbcUrl' for resource 'jdbc/xxx'
18-Jul-2018 16:35:13.900 WARNING [main]
org.apache.openejb.assembler.classic.Assembler.unusedProperty unused
property 'UserName' for resource 'jdbc/xxx'
18-Jul-2018 16:35:13.900 WARNING [main]
org.apache.openejb.assembler.classic.Assembler.unusedProperty unused
property 'Password' for resource 'jdbc/xxx'
18-Jul-2018 16:35:13.900 WARNING [main]
org.apache.openejb.assembler.classic.Assembler.unusedProperty unused
property 'PasswordCipher' for resource 'jdbc/xxx'
18-Jul-2018 16:35:13.900 WARNING [main]
org.apache.openejb.assembler.classic.Assembler.unusedProperty unused
property 'asdf' for resource 'jdbc/xxx'
When I use my Resource like:
@Resource(name = "jdbc/xxx")
private DataSource ds;
java.sql.Connection connection = ds.getConnection();
Statement createStatement = connection.createStatement();
executeQuery = createStatement.executeQuery("...");
I get: java.sql.SQLException: ORA-01017: invalid username/password; logon
denied
but if I write:
java.sql.Connection connection = ds.getConnection("xxx", "xxx");
Statement createStatement = connection.createStatement();
executeQuery = createStatement.executeQuery("...");
it works.
Somehow 'jdbcUrl' was set on resource - despite the WARINING - and
'username' and 'password' were not.
Questions:
Why properties (username, password) set in tomee.xml for the datasource are
not taken into account and 'jdbcUrl' is?
How to trace this issue? I don't know where to search.
--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
I am using 'apache-tomee-plume-7.0.4' with java version '1.8.0_152' on
'Linux debian 3.16.0-4-amd64'
I have basic problem with datasource configuration. My datasource is
configured like (tried various configurations - Password=xxx, Password xxx,
password=xxx, passWord xxx....):
<Resource id="jdbc/xxx" type="DataSource">
jdbcDriver=oracle.jdbc.xa.client.OracleXADataSource
jdbcUrl=jdbc:oracle:thin:@xxx.xxx.xxx.xxx:1521:xxx
UserName=xxx
Password=xxx
</Resource>
I put ojdbc.jar to tomee lib folder. During deployment of my app I have
warning like:
18-Jul-2018 16:35:13.799 INFO [main]
org.apache.openejb.assembler.classic.Assembler.createRecipe Creating
Resource(id=jdbc/xxx)
18-Jul-2018 16:35:13.900 WARNING [main]
org.apache.openejb.assembler.classic.Assembler.unusedProperty unused
property 'JdbcUrl' for resource 'jdbc/xxx'
18-Jul-2018 16:35:13.900 WARNING [main]
org.apache.openejb.assembler.classic.Assembler.unusedProperty unused
property 'UserName' for resource 'jdbc/xxx'
18-Jul-2018 16:35:13.900 WARNING [main]
org.apache.openejb.assembler.classic.Assembler.unusedProperty unused
property 'Password' for resource 'jdbc/xxx'
18-Jul-2018 16:35:13.900 WARNING [main]
org.apache.openejb.assembler.classic.Assembler.unusedProperty unused
property 'PasswordCipher' for resource 'jdbc/xxx'
18-Jul-2018 16:35:13.900 WARNING [main]
org.apache.openejb.assembler.classic.Assembler.unusedProperty unused
property 'asdf' for resource 'jdbc/xxx'
When I use my Resource like:
@Resource(name = "jdbc/xxx")
private DataSource ds;
java.sql.Connection connection = ds.getConnection();
Statement createStatement = connection.createStatement();
executeQuery = createStatement.executeQuery("...");
I get: java.sql.SQLException: ORA-01017: invalid username/password; logon
denied
but if I write:
java.sql.Connection connection = ds.getConnection("xxx", "xxx");
Statement createStatement = connection.createStatement();
executeQuery = createStatement.executeQuery("...");
it works.
Somehow 'jdbcUrl' was set on resource - despite the WARINING - and
'username' and 'password' were not.
Questions:
Why properties (username, password) set in tomee.xml for the datasource are
not taken into account and 'jdbcUrl' is?
How to trace this issue? I don't know where to search.
--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html