tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Romain Manni-Bucau (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TOMEE-2157) Resource lookup in tomee.xml always returns the first one when there is no match
Date Fri, 29 Dec 2017 14:47:00 GMT

    [ https://issues.apache.org/jira/browse/TOMEE-2157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16306314#comment-16306314
] 

Romain Manni-Bucau commented on TOMEE-2157:
-------------------------------------------

Hi Raymond,

Normally it is already logged and we fallback to the most accurate resource we can in the
list yes.

> 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