You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Raymond Chen (JIRA)" <ji...@apache.org> on 2017/12/29 14:45:00 UTC
[jira] [Created] (TOMEE-2157) Resource lookup in tomee.xml always
returns the first one when there is no match
Raymond Chen created TOMEE-2157:
-----------------------------------
Summary: Resource lookup in tomee.xml always returns the first one when there is no match
Key: TOMEE-2157
URL: https://issues.apache.org/jira/browse/TOMEE-2157
Project: TomEE
Issue Type: Bug
Components: TomEE Core Server
Affects Versions: 7.0.2
Reporter: Raymond Chen
I have a resource definition in my tomee.xml like this:
{code:xml}
<Resource id="jdbc/MyDatasource" type="javax.sql.DataSource">
jdbcDriver = com.microsoft.sqlserver.jdbc.SQLServerDriver
jdbcUrl = jdbc:sqlserver://localhost:1433;databasename=mydb;SelectMethod=cursor
jtaManaged = false
password = password
userName = sa
validationQuery = SELECT 1
validationInterval = 30000
testOnBorrow = true
</Resource>
{code}
The resource reference in my web.xml is like this:
{code:xml}
<resource-ref id="ResourceRef_MyJDBC">
<description>
</description>
<res-ref-name>jdbc/MyDatasource</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
{code}
Everything is working well so far. But I discovered lately that if I change the id of the resource in tomee.xml, like to "jdbc/WhateverName", it still works. When I put more resource nodes in tomee.xml, I found actually it always returns the first resource if there is no match in the lookup. If there is a match, it returns the matched resource.
The behavior seems strange to me. Shouldn't it report an error if not matching resource is found?
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)