tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raymond Chen (JIRA)" <j...@apache.org>
Subject [jira] [Created] (TOMEE-2157) Resource lookup in tomee.xml always returns the first one when there is no match
Date Fri, 29 Dec 2017 14:45:00 GMT
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)

Mime
View raw message