sean-cc / jain-slee

Automatically exported from code.google.com/p/jain-slee
0 stars 0 forks source link

Wrong RA entity bound to same object name #13

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Configure two RA entities with different link names (JDBC RA example):
<ra-entity
 resource-adaptor-id="ResourceAdaptorID[name=JdbcResourceAdaptor,vendor=org.mobicents,version=1.0]"
    entity-name="test_entity_1">
    <properties/>
    <ra-link name="TestRaOne" />
</ra-entity>
<ra-entity
 resource-adaptor-id="ResourceAdaptorID[name=JdbcResourceAdaptor,vendor=org.mobicents,version=1.0]"
    entity-name="test_entity_2">
    <properties/>
    <ra-link name="TestRaTwo" />
</ra-entity>

2. Create a service with two SBBs(e.g root & child) each of them respectively 
binding to a single RA entity defined in previous step.
Use identical resource-adaptor-object-name for both (e.g. 
"slee/resources/jdbc/1.0/sbbinterface").

// for SBB1
    <resource-adaptor-entity-binding>
 <resource-adaptor-object-name>slee/resources/jdbc/1.0/sbbinterface</resource-adaptor-object-name>
 <resource-adaptor-entity-link>TestRaOne</resource-adaptor-entity-link>
    </resource-adaptor-entity-binding>

// for SBB2
    <resource-adaptor-entity-binding>
 <resource-adaptor-object-name>slee/resources/jdbc/1.0/sbbinterface</resource-adaptor-object-name>
 <resource-adaptor-entity-link>TestRaTwo</resource-adaptor-entity-link>
    </resource-adaptor-entity-binding>

3. Do a context lookup for RA entity in each of the SBBs and check if the 
entity bound is the same as specified in descriptor.
(e.g. check entity name)

Context ctx = (Context) new InitialContext().lookup("java:comp/env");
ra = (JdbcResourceAdaptorSbbInterface) 
ctx.lookup("slee/resources/jdbc/1.0/sbbinterface");
// ... code to check RA entity name here ...

What is the expected output? What do you see instead?

Every SBB should receive it's own bound entity (SBB1 - "test_entity_1", SBB2 - 
"test_entity_2").
However SBB2 receives "test_entity_1" (the same entity as the first one). This 
behaviour is wrong based on
Jain SLEE 1.1 specs - section 6.13.3.1.2, page 90. Different SBB contexts 
should be isolated.
A service reproducing this issue is attached. The output produced by the 
service is:

12:15:18,260 INFO  [HDScanner] Activated 
ServiceID[name=TestService,vendor=Company,version=1.0]
12:15:19,515 INFO  [RootSbb] Root SBB active, ra entity name = test_entity_1
12:15:19,531 INFO  [ChildSbb] Child RA entity name = test_entity_1
12:15:19,531 ERROR [ChildSbb] Child RA entity expected: test_entity_2, but 
received: test_entity_1 

What version of the product are you using? On what operating system?
Linux, Windows, Mobicents 2.7.0 FINAL

Original issue reported on code.google.com by be.lietaus on 21 Nov 2012 at 12:15

Attachments:

GoogleCodeExporter commented 9 years ago
It is actually worse than originally reported: distinct SBBs of separate 
services are also affected by this issue. This means that one service can 
corrupt the component environment of SBBs of another service in the case of 
Resource Adaptor object name collision. I see this as an even worse instance of 
the issue as it is a lot more likely for developers of separate services to not 
know details of another service than it is to not know details of another SBB 
in the same service. It is not uncommon to encounter services developed by 
different vendors in the same deployment.

Even though the workaround is trivial (ensure all SBBs use unique RA object 
names), this issue can lead to subtle and difficult to troubleshoot issues.

Find attached two trivial services to demo the issue, deploy-config.xml for 
JDBC RA (also needed for the demonstration) and a server log fragment.

Scenario:
1. Deploy first service. Observe that first JDBC RA entity is bound to its 
environment.
2. Deploy second service. Observe that both services now have second JDBC RA 
entity bound to their environments, which means both services would start using 
the same DS, the same connection pool, etc.

The issue does not seem to affect env-entries.

Original comment by vil...@users.sourceforge.net on 4 Apr 2014 at 1:03

Attachments:

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 7a93afabf135.

Original comment by EMMart...@gmail.com on 1 Aug 2014 at 1:08