0
  1. What would happen if I have multiple web-fragments which declare resource-refs with the same res-ref-name in case of:

    • The resource-refs have the same res-type
    • The resource-refs have different res-type
  2. Also what would happen if there is a resource-ref with the same res-ref-name in the web.xml in case of:

    • The resource-refs have the same res-type
    • The resource-refs have different res-type

I'm looking for what the specs are saying and not "try it to find out".

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Svetlin Zarev
  • 14,713
  • 4
  • 53
  • 82

1 Answers1

2

The Java Servlet Specification Version 3.1 has the following to say in §8.2.1:

The requirements about name uniqueness that exist currently for a single web.xml also apply to the union of a web.xml and all applicable web-fragment.xml files.

and §14.4 says:

The res-ref-name specifies the name of a resource manager connection factory reference. The name is a JNDI name relative to the java:comp/env context. The name must be unique within a deployment file.

Therefore your application should fail to deploy.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Steve C
  • 18,876
  • 5
  • 34
  • 37